LLM evaluation

Assert citations map to retrieved context

Hard120 pts~45 min
  • Citations
  • RAG
Practice app · Acme Support Assistant

A deterministic LLM-style support assistant with retrieval (RAG), JSON mode, safety policies and tool calls, exposed via UI and API.

BASE_URL
/api/practice
Console app
/lab/ai-testing-assert-citations-map-to-retrieved-context

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Verify that every citation points at a real knowledge-base document and quotes it faithfully.

Your task

  1. 1GET BASE_URL + "/ai/kb" and index documents by id.
  2. 2Ask "How long do I have to request a refund?".
  3. 3For each citation assert doc_id exists in the KB, title matches, and snippet appears in the document content.

Acceptance criteria

  • GET /ai/kb returns 200
  • POST /ai/chat returns 200
  • At least 3 assertions pass

LLM evaluation · AI Testing · Hallucination & grounding (RAG)