Module 6 · Capstone project
Requirements and target architecture
5 min read
This final module brings everything you've learned together into a complete system: Atlas, an agent team that produces sourced summary notes, approved by a human, exposed through an API and monitored in production. We start like any serious project: with requirements and justified architecture decisions.
The need
A team produces summary notes on technical topics every week, from an internal knowledge base. Each note takes an expert 2 to 3 hours. The goal: produce a reliable, sourced first draft in a few minutes, which the expert approves or corrects.
Functional requirements
| ID | Requirement |
|---|---|
| F1 | The user submits a question in natural language. |
| F2 | The system breaks the question down and searches the knowledge base. |
| F3 | The note provides a source for every factual claim, formatted as [doc-id]. |
| F4 | A note is never published without human approval. |
| F5 | The reviewer can approve or send the note back with a comment. |
| F6 | The user can track progress (running, awaiting review, published, failed). |
Non-functional requirements
| ID | Requirement | Measure |
|---|---|---|
| NF1 | Faithfulness: no invented source | 100% of citations exist (deterministic check) |
| NF2 | Quality | ≥ 90% of notes judged faithful and complete (calibrated judge, sample) |
| NF3 | Controlled cost | Per-note budget cap, average cost tracked |
| NF4 | Latency | First draft in a few minutes; visible progress |
| NF5 | Robustness | Transient failures absorbed; no endless runs |
| NF6 | Traceability | Every run can be reconstructed (full trace) |
| NF7 | Security | Knowledge base content treated as untrusted; no exposed agent has action tools |
| NF8 | Persistence | A pending approval survives a restart |
Notice that every requirement is measurable. "The system must be reliable" isn't a requirement; "100% of citations exist" is.
The chosen architecture
┌──────────── HTTP API (FastAPI) ────────────┐
POST /briefs ─────►│ │
GET /briefs/{id} ─►│ LangGraph graph + Postgres checkpointer │
POST …/decision ───►│ │
└────────────────────────────────────────────┘
planner ──Send×N──► researchers (parallel, economy model, read-only)
│ reduce (operator.add)
▼
writer ⇄ critic (≤ 2 revisions, citation check)
│
▼
human review (interrupt) ──► published
Architecture decisions, justified
A good architecture review documents every choice and its justification. Here are Atlas's, with the lesson behind each one.
| Decision | Justification | Lesson |
|---|---|---|
| Several agents rather than one | Parallelism (independent sub-questions), context isolation (the writer doesn't read raw documents), least privilege | 1.3 |
| Plan-and-Execute + Reflexion | Big picture from the planner; quality from the bounded critique loop | 1.2 |
| Supervisor topology (not network) | Identifiable sub-tasks, traceability required (NF6), guaranteed termination | 2.1, 2.2 |
Send + operator.add reducer | Parallel map-reduce without overwriting results | 2.1, 2.3 |
| Researchers on an economy model | Bounded, repetitive task; cost (NF3) | 2.4, 5.4 |
| Pydantic contracts between agents | No ambiguity between agents; reliable routing on verdict | 3.1 |
| Summaries rather than raw documents | Minimal context, cost, writing quality | 3.3 |
| Deterministic citation check overrides the critic | NF1 requires 100%: only code can guarantee it | 3.4, 4.1 |
| Researchers without action tools | Exposed to untrusted content: no lethal trifecta (NF7) | 4.4 |
interrupt + Postgres checkpointer | F4 and NF8 | 4.2, 6.3 |
Per-run budget, MAX_REVISIONS, recursion_limit | NF3, NF5 | 4.3 |
| Centralized tracing, OpenTelemetry-compatible | NF6 | 5.1 |
| Offline orchestration tests + evaluation with the real model | Fast, free iteration; measuring NF2 | 5.2, 5.3 |
What we deliberately excluded
Requirements also state what you will not do — and why:
- Web search: it would expose researchers to uncontrolled content and make faithfulness harder to guarantee. Possible in version 2, with an isolated web researcher.
- Automatic publishing: contrary to F4.
- A network of conversational agents: no need for dialogue; the supervisor topology is simpler and more traceable.
- Long-term memory across notes: useful later (style preferences, topics already covered), not needed for the first version.
Project structure
atlas/
├── llm.py single model access point (complete, extract, refusal fallback)
├── knowledge.py knowledge base (search, read)
├── schemas.py agent contracts (Plan, Finding, Review, JudgeVerdict)
├── agents.py planner, researcher, writer, critic, human review
├── graph.py LangGraph assembly
├── guardrails.py budget, untrusted content, citation check
├── tracing.py spans, tokens, costs, OpenTelemetry bridge
├── evals.py trajectory, judge
├── mcp_server.py the knowledge base exposed over MCP
└── api.py HTTP service
examples/ one runnable script per concept
tests/ offline tests (orchestration, guardrails, API)
Each file has a single responsibility, and each requirement maps to identifiable, tested code. That's what makes the system maintainable — and what will let it evolve without breaking everything.
Key takeaways
- Measurable functional and non-functional requirements before any line of code.
- Every architecture decision is documented with its justification.
- What's excluded, and why, is part of the requirements.
- A project structure where each requirement maps to identifiable, tested code.
Hands-on
- For each requirement NF1 to NF8, identify the file and function that satisfy it.
- Write the requirements for a multi-agent system in your own context, following this template.
- Pick one exclusion (web search, for example) and describe the architecture that would allow adding it without violating NF7.