mindX Augmentic Intelligence: Human-in-the-Loop (HITL) for Strategic Evolution Vision: The mindX system is designed for autonomous self-improvement and strategic evolution, driven by its MastermindAgent and CoordinatorAgent. However, true Augmentic Intelligence recognizes the value of human oversight, especially when dealing with critical system modifications or high-impact decisions. The Human-in-the-Loop (HITL) mechanism provides a crucial control point, balancing autonomy with safety and strategic alignment. Core Principle: HITL in mindX is not just a simple approval gate; it's an opportunity for human expertise to guide, validate, and course-correct the AI's evolutionary trajectory. It allows the system to operate autonomously for routine or well-understood improvements while escalating potentially high-risk or strategically ambiguous changes for human review.
// In data/config/basegen_config.json
"coordinator": {
"autonomous_improvement": {
"enabled": true,
"critical_components": [
"learning.self_improve_agent", // The SIA itself
"orchestration.coordinator_agent", // The Coordinator
"orchestration.mastermind_agent", // Mastermind is critical
"core.bdi_agent", // Core reasoning engine
"utils.config" // Central configuration loading
],
"require_human_approval_for_critical": true // Master switch for HITL
}
}
Explicit is_critical_target: true Flag: An improvement suggestion itself (e.g., generated by Mastermind's strategic assessment or Coordinator's LLM analysis) can be flagged with is_critical_target: true. Rationale: The AI, during its analysis, might determine that even if a component isn't on the global "critical" list, a specific proposed change to it carries high risk or strategic importance.
{
"id": "suggestion_xyz",
"target_component_path": "tools.experimental_new_tool",
"suggestion": "Refactor tool to use a more efficient algorithm X, potentially impacting dependent services.",
"priority": 8,
"is_critical_target": true, // AI flagged this as needing review
"status": "pending"
}
Low Confidence / Ambiguity (Future Extension): The system could be extended so that if an LLM (either in Mastermind, Coordinator, or SIA) generates a proposal or code modification with low confidence, or if multiple LLMs disagree on a course of action, it could automatically flag the item for HITL.
The HITL Workflow within mindX Orchestration
When the CoordinatorAgent._autonomous_improvement_worker() selects a backlog item that meets HITL criteria:
Status Change: Instead of directly initiating a COMPONENT_IMPROVEMENT interaction with SIA, the Coordinator updates the backlog item's status from PENDING to PENDING_APPROVAL.
logger.warning(f"Autonomous: CRITICAL improve for {target_path} (ID {item_id}) needs approval. Suggestion: {item_suggestion}")
Notification (Conceptual): While not explicitly implemented in the current code, a production system would ideally trigger notifications to human operators (e.g., via email, Slack, dashboard alert) that an item requires review.
Human Review & Action (via CLI): The human operator uses the mindX CLI to:
View the backlog: coord_backlog (items needing approval will be evident by their status).
Inspect the item: The backlog item contains the target_component_path, the suggestion (which is the context SIA will use), and potentially details from SIA if a change was already drafted but needs approval before application (see SIA's SUCCESS_NEEDS_APPROVAL output).
{
// ... other configurations ...
"coordinator": {
"llm": {
"provider": "gemini", // Or your preferred LLM for Coordinator
"model": "gemini-1.5-flash-latest"
},
"autonomous_improvement": {
"enabled": true, // ** KEY: Set to true to enable autonomous loop **
"interval_seconds": 3600, // How often the Coordinator checks the backlog (e.g., 1 hour)
"cooldown_seconds_after_failure": 7200, // How long to wait before retrying a failed item on the same component
"max_cpu_before_sia": 85.0, // Don't start SIA tasks if system CPU is above this
"critical_components": [ // List of Python module paths (package.module_stem)
"learning.self_improve_agent",
"orchestration.coordinator_agent",
"orchestration.mastermind_agent",
"core.bdi_agent",
"core.belief_system",
"utils.config",
"utils.logging_config",
"llm.llm_factory"
// Add any other components considered critical
],
"require_human_approval_for_critical": true // ** KEY: Set to true for HITL on criticals **
},
"max_concurrent_sia_tasks": 1, // How many SIA processes can run at once
"sia_cli_timeout_seconds": 600, // Timeout for SIA operations (e.g., 10 minutes)
"sia_rollback_timeout_seconds": 120
},
"mastermind_agent": {
"autonomous_loop": {
"enabled": true, // ** Enable Mastermind's own strategic loop **
"interval_seconds": 14400, // e.g., every 4 hours
"default_directive": "Proactively monitor mindX, assess tool suite effectiveness, identify strategic evolutionary opportunities for components and tools, and initiate campaigns to enhance overall system health, capabilities, and efficiency based on current state and long-term goals."
}
}
// ... other configurations ...
}
python3 scripts/run_mindx.py
Monitor Logs: Keep an eye on the console output or the log file (data/logs/mindx_debug.log if configured) for:
Coordinator: Autonomous improvement loop started.
Mastermind: Autonomous loop started.
Messages from _autonomous_improvement_worker indicating it's analyzing the system or processing backlog items.
Crucially, warnings like: Autonomous: CRITICAL improvement for 'learning.self_improve_agent' (ID abcdef12) requires human approval. Suggestion: Enhance self-test coverage.
Check Backlog Regularly:
mindX (Mastermind) > coord_backlog
Look for items with status PENDING_APPROVAL.
Review Pending Approvals:
Note the id, target_component_path, and suggestion.
If the suggestion came from an SIA run that produced code but held back promotion (due to SUCCESS_NEEDS_APPROVAL), the backlog item (or a linked interaction) should contain paths to the diff file or the proposed new code. The human operator would then manually inspect these files.
Decision Criteria:
Does the suggested improvement align with strategic goals?
Is the target component indeed critical?
Is the proposed change (if a diff is available) understandable, safe, and likely to achieve the desired outcome?
What are the potential risks if this change is applied incorrectly?
Approve or Reject:
mindX (Mastermind) > coord_approve INSTRUCTIONS.md provides a conceptual and practical guide to the HITL mechanism. The key is the configuration in basegen_config.json and the PENDING_APPROVAL status in the CoordinatorAgent's backlog flow.