RAG Agent with Citation Grounding
Preventing hallucinations: a RAG agent that verifies every claim against a verbatim source quote.
- Requires each generated claim to carry a verbatim quote from a retrieved source - claims with unknown sources, fabricated quotes, unsupported terms, or numbers absent from the quote are removed before the user sees them
- Scores confidence from verifiable signals (trust x verification x (retrieval + support) / 2) instead of the model's self-reported confidence - in the demo, one invented claim out of two drops an answer to 0.42 and flags it
- Skips the LLM call entirely when knowledge-base coverage is weak, routes to a SearchProvider fallback, and abstains rather than guesses if nothing verifies
- Python
- LangGraph
- langchain-anthropic
- Claude
- Pydantic v2
- TF-IDF
- pytest