Multi-Agent Deep Research: Architecture and Engineering Practices
This article explains why single-agent systems often fail at deep research and presents an architecture for multi-agent research workflows built around explicit shared state, role separation, trusted tools, mandatory citations, human checkpoints, and checkpoint recovery. It covers task modeling with a state graph, a five-role design, tool-layer contracts, private knowledge base integration, multi-format output, deployment and observability considerations, evaluation metrics, and common failure modes. Readers will learn how to make deep research more observable, recoverable, traceable, and suitable for long-running production workflows.
1. Why a Single Agent Cannot Support Deep Research
Handing deep research to a single large-model instance usually breaks down in three places.
The first is the context budget. The intermediate artifacts of a research task—retrieved snippets, full web page text, script output, data tables—far exceed the model’s context window. When they are forced into the prompt, attention gets diluted and critical constraints are buried.
The second is role conflict. The same model is expected to generate divergent questions, rigorously verify claims, and converge on a final write-up. These instruction goals pull against one another, often producing text that looks substantial while the argumentation chain is actually broken.
The third is process control. If a single-pass chained call fails, the only option is often to restart the entire flow. It cannot resume from the failed step, nor can it insert human confirmation at critical points.
The value of multiple agents is not that “multiple models are smarter.” It lies in separating cognitive responsibilities and turning the execution process into an observable, recoverable state machine.
2. Task Modeling: Turn Research into Explicit States
In engineering terms, it is better to first abstract the research process as a directed graph with shared state rather than as a long chain of prompts. The state should include at least: the research question, confirmed facts, hypotheses awaiting validation, an evidence list, coverage gaps, and the current stage.
# Illustrative pseudocode: research state and graph-based orchestrationclass ResearchState(TypedDict):question: str # Original research questionplan: list[str] # List of subquestionsevidence: list[dict] # {claim, source, quote, ts}gaps: list[str] # Dimensions not yet covereddraft: str # Current draftbudget: dict # Round/cost/time budgetdef planner(s): return {**s, "plan": split_subquestions(s["question"])}def retriever(s): return {**s, "evidence": s["evidence"] + search(s["plan"])}def executor(s): return {**s, "evidence": s["evidence"] + run_code(s["gaps"])}def critic(s): return {**s, "gaps": find_gaps(s["evidence"], s["plan"])}def writer(s): return {**s, "draft": compose(s["evidence"])}# Conditional edge: return to execution if gaps remain; force convergence if over budgetgraph.add_conditional_edges("critic", lambda s:"executor" if s["gaps"] and s["budget"]["rounds"] > 0 else "writer")
The key is conditional edges and budgets. A multi-agent system without convergence criteria may fall into endless loops. Making “gaps are empty or the budget is exhausted” a hard constraint is the first gate for stability.
3. Role Separation and Responsibility Boundaries
A recommended five-role design allows each role to do only one thing:
- Planner: decomposes the question into independently verifiable subquestions and outputs a structured plan. It does not touch the raw corpus.
- Retriever: retrieves candidate evidence for subquestions and handles deduplication, recency filtering, and source grading.
- Executor: runs scripts in a sandbox for statistics, cleaning, charts, and numerical validation, producing reproducible intermediate results.
- Critic: performs only falsification and coverage checks, identifying evidence gaps, logical jumps, and contradictory conclusions.
- Writer: produces text only from validated evidence and is forbidden from introducing new facts outside the evidence list.
Responsibility boundaries must be written into system prompts and output schema validation, rather than relying on “self-discipline.” In practice, the most effective constraint is structured output plus mandatory citations: every claim must carry an evidence ID, and the writing stage cannot fabricate support out of thin air.
4. Tool Layer: Search, Scraping, and Code Sandbox
Tools define the real capability ceiling of this kind of system. A three-layer encapsulation is recommended:
- Search layer: general search and private knowledge base retrieval run in parallel, and results are normalized into the same evidence structure with source, timestamp, and credibility.
- Scraping and parsing layer: handles body extraction, structured table reconstruction, encoding issues, and anti-scraping exceptions. Failures must return explicit errors rather than empty strings.
- Execution layer: uses an independent process or containerized sandbox, restricts network, CPU, and runtime, and relies on preinstalled dependencies rather than arbitrary runtime installation.
# Unified tool contract: errors must be explicit so the critic can detect themdef tool_search(q: str, top_k: int = 8) -> list[Evidence]: ...def tool_scrape(url: str) -> Doc: ... # Raises ToolError on failuredef tool_python(code: str, timeout: int = 30) -> RunResult: ...
Code execution must be treated as untrusted by default: mount data directories read-only, disable external network access, enforce timeout kills, and truncate output. This helps prevent prompt injection through web content from inducing arbitrary command execution.
5. Human-in-the-Loop Collaboration and Checkpoint Recovery
The value density of deep research comes from “humans make judgments, machines do the labor.” A practical approach is to divide the graph into persistable checkpoints: persist state after each node runs, and set critical nodes—plan confirmation, evidence adoption, and final conclusion approval—as interruption points that wait for human approval or rejection.
This provides three benefits. Review comments can be injected as new state instead of rerunning the entire workflow; failures can resume from the latest checkpoint with controlled cost; and the full process is traceable for retrospective review and compliance auditing. In engineering terms, message queues can decouple tasks, and object storage can save intermediate artifacts, turning long-running tasks from synchronous requests into traceable asynchronous jobs.
6. Private Knowledge Bases and Multi-Format Output
Private materials—internal documents, industry reports, and historical project repositories—should be integrated as first-class inputs. Document chunking should preserve heading hierarchy. Retrieval should combine keyword and vector recall, and the critic should then perform consistency cross-validation. This can significantly reduce the proportion of cases that “appear sourced but are actually misread.”
On the output side, use a single source of truth plus multiple renderers: maintain structured research conclusions internally—claims, evidence, charts, and citations—and then render them into report documents, slide outlines, summary cards, or data tables. This avoids repeatedly generating content for each format and prevents inconsistent statements across outputs.
7. Deployment, Observability, and Evaluation
Choose the deployment form based on scale. During validation, a single-machine container is sufficient. In production, place stateless nodes on a container platform for elastic scaling, hand long-running tasks to function-compute-style services triggered on demand, store state and artifacts in object storage, and connect logs and metrics to a unified logging service and monitoring alerts. General-purpose capabilities from cloud platforms such as Baidu AI Cloud—containers, function compute, object storage, logging, and monitoring—can cover these requirements without binding to a specific implementation.
Observability should record input/output summaries for each node, tool call latency, tokens and cost, and loop count. Evaluation can be divided into three layers: the evidence layer checks citation verifiability; the reasoning layer checks gap convergence speed and conclusion consistency; the expression layer checks structure and readability. These three layers are more useful for locating whether a problem lies in retrieval, reasoning, or writing than a single “human score.”
8. Common Pitfalls
- Too many roles without shared state, degrading into multiple disconnected single-turn calls.
- Divergence without convergence, with no budget or stop condition.
- Tool errors being swallowed, causing the critic to treat empty results as evidence.
- The writer introducing new facts beyond its authority and breaking traceability.
- Ignoring prompt injection and treating web content as executable instructions.
Conclusion: the competitiveness of a multi-agent deep research system comes from the combination of explicit state, clear roles, trusted tools, mandatory citations, and a recoverable process, not from the number of models. With this architecture, repetitive retrieval and organization can be automated while humans focus their energy on problem definition and judgment.
