An advanced AI reliability and real-time hallucination correction framework. Orchestrates 14 LangGraph nodes to extract, classify, verify, and auto-correct factual drift in LLM responses using parallel web search arrays and Chroma DB.
2026
Overview
ReliantRAG is a real-time factual safety guard for artificial intelligence applications. When Large Language Models generate text, they often fabricate facts, outdated references, or website links. ReliantRAG intercepts these AI outputs in the background, extracts every factual claim made, cross-references them against live authoritative databases, and automatically corrects any detected hallucinations before they reach the user. This ensures that the final response delivered to the user is verified, accurate, and completely trustworthy.
The Problem
When organizations deploy AI models for user-facing tasks, they face a critical issue known as AI hallucinations—situations where the model states false facts, invalid specifications, or fictitious links with absolute confidence. In highly sensitive fields like medicine, engineering, or legal compliance, acting on incorrect data can lead to severe operational and financial errors.
Standard search-based AI setups (RAG) query only a single, static local database, making them unable to cross-reference the live web dynamically or verify information in real time. Furthermore, developers lack an audit trail of what errors their models make. Without an automated verification layer and a persistent error registry, systems are prone to silent factual drift, leaving users with untrustworthy AI answers.
Core Resolution Statement
ReliantRAG eliminates AI hallucinations by intercepting responses, verifying factual assertions against live databases in parallel, and cataloging anomalies in Chroma DB for continuous quality audits.
Prevents models from generating false historical specs or invalid references by comparing claims directly to real-time academic/web sources.
By saving every unsupported assertion to a local Chroma vector database, developers gain a clear audit history of model inaccuracies and drift patterns.
Orchestration
ReliantRAG compiles a state machine using LangGraph. The pipeline runs sequentially to ensure assertions are isolated, classified, checked, and modified before compiling the final response.
LangGraph StateGraph Workflow Flowchart
Vertical node graph outlining Node 1 (llm_node) to Node 14 (final_response), defining state flow from START to END.
Extracts structured assertions into Pydantic models. Classifies claims (e.g., ACADEMIC, GENERAL) to route them to the best API tools.
Executes concurrent search requests (PubMed, StackOverflow, DDG) using a ThreadPoolExecutor to fetch source context instantly.
Cross-checks claims. Unsupported assertions are labeled as hallucinations, categorized, and logged to Chroma DB memory.
Rewrites hallucinated claims based on fetched evidence, patches the original string block, and outputs a verified response.
Technical Guide
Below is a directory registry explaining the structural layout and exact script functions of the ReliantRAG workspace:
| File Name | Key Component | Functional Description |
|---|---|---|
app.py |
FastAPI Server | Server entry point. Exposes SSE streaming endpoint /api/run and memory retrieval route /api/memory. |
static/index.html |
Frontend UI | Warm-light dashboard markup hosting query inputs, progress meters, logs terminal, and diff viewports. |
static/app.js |
SSE Client Script | Manages real-time Server-Sent Events client-side. Renders claim split diff comparison tables. |
rag/graph/builder.py |
StateGraph Compiler | Compiles the 14-node LangGraph StateGraph, establishing conditional routing paths. |
rag/graph/state.py |
Pydantic Schemas | Defines models (Evidence, claim, graph_schema) ensuring typed data flow. |
rag/nodes/llm_node.py |
LLM Synthesizer | Node 1. Uses Llama-3.1-8b via Groq to synthesize the initial raw response to the user's prompt. |
rag/nodes/claim_extraction.py |
Factual Extractor | Node 2. Instructs the LLM to extract all verifiable claims from the response text into a Pydantic list. |
rag/nodes/evidence_planner.py |
Search Router Planner | Node 4. Selects the most relevant search tool (PubMed, Wikipedia, ArXiv) based on the claim type. |
rag/nodes/evidence_collector.py |
Parallel Thread Executor | Node 5. Concurrently executes planned search queries in threads to maximize collection speed. |
rag/nodes/evidence_verifier.py |
Cross-Reference Node | Node 6. Audits each claim against retrieved evidence, returning a SUPPORTED or NOT_SUPPORTED verdict. |
rag/nodes/memory_record.py |
Chroma DB Logger | Node 9. Logs hallucination records (query, claim, error category) to Chroma vector store database. |
rag/nodes/correct_hallucinated_claims.py |
Factual Correction Node | Node 11. Instructs LLM to rewrite flagged claims using the verified search evidence. |
rag/nodes/apply_corrections.py |
String Replacer | Node 13. Runs search-and-replace on the raw response, replacing outdated claims with corrected blocks. |
Tech Stack
| Technology | Specific Functionality |
|---|---|
| LangGraph | Orchestrates StateGraph workflows, claim states, and conditional routing nodes. |
| FastAPI | Asynchronous web server hosting streaming SSE generators for live progress feeds. |
| Chroma DB | Persistent local vector database logging hallucination history with metadata filters. |
| SentenceTransformers | Embeds queries and claims using all-MiniLM-L6-v2 models locally. |
| API / Library | Specific Functionality |
|---|---|
| Groq SDK | Inferences Llama-3.1-8b-instant and Llama-3.3-70b-versatile models at high speeds. |
| Search APIs | Wikipedia, PubMed, ArXiv, StackOverflow, and DuckDuckGo search wrappers. |
Showcase
The Notion-inspired clean warm-light dashboard displays real-time execution steps, reliability scores, side-by-side corrected text, and persistent database memory.
Query Console (Idle State)
The landing console where users input prompts. Features instant try-tags and visual indicators for the underlying pipeline stack (LangGraph, Chroma DB, Groq Llama-3).
ReliantRAG Analytics Dashboard
Full verification dashboard displaying real-time metrics, pipeline progress, split comparison panels, and live stdout logs terminal.
Pipeline Progress Tracker
Interactive pipeline step progress panel showing real-time step status logs from Generation to final Response Compilation.
Split Diff Comparison Panel
Side-by-side diff comparison window: the original text on the left highlights hallucinated claims in pink/red, while the right panel displays the corrected output.
Reliability Metric Badges
Zoomed-in metrics displaying a computed Reliability Score, the count of verified vs. flagged claims, and overall model confidence.
Hallucination Memory Registry
Chroma DB persistent memory registry: audits every flagged claim with its original query, categorizes the hallucination type, and tracks status.
Live Log Console Terminal
Live output console printing background logs, claims count, and routing target categories in real time.
More Projects