Skip to main content

🏆 RAG Evaluation Suite

A comprehensive, asynchronous, and framework-agnostic library for evaluating Retrieval-Augmented Generation (RAG) pipelines.

PyPI version License: MIT

This tool provides a complete, end-to-end workflow for RAG evaluation—from automatically synthesizing a high-quality test set from your own documents to running a suite of sophisticated, AI-powered diagnostic metrics.


✨ Key Features

  • Comprehensive "RAG Triad" Metrics: Evaluate Context Relevance, Faithfulness, and Answer Relevance.
  • Advanced Diagnostics: Includes Answer Completeness to pinpoint why an answer is strong or weak.
  • Automated Test Case Generation: Use the built-in Data Synthesizer to create test cases from any document.
  • High-Performance Async Pipeline: Powered by asyncio for fast, parallel execution.
  • Framework-Agnostic: Works with any RAG system—LangChain, LlamaIndex, or plain Python.
  • Flexible Judge Model: Supports GPT-4o, Claude 3 Opus, or local models (e.g., via Ollama).

🚀 Quick Start

1. Installation

pip install rag-eval-suite

2. Run Your First Evaluation

Create a Python script using the RAGEvaluator:

import asyncio
from rag_eval_suite import RAGEvaluator
from rag_eval_suite.data_models import TestCase, RAGResult

# 1. Instantiate the evaluator (uses local Ollama model by default)
evaluator = RAGEvaluator(judge_model="ollama/llama3")

# 2. Define test case and RAG system output
test_case = TestCase(
    question="What are the notable features of the stadium's pitch and roof?",
    ground_truth_context=["The stadium features a fully retractable roof... and a hybrid pitch..."],
    ground_truth_answer="The stadium has a fully retractable roof and a hybrid pitch."
)

rag_result = RAGResult(
    retrieved_context=["The stadium features a fully retractable roof... and a hybrid pitch..."],
    final_answer="The stadium has a fully retractable roof."  # Intentionally incomplete
)

# 3. Run the evaluation
async def main():
    evaluation_result = await evaluator.aevaluate(test_case, rag_result)
    print(evaluation_result.scores)

if __name__ == "__main__":
    asyncio.run(main())

🔧 Configuration

To use other models (e.g., OpenAI’s GPT-4o), configure via environment variables:

import os
os.environ["OPENAI_API_KEY"] = "sk-..."

evaluator = RAGEvaluator(judge_model="gpt-4o")

🤝 Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.


📄 License

This project is licensed under the MIT License.

Metadata

Release files for ragscope 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 ragscope 0.1.0
File Size Uploaded Provenance Actions
ragscope-0.1.0.tar.gz 25.9 kB Without provenance Details for ragscope-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 53.9 kB

Release files / ragscope-0.1.0.tar.gz

Download URL ragscope-0.1.0.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
93e9fab856972c82f01b1eb3dfd8af4a1c7f400841d85a35d3e4b10475723b21
BLAKE2b-256 checksum
How to use checksums
3cd443c4bd7ec1b9001d456df777657510be17dd87759d97d2abfa6bbcd90366
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

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

Download URL ragscope-0.1.0-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa9493aad77569915393abc23525da9e0a4074e8f0ca8e5131a626f5f6e6d951
BLAKE2b-256 checksum
How to use checksums
533d8ecd2c9bc8591e4f10b9fdf2dc363a0d5e2bb55a6d3bc72004fd8dddbf65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Security for ragscope 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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 No 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