Skip to content
Ali Zarreh
Open source Developer tools

GenAI Docs Helper

Question answering over technical documentation that checks its own answers.

A LangGraph RAG workflow that grades retrieved documents, rephrases the question when nothing relevant comes back, and checks each answer for hallucination before returning it — with caching and parallel retrieval to keep it fast.

retrieval strategies: fast, standard, comprehensive
3
self-checks: document grading and hallucination detection
2
cache layers: Redis and in-memory
2

Why it exists

Technical documentation — for forecasting systems, model performance, time-series methods — is exactly where a plain retrieve-then-generate pipeline fails quietly. It retrieves something loosely related, and the model writes a confident answer anyway.

This project explores the corrective-RAG pattern: let the workflow notice when retrieval was poor or the answer drifted from the sources, and do something about it before the user sees the result.

How it works

  1. 01 Input Question
  2. 02 Code Retrieve documents fast / standard / comprehensive
  3. 03 Check Grade relevance batch grading
  4. 04 Model / AI Rephrase & retry only if nothing relevant
  5. 05 Model / AI Generate answer
  6. 06 Check Hallucination check retry if it fails
In order · Code Independent check Model / AI
  • Retrieval has three paths — fast, standard and comprehensive — so simple questions do not pay the cost of an exhaustive search.
  • Documents are graded before use. A grader assesses relevance in batches; if nothing relevant is found, the question is paraphrased and retrieval runs again.
  • Answers are checked against their sources. A hallucination grader verifies the generated answer is supported by the retrieved documents; if it is not, the workflow loops back rather than returning it.
  • Speed where it matters: a dual-layer cache (Redis and in-memory), parallel retrieval, batch grading and early stopping.

Results and honest limits

  • Delivery: a modular LangGraph workflow with separate, documented nodes for retrieval, grading, generation and paraphrasing, runnable in LangGraph Studio for step-by-step inspection.
  • Model flexibility: works with hosted OpenAI models or local models through Ollama.
  • Operations: structured logging and performance metrics for each step.

Engineering decisions

  • Loops instead of one-shot generation: poor retrieval and unsupported answers are handled as explicit graph transitions, not as prompt instructions.
  • Separate, single-purpose chains for generation, retrieval grading and hallucination grading, so each can be tested and swapped independently.
  • Cost-aware paths: multiple retrieval depths, caching and early stopping keep simple questions cheap.

Who it’s for

For teams building internal knowledge assistants, it is a compact, readable example of corrective RAG. For engineers learning LangGraph, it shows how self-checks become nodes and edges rather than hopes.

All case studies
Clinical Care Navigator home page with the four-step guardrail flow: pre-flight screen, record lookup, post-flight check, and publish, hold or replace
Live demo Healthcare

Clinical Care Navigator

An assistant that explains a patient's own record, with independent safety checks before and after the AI. Dosing questions are refused, emergencies get urgent guidance, and answers that conflict with the record — such as a critical lab value — are overridden and sent to a clinician.

  • Evaluation & guardrails
  • Agentic AI
  • RAG & retrieval
Claim Processing Agent claim-submission form with a sample auto-insurance claim and the active pipeline status
Live demo Insurance

Claim Processing Agent

An agentic RAG system that validates an auto-insurance claim against policy records, retrieves the relevant policy language, checks the claimed repair cost against market estimates, and returns a structured, explainable coverage decision — through two interchangeable agent frameworks.

  • Agentic AI
  • RAG & retrieval
  • Evaluation & guardrails
Credit Decisioning review page showing the model's reasons and the eight notice-verification checks
Live demo Finance

Credit Decisioning

A calibrated credit model, notices written by code from a reviewed template, an independent eight-check verifier proven by mutation testing, and a human who makes the call. A read-only AI analyst explains cases — and code checks every number it states.

  • Evaluation & guardrails
  • Fairness & explainability
  • Machine learning

Open to consulting, advisory roles and select projects.

Building AI that has to be right?

I help teams design systems with verifiers, guardrails and human review built in from the start — not bolted on after the demo.

Search zarreh.ai