Project
Stage 4 project: Customer support assistant
Everything from Stage 4 in one build: RAG over the help centre with citations, an order-lookup tool in an agent loop, and the retrieval eval that keeps the system honest.
Time: ~4 hours if you build it yourself (recommended). Run the reference version (no API key needed — uses the local placeholder server):
python tools/mock_claude.py 8765 & ANTHROPIC_BASE_URL=http://127.0.0.1:8765 ANTHROPIC_API_KEY=mock-key \ PYTHONPATH=tools .venv/bin/python stage-4-llms-and-generative-ai/project-support-assistant/support_assistant.pyWith a real
ANTHROPIC_API_KEY(and no base-url override), the same code returns real Claude answers.
Core (build this)
- Retrieval over SUPPORT_DOCS (Part 16), measured with recall@1 and recall@3 before anything else (Part 17).
- A grounded system prompt: only-from-documents, cite ids, admit gaps (Part 15).
- One
get_order_statustool with a strict schema and an error-safe dispatcher (Part 18). - One
answer(question)function running the agent loop with a step limit, returning the text, the retrieved ids and the tool-call log.
Stretch
- An eval set of 20 questions covering: document answers, order lookups, and unanswerables — report retrieval recall, tool-use correctness and answer accuracy separately.
- Query rewriting for the two known paraphrase misses (Part 17, exercise 2 rescued both).
Production level
- Streaming responses, prompt caching for the system prompt and documents, token/cost logging per request, and a short runbook — Track A turns these into their own lessons.
What "done" looks like
Output of the reference run (against the local mock — tool calls and retrieval are real, replies are placeholders):
RETRIEVAL EVAL (real, offline)
recall@1 = 6/8
recall@3 = 7/8
>>> Can I pay cash when the parcel arrives?
retrieved: ['payment', 'damaged']
tool calls: ["get_order_status({'order_id': 'placeholder'})"]
answer (placeholder from local mock, not Claude): [mock reply]
>>> Where is my order A1001?
retrieved: ['cancel', 'damaged']
tool calls: ["get_order_status({'order_id': 'placeholder'})"]
answer (placeholder from local mock, not Claude): [mock reply]