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?

Ingeniero10 minSimulador de flujosLaboratorio de depuración
ragembeddingsvector-dbllmpython

Este reto aún no está traducido al Español. Estás leyendo la versión en inglés.

Misión: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 aprendizaje ▾

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.

Misión: 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 aprendizaje

  • 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.
SimulaciónSimulado
CustomerAssistant APIEmbedding modelVector DBRerankerLLM
Ejecutar simulación
  • 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)

Simplificación

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 educativo: los números ilustran un comportamiento, no son benchmarks.

Conceptos

Retos relacionados

Referencias