The problem
Station teams in the programme need a business plan and a case study they can stand behind, and plain answers about their own country, history and operations. A ten-year plan is slow to write, and a chatbot that guesses is worse than none.
Two rules shaped everything. The first was trust: answer only from sourced material, never invent cultural, sacred, historical or property detail, and send cultural questions to the right person at the station. The second was structure: the plan follows a fixed eight-section template, with set points in each section, in the order the product owner asked for.
Who it serves
- Station teams, who ask questions and build their plan by text or voice
- Domain experts, an agricultural adviser and station people, whose recorded talks are the source material
What I built
I architected and built the whole assistant as its only engineer, and all 365 of its commits are mine. I shaped it with the product owner and the domain experts, and I designed the agent harness at its centre.
- The agent harness: on every planning turn it runs a speaking agent, a note-taking agent and a checking agent, and a coverage check decides what to ask next
- The knowledge chat: grounded answers from curated, cited source files, routed to each station's own avatar on Atlas AI, with a local fallback
- The plan store on DynamoDB, with an audit row on every change, a printed plan and a case study builder
- Voice: Amazon Transcribe in Australian English, ElevenLabs out, and Amazon Polly as the fallback voice
- Sign-in by passcode or a 15-minute magic link, with HMAC-signed sessions
- The deployment: a Next.js app on ECS Fargate (ARM64), behind a load balancer and CloudFront
- The evaluation suites, from unit tests to live-model soaks
Architecture
Two chats, one set of sources
The knowledge chat answers questions. The planning chat runs the agent harness. Both work from the same curated source files, and both cite them.
- Sign in. A passcode or a 15-minute magic link starts a session. Middleware checks an HMAC-signed session cookie on every API call.
- Question. A short follow-up joins the earlier question, so it keeps its subject.
- Station avatar. The app maps the station to its own avatar on Atlas AI and sends the turn over a WebSocket. Atlas AI runs its Gate, guardrails, knowledge bases and answer model. The app allows 10 seconds to connect and 20 seconds for each turn, with one retry when the Gate is busy.
- Local fallback. If Atlas AI fails before its first word, Claude Sonnet 4.6 answers from the local source files, passed as cited document blocks with prompt caching.
- Source credits. The app ranks up to three source credits by the rare words that the answer and each file share. A "do not know" answer gets no credit, so a non-answer never looks sourced.
- Planning message. The station team types or speaks. Speech goes through Amazon Transcribe in Australian English.
- Three agents. A speaking agent streams a short reply. A note-taking agent must call
save_textwith a field from a fixed list and a status, filled or to confirm. A checking agent flags what is still missing. - Code guards and save. Code keeps numbers, drops noise, marks points to confirm, and drops any number that is not in the plan. The plan store saves the note to DynamoDB with an audit row.
- Gap check. A coverage check must call
open_pointswith IDs from a fixed list. It decides the next question, and when the plan is ready for a case study.
Key decisions and trade-offs
- Forced tool calls on fixed listsThe note-taker cannot answer in prose. It must call
save_textwith a field from a fixed enum and a status, and the gap check must callopen_pointswith point IDs from another enum. A model cannot invent a section that does not exist, and code can check every note before it is saved. The cost is flexibility, which a fixed plan template does not need. - Three agents with one job eachOne prompt that tries to speak, take notes and check coverage at once has to trade each job against the others. Split apart, the speaker stays short and quick, while the note-taker and checker run on a stronger model, Claude Sonnet 5, where accuracy matters more than speed.
- Pick each model by measurementI benchmarked models for each role. The speaker runs on Claude Sonnet 4.6, with a first word in 0.68 s. Claude Haiku 4.5 answered in 0.85 s but missed most answers, so it runs no role at all.
- No vector store, on purposeThe source set is small and curated, so every station and programme file goes to the model as a cited document block, with prompt caching on the system text and the last document. Retrieval cannot miss a file, and every answer can cite its source. A much larger corpus would need retrieval, and the station avatars on Atlas AI already have it.
- Curated sources, marked for trustPeople clean each talk transcript into markdown with front matter for source, speaker, status, visibility and topic. A file marked as a placeholder never counts as the station's own words.
- Code checks the modelGuards in code keep numbers, drop noise and mark points to confirm, and a fact check drops any number that does not appear in the plan.
- Fail to a cited answer, not to an errorIf Atlas AI fails before its first word, the local fallback answers from the same cited files. One setting switches the model provider between the Anthropic API and Amazon Bedrock, with written rollback steps.
Evaluation and quality
An agent harness is only as good as its evaluation, so evaluation was part of delivery, with the pass rules written in code.
- 642 unit tests in 90 files, and 60 browser tests in 25 Playwright specs
- 18 live-model test files that call the real models, including replays of the product owner's real chats for confirmations and gaps
- A nine-persona soak. Claude Sonnet 5 plays each of nine personas for 12 turns, then judges each transcript against 12 rules. The pass rule lives in code: total breaks must not exceed the number of personas
- A knowledge bar: the station knowledge suite must pass 19 of 20
- A turn log with one JSON line for each step of each turn, so a bad answer traces back to the agent that caused it
- A model benchmark for each role, so each agent's model is chosen on latency and accuracy together
Safety, privacy and failure handling
- Grounding outranks warmth. The speaking agent answers only from the source documents, and never invents cultural, sacred, historical or property detail
- Cultural questions go to people, not the model: the assistant refers them to the right person at the station
- Crisis cards are spoken once, through the platform's safety path
- Bounded waits: 10 seconds to connect to Atlas AI, 20 seconds for each turn, one retry when the Gate is busy, then a cited local fallback
- Saves that survive a slow store: each save tries twice, and the speaker waits up to five seconds for a slow save
- An audit row on every plan change, and signed sessions with short-lived magic links
- A local preview never writes to the live table
- A closed edge: the load balancer accepts traffic only through CloudFront
Results
- 365
- commits, all of them mine
- 702
- automated tests: 642 unit tests and 60 browser tests
- 18
- live-model test files, plus a nine-persona soak
- 3
- agents on every planning turn, with forced tool calls
- 8
- plan sections, read by a coverage check that decides the next question
- 0.68 s
- to the speaking agent's first word, in the role benchmark
Stack
- Claude Sonnet 4.6
- Claude Sonnet 5
- Amazon Bedrock Converse
- Anthropic API
- Tool use
- Citations
- Prompt caching
- Next.js
- TypeScript
- DynamoDB
- ECS Fargate
- CloudFront
- Amazon Transcribe
- ElevenLabs
- Amazon Polly
- Playwright
- Atlas AI