Engineering · AI Agent Architecture

Multi-Agent Topologies and Shared State Orchestration

Supervisor routing, specialist agents, and typed shared state so complex workflows stay consistent without stuffing every skill into one prompt.

1. Role split and supervisor routing

Common cuts: Planner, Retriever, Executor, Critic. The supervisor reads the stage graph and issues a constrained single-turn goal to one child. Children never mutate global state directly. Route with a light classifier or rules: docs intent → Retriever; config changes → Executor with approval.

2. Shared state graphs and message contracts

Carry artifacts in a typed State (JSON Schema / protobuf). Agents exchange patches, not full chat logs. Merge parallel branches through a Critic that aligns entities before summary to reduce stitching hallucinations.

3. Concurrency, rollback, and observability

Independent subgraphs may run in parallel with causal_parent links. Failed branches support partial rollback of their artifacts only. Trace every cross-agent message for waterfall debugging.

4. Engineering checklist

5. Sample configuration

state:
  artifacts: { plan, evidence[], draft, review }
routing:
  supervisor: { allowed_handoffs: [planner, retriever, executor, critic] }

6. FAQ

Is multi-agent always better?
Worth it for heterogeneous domains and audit needs; simple Q&A is cheaper as a single agent.
How do you avoid duplicate retrieval?
Keep a retrieval_cache in shared state keyed by normalized query hash.