1. Project Goal
Build a bounded research workflow in which a coordinator delegates two independent questions to local-source researchers, a verifier checks evidence and conflicts, and a synthesizer produces a cited result. Then compare its quality and overhead with one agent.
2. What You Will Build
3. Skills / Prerequisites
Review unfamiliar foundations before implementing the project. Each link points to an existing lesson used by the workflow.
4. Dataset or Inputs
The runnable project uses two local source records: one measured benefit and one limitation. This keeps every claim inspectable. Optional web or provider integrations belong outside the core path and must preserve source, permission and budget controls.
Understand every project input
5. Architecture / Workflow
Coordinator decomposes only genuinely separable work and assigns one owner per task.
Researchers inspect disjoint or complementary local sources and return structured evidence.
Verifier checks source presence, claim support, duplication and contradiction.
Synthesizer writes from accepted findings; coordinator stops when coverage and budgets are satisfied.
Project figure
A coordinator delegates bounded work to specialized roles
Where are tasks split, verified and synthesized?
6. Environment / Dependencies
- Python 3.10+ standard library
- Local source dictionary
- Sequential list execution for the runnable baseline
- Optional async/provider adapters only after correctness
7. Data or Input Understanding
Multiple agents are useful when work is independent, parallel or benefits from a separate verification role. One agent is better when the task is short, tightly coupled or cheaper to solve in one context.
A handoff is not a vague chat message. It needs task ID, owner, input evidence, expected output, acceptance criteria and budget. Shared state prevents two researchers from unknowingly repeating the same work.
8. Baseline / Simplest Working Approach
First ask one deterministic function to read both local sources and write a cited summary. Record its completeness, latency and operation count.
Add multiple roles only if delegation or independent verification produces a measurable improvement worth the coordination overhead.
Project figure
Every handoff carries ownership, evidence and acceptance criteria
What prevents delegated work from becoming an ambiguous message chain?
Worked Example: Compare sequential and parallel latency
Given: Coordinator takes 0.5 s, each of two researchers takes 1.2 s, verifier 0.7 s and synthesizer 0.8 s. Only the researchers can run in parallel.
- 1Sequential latency = 0.5 + 1.2 + 1.2 + 0.7 + 0.8 = 4.4 s.
- 2Parallel researcher stage latency = max(1.2, 1.2) = 1.2 s.
- 3Parallel total = 0.5 + 1.2 + 0.7 + 0.8 = 3.2 s.
- 4Speedup = 4.4 / 3.2 = 1.375×, before orchestration/network overhead.
Interpretation: Parallelism saves 1.2 seconds in this idealized trace, but it does not reduce the total research work or model cost.
9. Step-by-Step Implementation
Step 1: Run the local role pipeline
Each role is a plain function with a narrow contract. This makes the handoffs and evidence visible before any framework or model is added.
SOURCES = {
"market.txt": "Pilot users completed the task 18% faster.",
"risk.txt": "The sample contained 40 users and one industry.",
}
def researcher(task, source_name):
return {"task": task, "source": source_name, "evidence": SOURCES[source_name]}
def verifier(findings):
accepted = [f for f in findings if f["source"] in SOURCES and f["evidence"]]
conflicts = []
return {"accepted": accepted, "conflicts": conflicts}
def synthesizer(verified):
return " ".join(f"{f['evidence']} [{f['source']}]" for f in verified["accepted"])
tasks = [("measure benefit", "market.txt"), ("identify limitation", "risk.txt")]
findings = [researcher(*task) for task in tasks]
report = synthesizer(verifier(findings))
print(report)Step 2: Represent shared state explicitly
A coordinator updates task status and spend; workers may write only their owned result fields.
state = {
"budget_steps": 8, "steps_used": 0,
"tasks": {
"benefit": {"owner": "researcher_a", "status": "pending"},
"limits": {"owner": "researcher_b", "status": "pending"},
},
"accepted_findings": [], "conflicts": [],
}Step 3: Handle disagreement
Conflicting supported claims are preserved for verifier or human judgment; the synthesizer must not silently choose the more fluent one.
if claims_conflict(a, b):
state["conflicts"].append({"claim_a": a, "claim_b": b})
return request_review(state["conflicts"])10. Expected Results / Outputs
Read the output as evidence, not decoration
11. Evaluation
Measure claim coverage, source correctness, contradiction detection, unsupported-claim rate and final usefulness. Pair quality with total calls, tokens, wall-clock latency and cost.
Compare against a one-agent baseline on the same fixed sources and rubric. Count duplicated work and failed handoffs; do not reward additional role messages as progress.
Project figure
More agents can improve coverage while increasing coordination cost
When does parallelism stop paying for itself?
12. Failure Analysis
Failure mode → diagnosis → response
13. Improve the Project
14. Production Considerations
What changes beyond the notebook
15. Summary / Key Takeaways
- Multi-agent systems are justified by separable work or valuable independent verification, not by task size alone.
- The coordinator owns decomposition, non-overlapping assignments, shared state, budgets and the final stop decision.
- A useful handoff names the owner, evidence, expected output and acceptance criteria.
- Researchers return claims with sources; the verifier preserves contradictions instead of rewarding fluent agreement.
- The synthesizer writes only from accepted findings and must not introduce unsupported claims.
- Parallel workers can reduce wall-clock latency but usually do not reduce total work, calls or cost.
- Quality gains must be compared with a one-agent baseline and measured against duplication, handoff failures, latency and cost.