Skip to main content

RAG Evaluation Framework

PyPI Python CI License

A lightweight, typed Python framework for evaluating, benchmarking, and regression-testing Retrieval-Augmented Generation (RAG) systems. Provides deterministic retrieval metrics, LLM-based generation evaluation, reproducible benchmarks, and configurable CI/CD quality gates — without locking you into any LLM provider.


Overview

RAG Evaluation Framework provides a modular evaluation layer for measuring the quality, reliability, and consistency of Retrieval-Augmented Generation systems.

It separates evaluation from RAG implementation, allowing different pipelines, retrieval strategies, embedding models, and LLM providers to be evaluated through a common set of contracts and metrics.

Core Capabilities

  • Retrieval Evaluation: Recall@K, Precision@K, MRR, and NDCG.
  • Generation Evaluation: Faithfulness and Answer Relevancy.
  • Golden Datasets: Versionable evaluation datasets with expected results.
  • Regression Testing: Compare evaluation runs and detect quality degradation.
  • Quality Gates: Configurable thresholds for automated CI/CD validation.
  • Provider Agnostic: Integrate different LLM providers through adapters.

Installation

pip install rag-evaluation-framework

Optional extras:

pip install "rag-evaluation-framework[openai]"
pip install "rag-evaluation-framework[anthropic]"
pip install "rag-evaluation-framework[yaml]"

Quickstart

from rag_evaluation import (
    CallableJudge,
    DatasetCase,
    Evaluator,
    GoldenDataset,
    QualityGate,
    RAGResponse,
    evaluate_gates,
)

dataset = GoldenDataset(
    name="product-docs",
    version="0.1.0",
    cases=[
        DatasetCase(
            id="case-1",
            query="What is the default request timeout?",
            expected_doc_ids=["doc-config"],
        )
    ],
)

responses = [
    RAGResponse(
        case_id="case-1",
        retrieved_doc_ids=["doc-config", "doc-faq"],
        contexts=["The default request timeout is 30 seconds."],
        answer="The default request timeout is 30 seconds.",
    )
]

judge = CallableJudge(lambda _prompt: '{"score": 0.95, "reason": "Grounded and relevant."}')
report = Evaluator(k_values=(2,), judge=judge).evaluate(dataset, responses)

gates = [
    QualityGate(metric="recall@2", min_score=0.8),
    QualityGate(metric="faithfulness", min_score=0.85),
]
result = evaluate_gates(report, gates)
assert result.passed, result.summary_text()

See examples/quickstart.py for a runnable example.

Metadata

Release files for rag-evaluation-framework 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rag-evaluation-framework 0.1.0
File Size Uploaded Provenance Actions
rag_evaluation_framework-0.1.0.tar.gz 17.1 kB With provenance Details for rag_evaluation_framework-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rag-evaluation-framework 0.1.0
File Interpreter ABI Platform Actions
rag_evaluation_framework-0.1.0-py3-none-any.whl Python 3 none any Details for rag_evaluation_framework-0.1.0-py3-none-any.whl

Total release size: 30.2 kB

Release files / rag_evaluation_framework-0.1.0.tar.gz

Download URL rag_evaluation_framework-0.1.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
91858bc80cd565f5ee1ab6308564265a730c44baf0941bb93335c5e51f7a5e4b
BLAKE2b-256 checksum
How to use checksums
17579bbb9b624136ae51696b3a74d5db3538084d558ecbed1d74e9a5ae4eccd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / rag_evaluation_framework-0.1.0-py3-none-any.whl

Download URL rag_evaluation_framework-0.1.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f806dd08ab6bb5da77dea88a42648dbfd9fcced5de3fb6c173725d7364a52c82
BLAKE2b-256 checksum
How to use checksums
432409d84dcc7cafc438f92f977cb1223ab77eb55c1829946892965fd9f25ccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Security for rag-evaluation-framework 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rag_evaluation_framework-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page