RagLens Evaluation-First RAG System
A retrieval pipeline that narrows, reranks, and evaluates evidence instead of treating a generated answer as proof that retrieval worked.
- FastAPI
- LangChain
- Qdrant
- HuggingFace
- CrossEncoder
- RAGAS
- React
RagLens retrieval and evaluation pipeline
- PDF — Source document
- Chunking
- Embeddings — 384 dimensions
- Qdrant retrieval — Up to 60 candidates
- Metadata filtering
- MMR — Up to 40 candidates
- CrossEncoder — Up to 8 final chunks
- LLM context — Final context chunks
- RAGAS evaluation — Measures retrieval results
Overview
Many RAG projects stop after generating an answer. RagLens keeps retrieval evaluation inside the engineering process.
Architecture
PDF content is chunked into 384-dimensional embeddings, retrieved from Qdrant, filtered, diversified with MMR, reranked with CrossEncoder, passed into LLM context, and evaluated with RAGAS.
Decisions
Retrieve up to 60 candidates, use MMR to select up to 40, and rerank to up to 8 final context chunks with CrossEncoder.
Measured outcomes
Context Precision moved from 0.568 to 0.792.
Evidence hit rate moved from 83.3% to 100%.
Testing
RAGAS evaluation keeps retrieval quality visible alongside the generated result.