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. 教育用モデルです。数値は挙動を示すためのもので、ベンチマークではありません。

コンセプト

関連する課題

参考資料