The Real Fullstack

The Hallucinating RAG

The assistant said 14 days. The policy says 30. Did the model make it up — or did we feed it the wrong page?

工程师10 分钟流程模拟器调试实验室
ragembeddingsvector-dbllmpython

此挑战尚未翻译为简体中文,你正在阅读英文版本。

任务:First find out which evidence reaches the model, then configure retrieval and the answer policy so the assistant answers both parts of the question from current sources, cites them, refuses when evidence is missing, and stays within an 1,800-token context budget.背景 · 学习目标 ▾

Tallow Cloud, a fictional SaaS company, runs a retrieval-augmented support assistant over its knowledge base. A customer was refused a refund on day 20 after the assistant answered “14 days”, with no citation. The current policy grants 30 days for annual Enterprise plans, on request from an account admin.

任务: First find out which evidence reaches the model, then configure retrieval and the answer policy so the assistant answers both parts of the question from current sources, cites them, refuses when evidence is missing, and stays within an 1,800-token context budget.

学习目标

  • Debug a RAG answer by inspecting what was retrieved, not just what was generated.
  • Use reranking and metadata filters to get the right evidence into a small context.
  • Enforce grounding: cite sources and refuse when the context lacks the answer.
模拟模拟数据
CustomerAssistant APIEmbedding modelVector DBRerankerLLM
运行模拟
  • 09:12:04INFOassistantQ: "What is the refund window for annual Enterprise plans?"
  • 09:12:05INFOassistantA: "Enterprise customers can request a refund within 14 days." (no citation)
  • 09:20:41WARNsupportTicket #4411: customer denied refund on day 20, policy says 30 days for annual Enterprise
  • 09:21:10INFOkb-syncrefund-policy-v3-2025 indexed; refund-policy-v1-2023 still indexed (no version filter)

简化说明

Similarity and reranker scores are fixed, synthetic numbers and each claim is supported by exactly one document. Real systems need evaluation sets to measure retrieval quality and groundedness. 教学模型——数字用于说明行为,并非基准测试。

概念

相关挑战

参考资料