Document WorkBot as built
Start with the system you know best, because the patterns you name in it are the ones you reuse for the brief. The document runs 2 to 3 pages with one diagram, the length the curriculum gives an architecture document. Write it for the engineer who will change the system without you. Say what runs, where the state is, which model does what, and why you made each choice over the alternative.
Study first
- The patterns in today's topics. WorkBot's assistant is one agent with tools, which the topics call a monolithic agent, and Day 15's research analyst is specialists behind an orchestrator. The document approval and the schedules from Days 18 and 19 are event-driven workflows. A hybrid is a system that uses more than one of these, and WorkBot is one, so your document names which part uses which pattern, and why.
- A tradeoff names the alternative and its price, in the form "X over Y, because A, at the price of B".
- Anthropic's "Building effective agents". Start with the simplest solution, a single call or a workflow, and add an agent's autonomy only where the task needs it. Use a workflow when you know the steps in advance.
Build
- Create
docs/architecture.mdand draw the system diagram in Mermaid, a text format for diagrams that GitHub renders in place. Show the entry points (the web app, the terminal and the API), the app, the workflow engine, the database, the models, and what WorkBot calls outside. - Add a table of the agents, with each one's pattern, model, tools and what ends a run. Below it, add a paragraph on why each pattern has the fewest moving parts that handle its task.
- Describe the data, what is stored where and why, in 5 lines. Then trace the 2 flows that matter, a chat message and a document.
- List the technology as a table of need, choice and reason, and the tradeoffs as a list, each with the alternative and its price.
- Describe reliability as built and as missing. Name the limits, retries, fallbacks and guards that exist. Then name the fallback chain, circuit breaker, response cache, shared rate limit, transcripts and sign-in, which do not exist yet.
Done when
- You give the document, and nothing else, to a colleague or to an agent, and ask 4 questions. Where does a chat message's memory come from? What happens to a document whose extraction is doubtful? Which model answers which call, and what does it cost? Which component has no fallback when its service is down?
- Each answer comes from the text.

Technical notes
- 4 files are the sources for the document's claims, so a reviewer reads them beside it. The step limits are in
src/lib/agent.ts, the tables insrc/lib/schema.ts, the tools insrc/lib/tools.ts, and the prices insrc/lib/providers.ts. - List the missing capabilities in the document as proposed backlog items.
- The diagram is the Mermaid block in the document, which Chrome rendered to the image above. The document, not the image, is the source.
