Recipes
Multi-Agent Shared State
Coordinate specialist agents with agent registration, scoped access, handoffs, feedback, and shared context assembly.
Current MuBit coordination is centered on registered agents plus persisted coordination artifacts.
Use this pattern when a planner, reviewer, specialist, or resolver must share memory while keeping role boundaries explicit.
Flow
- Register each agent with the scopes it should read and write.
- Persist shared facts, traces, rules, and lessons in one session.
- Use
handoff()to transfer a subtask. - Use
feedback()to record the response to that handoff. - Use
getContext()/get_context()to retrieve shared coordination context for the next agent.
Minimal implementation example
Failure modes and troubleshooting
| Symptom | Root cause | Fix |
|---|---|---|
| Specialist sees too much memory | Agent scopes are too broad | Narrow read_scopes and write_scopes |
| Coordination disappears after the turn | Handoff or feedback stayed in app memory only | Persist both with handoff() and feedback() |
| Next agent repeats work | Shared context was not reassembled | Call getContext() before each transition |
Next steps
- Add checkpoints before compaction at Support agent memory loop.
- See the route-level contract at Control HTTP reference.