- Decide when local subagents are worth using.
- Create persistent memory without turning it into a chaotic junk drawer.
- Apply limits on steps, tools, time, and compute.
Start with narrow roles
- Planner: decides the plan and success criteria; does not edit.
- Retriever: fetches context from files, RAG, or documentation.
- Executor: applies scoped changes.
- Verifier: runs tests, reviews diffs, and detects regressions.
task:
goal: "Add validation without breaking the public API"
max_total_steps: 16
max_parallel_agents: 2
memory_file: ".agent/state.md"
agents:
planner:
can_edit: false
max_steps: 3
executor:
can_edit: true
allowed_paths: ["src/", "tests/"]
max_steps: 6
verifier:
can_edit: false
commands: ["npm run lint", "npm test"]
max_steps: 4Minimal persistent memory
Memory should store decisions and state, not the entire chat. If you store noise, the agent will retrieve noise.
# .agent/state.md ## Current goal Fix email validation without changing public contracts. ## Decisions - Do not touch the database. - Keep exported function names. ## Evidence - npm run lint: pending - npm test: pending ## Blockers - Need to confirm behavior with international emails.
Circuit breakers for runaway loops
Evaluate the trajectory, not just the answer
In multi-agent systems, a correct final answer can hide an expensive, fragile, or unsafe process. Save the decision sequence to know whether the system chose tools well, avoided useless steps, and asked for help when appropriate.
trajectory_eval:
task_id: "bugfix-142"
final_result: "pass"
checks:
tool_use_accuracy: "ok"
repeated_steps: 0
unnecessary_agents: 1
human_approval_used: true
tests_run:
- "npm test"
- "npm run lint"
decision: "works, but reduce planner+researcher to a single role"loop_guards:
repeated_tool_call:
same_tool_same_args: 2
action: stop_and_summarize
no_state_change:
steps_without_new_evidence: 3
action: ask_human
compute_budget:
max_runtime_minutes: 20
max_gpu_memory_percent: 90
action: pause
failed_command:
same_error: 2
action: change_strategy_or_stopOfficial sources
- Hermes Agent documentation
- LangGraph Docs
- LangGraph Persistence
- Model Context Protocol