Course map
Stage 1: Foundations
Stage 2: Machine Learning
Stage 3: Deep Learning
Stage 4: LLMs & Generative AI
Stage 5: Production & Specialization

Project

Stage 4 project: Customer support assistant

Start after Part 18

Stage 4

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.py

With a real ANTHROPIC_API_KEY (and no base-url override), the same code returns real Claude answers.

Core (build this)

  1. Retrieval over SUPPORT_DOCS (Part 16), measured with recall@1 and recall@3 before anything else (Part 17).
  2. A grounded system prompt: only-from-documents, cite ids, admit gaps (Part 15).
  3. One get_order_status tool with a strict schema and an error-safe dispatcher (Part 18).
  4. 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]

Search the guide