trustrag-eval
RAGAS-based evaluation pipeline with trust-specific metrics for TrustRAG.
Getting Started
# Install in development mode
pip install -e packages/trustrag-eval
# Run tests
cd packages/trustrag-eval && pytest tests/ -v
Metrics Explained
RAGAS Metrics (industry-standard)
| Metric | What it measures |
|---|---|
| Faithfulness | Does the answer stay within retrieved context? |
| Answer Relevancy | Does the answer address the question? |
| Context Precision | How relevant are the retrieved chunks? |
| Context Recall | Did we retrieve the chunks needed for ground truth? |
Trust-Specific Metrics (TrustRAG)
| Metric | What it measures |
|---|---|
| Trust Score Distribution (p25/p50/p75/mean) | Overall trust score health across queries |
| Flagged Rate | Percentage of queries with trust_score < 50 |
| Hit@5 | Was the ground-truth chunk in the top-5 retrieved? |
| Hit@5 by Category | Hit rate broken down by query type (semantic/keyword/hybrid) |
Usage
from trustrag_eval import load_synthetic_queries, compute_trust_metrics
# Load benchmark dataset
queries = load_synthetic_queries("eval/synthetic_queries.json")
# Compute trust distribution from results
results = [{"trust_score": 85}, {"trust_score": 72}, ...]
dist = compute_trust_metrics(results)
print(f"Median trust: {dist['p50']}, Flagged: {dist['flagged_pct']:.0%}")
Metadata
Release files for trustrag-eval 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trustrag_eval-0.1.0.tar.gz | 6.1 kB | Without provenance | Details for trustrag_eval-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trustrag_eval-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for trustrag_eval-0.1.0-py3-none-any.whl |
Total release size: 11.5 kB
Release files / trustrag_eval-0.1.0.tar.gz
| Download URL | trustrag_eval-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bfe9cb080e8f299048568dcc8cb949806919496f6f91c39c787a873f4a022df
|
|
BLAKE2b-256 checksum How to use checksums |
ba8cce6f9543070ffd926dbbe58f030229d178eab1f3147416a5b01458868fc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / trustrag_eval-0.1.0-py3-none-any.whl
| Download URL | trustrag_eval-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba0049877ba3a7f065eb5eb420c3fca457317ee23bd9ad17364e12734a261719
|
|
BLAKE2b-256 checksum How to use checksums |
abbc0d565967d383d5d4862216857e7b5d7c5ce99c57ff5f112d7bd3ffbd9d37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for trustrag-eval 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.