by.waclaw.online / pm-agent / 02

The Architecture: Orchestrator, Analyst, Librarian

Part 2 of 8 — the agent topology, the one source of truth they share, and the round-trip that turns a request into a story and a story into updated docs.

Three roles, one brain

The system is deliberately small: a thin Orchestrator that talks to people, and two specialist subagents — the Analyst and the Librarian — that do the real work. All three read from a single shared catalog: the living documentation of the system, which is both the Librarian's product and the Analyst's reference material.

flowchart TB PM([Product manager / stakeholder]) PM <-->|conversation| ORCH subgraph SYS[The PM Agent] direction TB ORCH["Orchestrator<br/>thin front door · routing · memory"] ORCH --> AN["Analyst subagent<br/>elicit · grill · draft stories"] ORCH --> LIB["Librarian subagent<br/>maintain · reconcile · audit"] end CAT[("The Catalog<br/>living docs · 11+ entities")] AN -->|reads for context| CAT LIB -->|reads & writes| CAT AN <-->|MCP| JIRA[("Jira<br/>user stories")] LIB <-->|MCP| GH[("GitHub<br/>docs-as-code repo")] CAT -. lives in .- GH

A thin orchestrator routes to two specialists. The catalog is the shared brain — it physically lives in the GitHub repo the Librarian maintains, and the Analyst reads it for every elicitation.

The Orchestrator: a thin front door

The Orchestrator is the agent the user actually talks to. Its job is narrow on purpose: understand what the person wants, hold the thread of the conversation, and route to the right specialist. "Help me turn this idea into a story" goes to the Analyst. "Is the fund dashboard documented? Update it." goes to the Librarian. "What would change if we added a second approval tier?" fans out to both.

Keep it thin. The temptation is to let the front door accumulate logic until it becomes a third, muddled specialist. Resist it. The Orchestrator decides who should act and carries context between turns; it does not itself draft stories or edit docs. Everything valuable — the elicitation judgment, the documentation conventions — lives in the two specialists, where it can be reasoned about and improved in isolation.

Why subagents, not one big prompt. The Analyst and Librarian have different jobs, different tools, and different failure modes. Splitting them lets each carry only the instructions and tool access it needs — the Analyst gets Jira, the Librarian gets write access to the docs repo — which keeps each one's context focused and its blast radius small. It also means you can tune, test, and trust them separately. In Claude Code these are literally separate subagent definitions; chapter 7 shows the files.

The Analyst: from fuzzy to testable

The Analyst is the requirements engineer. It takes a vague request and does what a strong human analyst does — only it never skips a step and it has the entire catalog in working memory. Its loop:

  1. Ground. Pull the relevant slice of the catalog — for a "promotion spend" request, that is the fund rules, the claims-matching logic, the relevant screens, and the authorization matrix.
  2. Grill. Interrogate the request against that knowledge: surface ambiguities, conflicts with current behavior, missing edge cases, and overlap with what already exists. This is the grill-me skill (chapter 5).
  3. Resolve. Put the open questions to the human, with the trade-offs spelled out, and capture the decisions.
  4. Draft. Produce a Jira story with INVEST-grade acceptance criteria, linked to the catalog entities it touches.
  5. Scan impact. Trace which screens, batch jobs, integrations, and rules the change ripples into, so nothing downstream is surprised.

The Analyst owns the Jira side of the world. Its durable output is a backlog of stories that are decidable and testable — and a trail showing exactly which question produced each decision.

The Librarian: the catalog never rots

The Librarian is the documentation custodian. It treats the catalog the way a good engineer treats a codebase: every change is reviewed, every entity has an owner and a freshness date, and drift is a bug to be filed and fixed. Its loop runs in the other direction from the Analyst's:

  1. Reconcile. When a story ships — a pull request merges, a schema migration lands — update the entities it affected so the catalog matches reality again.
  2. Audit freshness. Periodically find entities whose "last verified" date has gone stale, or whose underlying code changed without a doc update, and raise them.
  3. Answer. Serve the Analyst (and people) trustworthy answers about how the system works today, with provenance.
  4. Curate. Keep the catalog consistent: normalize glossary terms, fix broken cross-links, split entities that have grown unwieldy.

The Librarian owns the GitHub side. Its product is a catalog you can actually believe — chapter 4 is devoted entirely to how it keeps that promise.

The catalog is the shared brain

The piece that makes the architecture more than two disconnected bots is the catalog they share. It is not a database the agents query with SQL; it is a set of human-readable, version-controlled documents — the subject of chapter 3 — that both agents reason over directly.

This shared dependency is the whole point. Because the Analyst grills new requests against the same catalog the Librarian keeps current, the quality of elicitation rises every time documentation improves. And because the Librarian reconciles the catalog whenever an Analyst-authored story ships, the documentation improves every time the team delivers. The vicious loop from chapter 1 — vagueness and rot protecting each other — is inverted into a virtuous one.

Design rule: the catalog is the contract. Neither agent invents facts about the system. The Analyst's claims about current behavior must be traceable to a catalog entity; the Librarian's edits must be traceable to a real change (a merged PR, a migration, a human-confirmed correction). When an agent doesn't know, the answer is "the catalog doesn't cover this yet" — which is itself a useful finding, not a failure.

The round-trip, end to end

Tie the roles together with the journey of one request — the "promotion spend visibility" ask from chapter 1:

sequenceDiagram participant H as Human box rgba(26,127,55,0.10) Agents participant O as Orchestrator participant A as Analyst participant L as Librarian end box rgba(217,164,65,0.16)   participant C as Catalog end box rgba(10,110,209,0.12)   participant J as Jira end box rgba(110,33,168,0.10)   participant G as GitHub end H->>O: "Better visibility into promotion spend" O->>A: route: elicitation A->>C: read fund rules, claims logic, authz, screens A->>H: grill — 6 questions with trade-offs H->>A: decisions A->>J: create story + acceptance criteria + entity links A->>H: impact scan: 2 screens, 1 batch job affected Note over H,G: ...team builds and ships the story... G-->>L: PR merged (schema + screen change) L->>C: reconcile affected entities L->>G: open docs PR, bump last_verified

One request, both halves of the loop: the Analyst pulls knowledge out of the catalog to write a good story; the Librarian pushes knowledge back in when the story ships.

What we have, and what's next

The architecture is three roles and one shared, living catalog, wired to Jira and GitHub through MCP. Everything else in the guide fills this skeleton in: the catalog's contents (chapter 3), how the Librarian keeps it alive (chapter 4), how the Analyst grills a requirement (chapter 5), the concrete Jira and GitHub wiring (chapter 6), the Claude Code implementation (chapter 7), and how to adopt it without it becoming shelfware (chapter 8).

We start with the brain itself — the entity catalog — because everything else is in service of keeping it good.