Skip to main content
Back to Projects
GenAI · RAG

RAG Pipeline — Insurance Documents

A retrieval-augmented generation system that lets underwriters ask natural-language questions over a corpus of insurance policies and receive grounded, cited answers.

See also AutoRAG — Architect AI, the system for designing and evaluating RAG pipelines like this one.

Hybrid BM25 + vector

Retrieval

Grounded + cited

Answers

FastAPI gateway

Interface

Problem & use case

Critical policy knowledge was buried in PDFs across legacy storage; searches returned files, not answers.

Solution & engineering approach

A hybrid retrieval pipeline (BM25 + dense vectors) feeding an LLM with strict citation prompts, served behind a FastAPI gateway.

Architecture & data flow

Chunk &embedHybridretrievalRe-rankCitedanswer
  1. 01

    Chunk and embed the policy documents

  2. 02

    Hybrid retrieval: BM25 + dense vector search

  3. 03

    Re-rank top candidates with cross-encoder

  4. 04

    LLM synthesizes grounded answer with citations

  5. 05

    FastAPI exposes /query endpoint to internal apps

Technology stack

FastAPIHugging FaceVector DBRAGLLMs