---
title: "Open Door: HR help desk agent | James Littlefield"
description: "HR answers cited to the handbook, with a person confirming before anything is written."
canonical_url: "https://jameslittlefield.net/projects/open-door"
meta:
  "og:description": "HR answers cited to the handbook, with a person confirming before anything is written."
  "og:image": "https://jameslittlefield.net/_og/s/o_4348c362459d3bf8.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Open Door: HR help desk agent | James Littlefield"
  "twitter:image": "https://jameslittlefield.net/_og/s/o_4348c362459d3bf8.png"
---

> Index of every page on this site: [llms.txt](https://jameslittlefield.net/llms.txt)

HR help desk agent

# Open Door

HR answers cited to the handbook, with a person confirming before anything is written.

- [Live demo view](https://opendoor.jameslittlefield.net)
- Video 3.5 min
- [Code GitHub](https://github.com/musicteachj/open-door)

Open Door

![Open Door chat. An employee asks how many sick days they get; the answer explains the California addendum and cites two handbook sections.](https://jameslittlefield.net/_ipx/f_png&s_1800x1125/images/projects/opendoor-cited-answer.png)

## 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_handbook` and `check_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

<dl>

<dt>AI</dt>
<dd>Claude Opus 5.5, Claude Haiku 5.5, Claude Sonnet 5.5 (eval judge), Anthropic SDK, Voyage voyage-4 embeddings</dd>

<dt>Frontend</dt>
<dd>React 19, TypeScript, Vite, Tailwind CSS v4, shadcn/ui</dd>

<dt>Backend</dt>
<dd>Python, FastAPI, SQLAlchemy 2, server-sent events</dd>

<dt>Data</dt>
<dd>PostgreSQL with pgvector, row-level security, envelope encryption</dd>

<dt>Infra</dt>
<dd>Docker, AWS ECS on EC2, GitHub Actions</dd></dl>

## 05Architecture

**Browser**Streams the answer over SSE

**Spend ledger**Reserves worst-case cost first

**Haiku guard**Screens every message, fails closed

crisis

sensitive

ordinary

if crisis

**Crisis text**Fixed, human-written

if sensitive

**HR**Goes to a person

if ordinary

**Opus agent loop**11 strict tools and hybrid retrieval (full-text plus pgvector), filtered to the asker's state

**Cited answer**Numbered sources

or

**Proposal card**Expires in 15 minutes

**Person confirms**Runs once, writes the audit event

## 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

Open Door

![A Book PTO proposal card with Confirm and Dismiss buttons.](https://jameslittlefield.net/_ipx/f_png&s_900x738/images/projects/opendoor-confirm-card.png)

*Proposal card. Nothing happens until a person confirms.*

Open Door

![The show your work panel listing tools called and handbook sections retrieved, cited or not.](https://jameslittlefield.net/_ipx/f_png&s_900x562/images/projects/opendoor-show-your-work.png)

*Show your work: tools called and sections retrieved.*

Open Door

![AI ops console with time to first token, safety check time, cost per question, and a per-turn log.](https://jameslittlefield.net/_ipx/f_png&s_900x888/images/projects/opendoor-ops-console.png)

*Ops console: latency, cost, and safety checks per turn.*

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://jameslittlefield.net/#website","@type":"WebSite","name":"James Littlefield","url":"https://jameslittlefield.net/","publisher":{"@id":"https://jameslittlefield.net/#identity"}},{"@id":"https://jameslittlefield.net/projects/open-door#webpage","@type":"WebPage","description":"HR answers cited to the handbook, with a person confirming before anything is written.","name":"Open Door: HR help desk agent","url":"https://jameslittlefield.net/projects/open-door","breadcrumb":{"@id":"https://jameslittlefield.net/projects/open-door#breadcrumb"},"isPartOf":{"@id":"https://jameslittlefield.net/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://jameslittlefield.net/projects/open-door"]}]},{"@id":"https://jameslittlefield.net/#identity","@type":"Person","jobTitle":"AI Engineer","name":"James Littlefield","url":"https://jameslittlefield.net/","image":{"@id":"https://jameslittlefield.net/#/schema/image/1"},"sameAs":["https://github.com/musicteachj","https://www.linkedin.com/in/james-littlefield-93037713b/"]},{"@id":"https://jameslittlefield.net/projects/open-door#creativework","@type":"CreativeWork","description":"HR answers cited to the handbook, with a person confirming before anything is written.","name":"Open Door","url":"https://jameslittlefield.net/projects/open-door","author":{"@id":"https://jameslittlefield.net/#identity"},"image":{"@id":"https://jameslittlefield.net/#/schema/image/2"}},{"@id":"https://jameslittlefield.net/projects/open-door#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"James Littlefield","item":"https://jameslittlefield.net/","position":1},{"@type":"ListItem","name":"Open Door","item":"https://jameslittlefield.net/projects/open-door","position":2}]},{"@id":"https://jameslittlefield.net/#/schema/image/1","@type":"ImageObject","contentUrl":"https://jameslittlefield.net/images/james.jpg","inLanguage":"en","url":"https://jameslittlefield.net/images/james.jpg"},{"@id":"https://jameslittlefield.net/#/schema/image/2","@type":"ImageObject","contentUrl":"https://jameslittlefield.net/images/projects/opendoor-cited-answer.png","inLanguage":"en","url":"https://jameslittlefield.net/images/projects/opendoor-cited-answer.png"}]}
```