What Is Multi-Agent Coordination?
A multi-agent system is a software architecture where multiple autonomous agents work together to accomplish complex tasks that would be difficult or impossible for a single agent to handle effectively. Instead of building one monolithic agent that tries to do everything, developers split work across specialized agents that each focus on specific responsibilities. Why split work across multiple agents:- Separation of concerns — each agent specializes in one domain (ingestion, analysis, reporting) rather than trying to master everything
- Independent reasoning — different agents can use different models, prompts, and reasoning strategies optimized for their specific tasks
- Parallel processing — multiple agents can work simultaneously on different aspects of the same problem
- Human-like workflow decomposition — mimics how human teams naturally divide complex analytical work
- Single-agent — one
AgentContexthandles all tasks from ingestion through final output - Multi-agent — multiple
AgentContextinstances or namespaced workflows, each responsible for specific pipeline stages or analytical roles
Why Use Multi-Agent Systems?
Separation of responsibilities. Divide complex workflows into focused, manageable stages where each agent excels at its specific domain without being overwhelmed by tangential concerns. Scalability of complex workflows. Handle sophisticated analytical pipelines that require different expertise areas, processing speeds, and reasoning approaches without creating unwieldy monolithic agents. Independent reasoning stages. Enable different agents to use different LLMs, prompts, confidence thresholds, and reasoning strategies optimized for their specific tasks rather than compromising on a one-size-fits-all approach. Specialized agent roles. Create agents tailored for ingestion, enrichment, analysis, synthesis, and reporting—each with role-appropriate configurations and capabilities. Shared knowledge and evidence. Multiple agents contribute to and benefit from the same knowledge graph and memory stores, creating a cumulative evidence base that improves as more agents contribute their findings. Human-like workflow decomposition. Mirror natural human team structures where analysts, researchers, and decision-makers each contribute specialized expertise to collaborative analytical processes.When To Use / When Not To Use
Use multi-agent systems for:- Complex analytical workflows requiring multiple stages (research → analysis → synthesis → reporting)
- Multi-stage processing pipelines with distinct phases that benefit from specialized approaches
- Research and investigation workflows where different agents handle different information sources or analytical methods
- Teams of specialized agents with different roles (OSINT collector, enrichment analyst, fusion officer)
- Long-running workflows where different agents may operate at different times or schedules
- Scenarios requiring different LLMs, reasoning approaches, or confidence thresholds for different analytical stages
- Simple document summarization or single-step information retrieval tasks
- Linear workflows where one agent can handle all steps effectively without specialization benefits
- Small, straightforward tasks where the coordination overhead exceeds the complexity of the core work
- Cases where a single agent with appropriate configuration can handle the entire workflow efficiently
ContextGraph — agents read and write to the same graph, or hand off serialized state via save() and load(), with no message broker required. Use this pattern when splitting work across ingestion, enrichment, reasoning, and reporting roles that must share a single evidence base.
This guide covers multi-agent coordination. For the memory layer each agent uses internally, see Agent Memory. For graph traversal and entity linking, see Context Graphs. For decision recording and precedent matching, see Decision Intelligence.
The Three Coordination Patterns
Before writing any code, choose the right coordination pattern for your pipeline. Shared Graph Pattern: Multiple agents share references to the sameContextGraph and VectorStore objects within a single process. This provides the lowest latency since all agents see changes immediately, with built-in thread safety for concurrent access. Choose this when agents run simultaneously in the same application and need real-time access to each other’s contributions.
Save / Load Handoff Pattern: Agents run in different processes, containers, or at different times. The first agent completes its work and calls context.save(path) to serialize its complete state. The next agent calls context.load(path) to restore exactly where the previous agent left off, including full memory, graph data, and vector indices. Choose this for distributed systems, scheduled workflows, or when agents run on different machines that require shared storage access.
Namespaced Memory Pattern: A single AgentContext serves multiple logical agents, with each agent scoping its reads and writes using unique conversation_id values. Agents remain isolated by namespace rather than by separate context instances. Choose this for lightweight role separation without the resource overhead of maintaining multiple complete contexts.
The pipeline in this guide uses all three.
Pattern 1 — Shared Graph for Concurrent Ingestion
The OSINT (Open Source Intelligence — publicly available information) collector and the enrichment agent run concurrently. They share a singleContextGraph and a single VectorStore — the graph’s internal RLock makes concurrent writes safe.
Pattern 2 — Save / Load Handoff to a Reasoning Agent
The reasoning agent runs after ingestion completes. In a production pipeline this might be a separate process, a different container, or a scheduled job. The ingestion agents save their shared state; the reasoning agent loads it. Important deployment note: When agents run in different containers or on different machines, they must have access to the same saved state location through shared storage (network file systems, cloud storage, or shared volumes).load() overwrites the existing context — it clears current memory, graph, and vector state before loading. Any unsaved data in the context prior to calling load() will be lost.Pattern 3 — Namespaced Memories for Role Separation
The reporting agent does not need its own graph instance. It shares the reasoning agent’s context but scopes its writes to its own namespace — theconversation_id acts as an agent identifier to separate memory streams and prevent contamination between different logical agents.
Namespace isolation with conversation_id:
conversation_idcreates separate memory namespaces within the sameAgentContext- Each agent’s memories remain isolated unless explicitly queried across namespaces
- Prevents accidental memory contamination when different logical agents work on related but distinct tasks
conversation_id, or collectively by querying without a filter.
Common Pitfalls
Forgetting conversation_id namespaces. Without uniqueconversation_id values, different agents’ memories mix together, making it impossible to trace which agent contributed which insights. Always use distinct, meaningful conversation IDs for each logical agent.
Accidental state loss with load(). The load() function overwrites existing context rather than merging it. If you have unsaved state in an AgentContext, calling load() will wipe it. Always save your current state or use a fresh context before loading a checkpoint.
Using Shared Graph across separate processes. The Shared Graph pattern only works within a single process where agents share object references. For distributed agents running in different containers or machines, use the Save/Load Handoff pattern instead.
Assuming save/load works without shared storage. Agents in different processes, containers, or machines must have access to the same filesystem location for save/load handoffs. Ensure shared storage (NFS, cloud storage, shared volumes) is properly configured.
Overengineering simple workflows with multiple agents. Multi-agent systems add coordination complexity and potential failure points. For straightforward single-step tasks, a simple single-agent approach is often more reliable and easier to debug.
Mixing agent responsibilities excessively. Each agent should have a clear, focused role. Agents that try to do too many different tasks lose the benefits of specialization and become harder to optimize, debug, and maintain.
Ignoring memory isolation boundaries. When using namespaced memories, be careful about queries that span multiple conversation_id values. Unscoped queries can accidentally retrieve memories from other agents, breaking logical isolation.
Domain Examples
- Defense — CTI/Threat
- Security — SOC/Incident
- Life Science — Clinical/Pharma
- Banking — Risk/Compliance
A three-agent intelligence fusion cell: an OSINT collector ingests public feeds, a HUMINT (Human Intelligence — information gathered from human sources) analyst loads classified summaries, and a fusion officer synthesizes both streams into a PIR (Priority Intelligence Requirement — critical information needed for decision-making) answer. The OSINT and HUMINT agents run concurrently on a shared graph; the fusion officer loads the combined state in a separate process on an air-gapped environment (isolated network with no internet connectivity for security).
Memory Isolation Reference
When multiple agents write to a shared context, useconversation_id to isolate their streams and retrieve them individually.
conversation_id with user_id:
Related Guides
- Agent Memory — memory storage, retrieval, persistence, and the working memory window each agent uses internally
- Context Graphs — build and traverse the shared
ContextGraphdirectly; temporal interval reasoning; entity deduplication before node insertion - Decision Intelligence — record and trace decisions across agent handoffs with causal chain analysis
- LLM Integrations — configure the LLM provider passed to
query_with_reasoning()in each agent
