RAG Eval CI Pipeline
RAG application with golden evaluation datasets integrated into CI/CD — block merges when retrieval or answer quality regresses.
Project walkthrough
RAG Eval CI Pipeline
Project Goal
Treat RAG quality like code coverage — test it in CI.
- →Golden dataset of 100 Q&A pairs with gold answers
- →RAGAS metrics on every pull request
- →Block merges when quality regresses
- →Track metric trends over time
Use ← → arrow keys or buttons to navigate the walkthrough
Time breakdown (35h)
Each phase maps to the estimated hours — follow in order for a realistic build schedule.
RAG pipeline setup
8h- •Configurable chunk size, overlap, and top-k via env vars
- •Ingestion script for eval corpus (50 docs)
- •Baseline retrieval + generation chain
Golden eval dataset
6h- •Curate 100 Q&A pairs with gold answers and source citations
- •Human review of 20% for label quality
- •Version dataset in repo with changelog
CI/CD integration
8h- •GitHub Actions workflow: lint → eval → gate
- •Eval script outputs JSON with per-metric scores
- •PR comment bot posting eval results table
Metrics & thresholds
7h- •RAGAS: faithfulness, answer_relevancy, context_precision
- •Configurable thresholds in eval config YAML
- •Per-question failure report for debugging
Regression alerts & docs
6h- •Nightly eval on main, store metrics in SQLite/Postgres
- •Alert when 7-day rolling average drops 5%
- •README documenting how to add eval cases and tune thresholds
Architecture
A RAG application serves production queries while a parallel eval runner executes the golden dataset on every PR. RAGAS computes faithfulness, answer relevance, and context precision; CI blocks merges when any metric drops below thresholds, and nightly runs on main detect slow regressions.
Scroll inside the frame to explore · use + / − to zoom up to 200%
Prerequisites
- Working RAG pipeline (ingestion, retrieval, generation)
- RAGAS or DeepEval library familiarity
- GitHub Actions CI/CD experience
- Understanding of faithfulness, relevance, and context precision metrics
- Pinecone or ChromaDB vector store
Setup steps
- Build or reuse a RAG app with configurable chunk size and top-k
- Create golden eval set: 100 Q&A pairs with expected answers and source docs
- Install RAGAS and write eval script outputting JSON metrics
- Add GitHub Actions workflow running eval on every PR
- Set quality gates: faithfulness ≥ 0.85, context precision ≥ 0.75
- Configure Slack/email alert on main branch regression
Features to build
- Golden eval dataset
- CI/CD quality gates
- RAGAS metrics
- Regression alerts
- Chunking A/B comparison
Expected result
Open a PR that changes chunk size, watch CI run the 100-case eval suite, see RAGAS scores posted as a PR comment, and demonstrate a merge blocked because faithfulness dropped below 0.85.
Resume bullet points
- →Integrated RAG evaluation into CI/CD blocking merges on quality regression
- →Built golden dataset of 100 Q&A pairs with automated RAGAS scoring
