Skip to content

unaxartu/RAG-evaluating-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG Evaluation Framework for Technical AI Documentation

A reproducible framework for evaluating Retrieval-Augmented Generation (RAG) systems on technical AI documentation. The project is designed to compare different retrieval and generation configurations and measure how changes in chunking, embeddings, retrieval settings, and reranking affect answer quality and grounding.[1][2]

Project Overview

Many RAG projects are validated informally, which makes it hard to know whether a system is actually improving or only appears better on a few manual examples.[3] This project addresses that by creating a structured evaluation workflow with a versioned evaluation dataset, controlled experiment configurations, and comparable metrics for both retrieval quality and final answer quality.[1][4]

The framework is focused on technical AI documentation, including topics such as RAG pipelines, embeddings, rerankers, prompt design, model serving, evaluation, and fine-tuning.[5][1] The goal is not to build another chatbot, but to build a reliable environment for testing and comparing RAG system behavior under different configurations.[1][3]

Problem Statement

RAG systems can fail for different reasons: they may retrieve irrelevant chunks, miss the right context, or generate answers that are incomplete, misleading, or not fully supported by the retrieved documents.[2][1] Without a proper evaluation framework, it is difficult to identify where the pipeline is failing and whether a given change improves retrieval, generation, or both.[6][3]

This project aims to answer the following question:

Which combination of chunking strategy, embedding model, retrieval configuration, and reranking produces the most relevant and faithful answers for technical AI documentation?

Project Goals

  • Build a reproducible evaluation framework for RAG systems.[1][3]
  • Create a domain-specific evaluation dataset for technical AI documentation with metadata-rich samples.[7][8]
  • Compare multiple RAG configurations under the same evaluation conditions.[9][6]
  • Measure retrieval quality and answer quality separately, then analyze end-to-end performance.[1][10]
  • Produce clear reports that explain what improves the system and what trade-offs appear.[3][4]

Scope of the MVP

The initial version of the project is intentionally limited to keep the evaluation process focused and reproducible.[11] The MVP includes:

  • One domain-specific document corpus focused on AI engineering topics.[1]
  • An evaluation set of approximately 30 to 50 representative questions.[7][8]
  • One baseline RAG configuration.[3]
  • Two to four controlled experimental variants.[9][6]
  • A final report summarizing metrics, comparisons, and trade-offs.[4]

Evaluation Domain

The framework evaluates RAG performance on technical AI documentation. The corpus is expected to include technical articles, guides, and explanatory documentation related to:

  • Retrieval-Augmented Generation (RAG)
  • Embeddings and vector search
  • Reranking
  • Prompting strategies
  • LLM serving and inference
  • Fine-tuning and adaptation
  • Evaluation methodologies for GenAI systems

This domain was chosen because it is technically rich, realistic for AI engineering work, and well suited for retrieval-heavy question answering tasks.[1][5]

Evaluation Dataset Design

The evaluation dataset is one of the most important parts of the project. Modern RAG evaluation guidance emphasizes representative test sets, good metadata, and explicit references or expected outputs to support meaningful analysis.[7][8][12]

Each sample in the evaluation set should contain:

  • question_id
  • question
  • question_type
  • topic
  • difficulty
  • expected_answer or reference notes
  • Optional manual notes for evaluation

The dataset should include a balanced mix of question types, such as:

  • Factual questions
  • Comparative questions
  • Procedural questions
  • Diagnostic questions
  • Multi-document or multi-hop questions

Baseline Configuration

The first implementation of the framework uses a simple and clearly documented baseline so that future improvements can be measured against a stable reference point.[3][4] The baseline should define:

  • A default chunking strategy
  • A default embedding model
  • A default retrieval setup and top-k value
  • No reranker in the first baseline version
  • A simple and stable answer generation strategy

The first comparison experiment is expected to measure the effect of adding a reranker while keeping the rest of the pipeline unchanged.[4][13]

Planned Experiments

The framework is designed to support controlled experiments where one variable changes at a time.[9][11] Initial experiments include:

  1. Baseline vs. baseline + reranker.[4]
  2. Chunking strategy A vs. chunking strategy B.[6][13]
  3. Embedding model A vs. embedding model B.[1]
  4. Retrieval parameter tuning, such as top-k comparison.[13]

Each experiment should store:

  • Configuration used
  • Questions evaluated
  • Retrieved contexts
  • Generated answers
  • Retrieval metrics
  • Generation metrics
  • Notes about observed failure modes

Metrics

The framework should evaluate retrieval and generation separately, because overall answer quality depends on both components.[1][10] Depending on the tooling used, the project may track metrics such as:

Retrieval-oriented metrics

  • Context precision
  • Context recall
  • Retrieval relevance

Generation-oriented metrics

  • Answer relevancy
  • Faithfulness / grounding
  • Correctness against reference answer

System-level metrics

  • End-to-end answer quality
  • Latency per query or experiment
  • Trade-off between quality and complexity

These metrics align with current RAG evaluation practices, which emphasize groundedness, relevance, and the ability to diagnose retrieval failures separately from generation failures.[1][14][15]

Repository Structure

rag-eval-framework/
├── README.md
├── requirements.txt
├── .env.example
├── .gitignore
│
├── data/
│   ├── documents/
│   ├── eval_dataset/
│   └── references/
│
├── configs/
│   ├── baseline.yaml
│   ├── retrieval.yaml
│   ├── reranker.yaml
│   └── generation.yaml
│
├── src/
│   ├── ingestion/
│   ├── chunking/
│   ├── indexing/
│   ├── retrieval/
│   ├── reranking/
│   ├── generation/
│   ├── evaluation/
│   ├── experiments/
│   └── reporting/
│
├── runs/
│   ├── baseline/
│   ├── chunking_comparison/
│   └── reranker_comparison/
│
├── reports/
│   ├── metrics/
│   ├── charts/
│   └── conclusions.md
│
└── tests/
    ├── data/
    ├── retrieval/
    ├── generation/
    └── evaluation/

This structure keeps datasets, configurations, experiments, and reports clearly separated, which supports reproducibility and project clarity.[11][16]

Reproducibility Principles

Reproducibility is a core design goal of this project. Best practices for AI and ML repositories recommend clear configuration tracking, documented datasets, explicit experiment definitions, and a consistent way to store outputs and evaluation results.[17][11][18]

To support reproducibility, the project should:

  • Version datasets and configurations.[7][11]
  • Record exactly which configuration was used for each run.[17]
  • Save outputs and metrics for every experiment.[11]
  • Keep evaluation criteria explicit and documented.[17]
  • Make it easy to rerun comparisons under the same conditions.[16]

Why This Project Matters

This project demonstrates more than basic GenAI application building. It shows the ability to define an evaluation problem, design a dataset, structure controlled experiments, and explain results with technical rigor.[3][19] That makes it especially relevant for AI Engineer or LLMOps-oriented roles, where system quality, measurement, and reproducibility matter as much as model integration.[4][18]

Current Status

This repository is currently in the project definition and setup phase. The next milestones are:

  • Finalize the evaluation scope
  • Build the first version of the document corpus
  • Create the evaluation dataset
  • Define the baseline configuration
  • Implement the first baseline vs. reranker comparison

Future Improvements

Planned extensions for later iterations include:

  • More diverse domains beyond technical AI documentation
  • Synthetic or semi-synthetic evaluation data generation.[20][21]
  • Additional retrieval and reranking strategies.[6]
  • Automated experiment dashboards
  • Expanded failure analysis by question type and topic.[8]

License

This project is intended as an educational and portfolio project. A final license will be added once the initial implementation is complete.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors