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

IDRequirement
F1The user submits a question in natural language.
F2The system breaks the question down and searches the knowledge base.
F3The note provides a source for every factual claim, formatted as [doc-id].
F4A note is never published without human approval.
F5The reviewer can approve or send the note back with a comment.
F6The user can track progress (running, awaiting review, published, failed).

Non-functional requirements

IDRequirementMeasure
NF1Faithfulness: no invented source100% of citations exist (deterministic check)
NF2Quality≥ 90% of notes judged faithful and complete (calibrated judge, sample)
NF3Controlled costPer-note budget cap, average cost tracked
NF4LatencyFirst draft in a few minutes; visible progress
NF5RobustnessTransient failures absorbed; no endless runs
NF6TraceabilityEvery run can be reconstructed (full trace)
NF7SecurityKnowledge base content treated as untrusted; no exposed agent has action tools
NF8PersistenceA 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.

DecisionJustificationLesson
Several agents rather than oneParallelism (independent sub-questions), context isolation (the writer doesn't read raw documents), least privilege1.3
Plan-and-Execute + ReflexionBig picture from the planner; quality from the bounded critique loop1.2
Supervisor topology (not network)Identifiable sub-tasks, traceability required (NF6), guaranteed termination2.1, 2.2
Send + operator.add reducerParallel map-reduce without overwriting results2.1, 2.3
Researchers on an economy modelBounded, repetitive task; cost (NF3)2.4, 5.4
Pydantic contracts between agentsNo ambiguity between agents; reliable routing on verdict3.1
Summaries rather than raw documentsMinimal context, cost, writing quality3.3
Deterministic citation check overrides the criticNF1 requires 100%: only code can guarantee it3.4, 4.1
Researchers without action toolsExposed to untrusted content: no lethal trifecta (NF7)4.4
interrupt + Postgres checkpointerF4 and NF84.2, 6.3
Per-run budget, MAX_REVISIONS, recursion_limitNF3, NF54.3
Centralized tracing, OpenTelemetry-compatibleNF65.1
Offline orchestration tests + evaluation with the real modelFast, free iteration; measuring NF25.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

  1. For each requirement NF1 to NF8, identify the file and function that satisfy it.
  2. Write the requirements for a multi-agent system in your own context, following this template.
  3. Pick one exclusion (web search, for example) and describe the architecture that would allow adding it without violating NF7.

Resources