Skip to main content

Structure

Three dataclasses + one evaluator class:

  • QueryResult — your input. Pass query_id, retrieved_chunks (ordered list), relevant_chunks (set)
  • QueryScore — per-query scores + a failures list with human-readable diagnostics
  • EvalReport — mean scores across all queries + failed_queries list
  • RAGEvaluator — the main class, just call .evaluate() then .report()

The Failure Diagnostics Logic

Each query gets diagnosed in priority order:

Failure Meaning Suggestion printed
MISS No relevant chunk in top-k at all Shows what was retrieved vs what was expected
LOW MRR First relevant chunk ranked too low Shows exact rank, suggests re-ranking
INCOMPLETE RECALL Some relevant chunks never retrieved Shows exactly which chunk IDs were missed
LOW PRECISION Too many irrelevant chunks in results Shows the noisy chunk IDs
LOW NDCG Relevant chunks not near the top Suggests re-ranking

Usage in your package

from rag_eval import RAGEvaluator

dataset = [
    {
        "question": "What is the significance of Apple's manufacturing...",
        "relevent_chunks": ["pdf_chunk_94", "pdf_chunk_17", "pdf_chunk_107"],
        "retrieved_chunks": ["pdf_chunk_94", "pdf_chunk_91", "pdf_chunk_95"]
    },
    ...
]

report = RAGEvaluator.from_dict_list(dataset, k=5)
RAGEvaluator(k=5).report(report)

You can also access report.per_query and report.failed_queries programmatically if you want to log them to MLflow or W&B Weave.

Release files for rag-eval-lite 0.1.4

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-eval-lite 0.1.4
File Size Uploaded
rag_eval_lite-0.1.4.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rag-eval-lite 0.1.4
File Interpreter ABI Platform
rag_eval_lite-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size:10.0 kB

Release files / rag_eval_lite-0.1.4.tar.gz

Download URL rag_eval_lite-0.1.4.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f3d7399d2895a9654a20e34f1aa82ed24998d9c8660b9d428093a3a76fe3cf44
BLAKE2b-256 checksum
How to use checksums
f8d819d6b9fce647c0173f5aa6ce84a304386a64468f17c3d55a7c6f56af3a5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / rag_eval_lite-0.1.4-py3-none-any.whl

Download URL rag_eval_lite-0.1.4-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
667c3bce77043bbc2a097639009e9393427a738becc265c4e232f5666a3495f3
BLAKE2b-256 checksum
How to use checksums
fdc9ebf3772d31fb61a6bf6bb2ac21ebe22ccc161f1caed341704e7150a8a9db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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