1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
{
"name": "agentic-loop-optimization",
"description": "Protocol for transitioning from linear execution to a recursive feedback loop (Plan -> Execute -> Observe -> Correct -> Finalize).",
"tags": [
"agentic",
"loop",
"orchestration",
"quality-control",
"recursive"
],
"category": "general",
"created": "2026-06-21T14:23:51.055Z",
"updated": "2026-06-24T21:58:03.530Z",
"content": "---\nname: agentic-loop-optimization\ndescription: Protocol for transitioning from linear execution to a recursive feedback loop (Plan -> Execute -> Observe -> Correct -> Finalize).\ntags: [agentic, loop, orchestration, quality-control, recursive]\n---\n\n# Agentic Loop Optimization Protocol\n\n## 1. The Recursive Execution Cycle\nInstead of a single-shot tool call, every complex task must follow this loop:\n- **Plan**: Define the goal and the sequence of tools needed.\n- **Execute**: Perform the action.\n- **Observe**: Immediately verify the result using a complementary tool (e.g., if `write_file` is used, use `read_file`).\n- **Correct**: If the observation reveals a gap or error, spawn a sub-task to fix it *before* reporting back to the user.\n- **Finalize**: Confirm the end-state matches the original plan.\n\n## 2. The Triad Structure (High-Complexity Tasks)\nFor tasks involving architectural changes or multi-step logic, deploy three distinct roles:\n- **Architect (Lead)**: Sets the strategy, manages the VFS structure, and performs final QA.\n- **Worker (Executor)**: Handles the heavy lifting (coding, file manipulation, API calls).\n- **Critic (Verifier)**: Attempts to \"break\" the Worker's output. Specifically looks for silent failures, edge cases, and path errors.\n\n## 3. Memory-Augmented Planning\nBefore initiating the loop:\n- **Query Memory Graph**: Search for keywords related to the task to find \"Similar Past Failures.\"\n- **Constraint Injection**: Add these past failures as explicit \"Negative Constraints\" (e.g., \"Do NOT use absolute paths for /_mods/ as this caused a failure on 2026-06-21\").\n\n## 4. Verification Matrix\n| Action | Verification Tool | Success Criteria |\n| :--- | :--- | :--- |\n| `write_file` | `read_file` | Content matches intended string. |\n| `edit_module` | `test_module` | Module loads without throwing errors. |\n| `spawn_agent` | `list_agents` | Agent is registered and status is 'active'. |\n| `run_command` | `session_terminal` | Output contains expected success keyword. |\n"
}
|