Case study · AI agent
DocuDesk
A customer support assistant that answers only from the company's own help documents, shows which section each answer came from, looks up orders, and hands the conversation to a person when it is not sure.
This is a demonstration build for an invented furniture retailer, Harbor & Pine. It is modelled on the assistant and knowledge-base work I do for clients, whose data stays private. The demo runs entirely in your browser and answers by quoting the documents. The production version adds Claude to write the reply from the same retrieved sections (see how it works).
Demo assistant · invented company
Evaluation
Measured, not assumed
Before a change ships, 42 test questions are run through the assistant by a script. The figures below are read from the result file that script wrote.
| Type of question | Expected behaviour | Passed |
|---|
Limits of this evaluation: the escalation threshold was calibrated on the same 42 questions, the questions were written by me and not taken from real tickets, and it measures retrieval and behaviour, not the wording of generated replies. A real deployment would add a held-out set of real customer questions and a graded check of answer quality.
How it works
Five steps for every message
1. Guard
Messages that try to override the assistant's instructions or extract its prompt are refused in code, before any model is called.
2. Tool
An order number triggers an order lookup. Order facts come from the order system, never from the model's memory.
3. Retrieve
The help documents are split into sections and ranked against the question with BM25, a standard keyword ranking method, plus a small synonym list.
4. Decide
If the best match scores below a calibrated threshold, the assistant says it does not know and opens a ticket for a person. It does not guess.
5. Answer
The reply is built from the retrieved section and cites it. In production Claude writes this reply and is instructed to use only the retrieved text.
Why not embeddings?
For 39 short sections, keyword ranking is accurate, free, instant and easy to debug. Vector search earns its cost on larger or messier document sets, and can be swapped in at step 3.