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?

Engenheiro10 minSimulador de fluxoLaboratório de depuração
ragembeddingsvector-dbllmpython

Este desafio ainda não foi traduzido para Português (Brasil). Você está lendo a versão em inglês.

Missão: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.Contexto · Objetivos de aprendizagem ▾

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.

Missão: 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.

Objetivos de aprendizagem

  • 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.
SimulaçãoSimulado
CustomerAssistant APIEmbedding modelVector DBRerankerLLM
Executar simulação
  • 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)

Simplificação

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. Modelo educacional — os números ilustram comportamento, não são benchmarks.

Conceitos

Desafios relacionados

Referências