01Overview
An HR help desk where employees ask questions in plain language and get answers cited to the company handbook. Answers depend on the asker: a California employee's sick leave comes from an addendum, not the company default, so retrieval is filtered to each person's state and employment type. The assistant can look up balances and propose actions like a time-off request, but a person confirms before anything is written. Sensitive or crisis messages go to people, not the model.
02Key features
- Answers cited to the exact handbook passage, filtered to the asker's state and employment type
- Time-off balances, requests, approvals, and cancellations through tool calls
- Confirm-before-write: proposals expire after 15 minutes and run exactly once
- A screening model routes crisis and sensitive messages to fixed text or an HR case
- Role-based views for employees, managers, and HR, with a demo persona switcher
- Streaming answers with a "show your work" view of tool calls and sources
03How the AI works
A hand-written agent loop on the Anthropic SDK, with no framework. Three models each have one job.
- Claude Opus 5.5 answers using 11 strict tools, such as
search_handbookandcheck_time_off. - Claude Haiku 5.5 screens every message first and fails closed. Claude Sonnet 5.5 grades eval runs.
- Handbook search is hybrid: Postgres full-text plus pgvector, merged with reciprocal-rank fusion, top 5.
- Citations use the API's native search result blocks, not formatting instructions.
- Prompt caching covers about 90% of input tokens, and a spend ledger reserves cost before each call.
04Tech stack
- AI
- Claude Opus 5.5, Claude Haiku 5.5, Claude Sonnet 5.5 (eval judge), Anthropic SDK, Voyage voyage-4 embeddings
- Frontend
- React 19, TypeScript, Vite, Tailwind CSS v4, shadcn/ui
- Backend
- Python, FastAPI, SQLAlchemy 2, server-sent events
- Data
- PostgreSQL with pgvector, row-level security, envelope encryption
- Infra
- Docker, AWS ECS on EC2, GitHub Actions
05Architecture
06Results and evals
| Eval | Result | Target |
|---|---|---|
| Red team (62 items, 6 groups) | 100% | |
| Q&A program checks | 99% | |
| Unanswerable questions handled | 97% | |
| Retrieval hit rate at 5 (88 questions, MRR 0.852) | 100% | |
| Escalation recall (100 messages) | 100% | |
| Fairness groups consistent | 12 of 12 | |
| Judge pass rate (earlier runs 74, 72, 68, 73) | 80% | 85% |
| Judge agreement with an independent grader | 91.2% | |
| Cost per question, mean (p95 $0.036) | $0.019 | |
| Guard latency, p95 (p50 1,060 ms) | 1,817 ms | 800 ms |
207-item eval set, 3 trials each. Rows without a target had none listed. Two results miss their targets.
07Decisions and lessons
- Opus over Sonnet. Tested with a rule written before the runs. Sonnet was half the cost but wrote tool calls as plain text and missed a safety report, so Opus stayed.
- Guard timeout. At 4 s, a real crisis message failed closed. Raised to 10 s.
- Fairness evals. Caught a missing religious-accommodation route and an age remark. Both fixed in the prompt.
- Written down. 22 architecture decision records cover choices like these.
08Screenshots



