Eval framework for Z3rno — recall@k, MRR, faithfulness, latency on golden datasets.
Project description
z3rno-evals
Eval framework for Z3rno. Measures the four metrics that gate every Phase E release:
- recall@k — fraction of golden questions where an expected Memo is in the top-k results
- MRR — mean reciprocal rank of the first correct Memo
- faithfulness — LLM-judge score: does the recalled context support the expected answer?
- latency — p50 / p95 / p99 of
recall()calls against a live z3rno-server
A golden dataset is a JSON file of Q&A items with expected memory IDs, expected entities, and latency budgets. The CLI runs the dataset against a live server and emits both a results.json (machine-readable) and a report.md (PR-comment-ready).
Install
pip install z3rno-evals
# Optional — for the LLM-driven faithfulness judge
pip install 'z3rno-evals[llm-judge]'
Quickstart
# 1. Boot a local z3rno-server (see z3rno-server/Makefile)
make -C ../z3rno-server dev-up
# 2. Seed the memories the golden dataset expects
python -m z3rno_evals.seed --against http://localhost:8000 --api-key sk-... \
--dataset datasets/golden_v1.json
# 3. Run the evals
z3rno-evals run \
--against http://localhost:8000 \
--api-key sk-... \
--dataset datasets/golden_v1.json \
--output results/
# 4. Look at the report
cat results/report.md
Metrics Table
| Metric | Default Target | Phase E Bar |
|---|---|---|
recall@5 (GRAPH strategy) |
— | ≥ 0.80 on golden v1 |
mrr |
— | ≥ 0.65 |
faithfulness (LLM-judge) |
— | ≥ 0.90 |
p95_latency_ms |
— | ≤ 500 |
| Regression gate | — | block PR if any metric drops > 5% |
Golden Dataset Format
{
"version": 1,
"name": "golden_v1",
"items": [
{
"id": "q-001",
"agent_id": "agent-1",
"query": "What does the user prefer for notifications?",
"expected_memory_ids": ["01HXY1...", "01HXY2..."],
"expected_entities": ["dark mode", "weekly digest"],
"expected_answer": "The user prefers dark mode and weekly digest emails.",
"strategy": "AUTO",
"top_k": 5,
"latency_budget_ms": 500
}
]
}
See datasets/golden_v1.json for the full sample.
Architecture
src/z3rno_evals/dataset.py— Pydantic models + loader for the golden dataset formatsrc/z3rno_evals/metrics.py— pure-function metric implementationssrc/z3rno_evals/runner.py— drives the eval against a live server via thez3rnoSDKsrc/z3rno_evals/judges/—FaithfulnessJudgeABC + LLM + stub implementationssrc/z3rno_evals/report.py— JSON + Markdown report rendererssrc/z3rno_evals/cli.py— argparse entry point (z3rno-evals run,z3rno-evals seed)
License
Apache 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file z3rno_evals-0.3.1.tar.gz.
File metadata
- Download URL: z3rno_evals-0.3.1.tar.gz
- Upload date:
- Size: 231.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2560d97afe4e68fe5245b7862711597b535cea473cfcfe837a3032f9c5c3c38
|
|
| MD5 |
6df8d35abf55c237eab90beec638e781
|
|
| BLAKE2b-256 |
6e29a14361c361c4d8dda8b37c26ad0f0b45d73c96c0d68fe059ee0a895ba3cc
|
Provenance
The following attestation bundles were made for z3rno_evals-0.3.1.tar.gz:
Publisher:
release.yml on the-ai-project-co/z3rno-evals
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
z3rno_evals-0.3.1.tar.gz -
Subject digest:
a2560d97afe4e68fe5245b7862711597b535cea473cfcfe837a3032f9c5c3c38 - Sigstore transparency entry: 1516872375
- Sigstore integration time:
-
Permalink:
the-ai-project-co/z3rno-evals@562797e3db7169ba146e25a76caca6991fb6f1e1 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/the-ai-project-co
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@562797e3db7169ba146e25a76caca6991fb6f1e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file z3rno_evals-0.3.1-py3-none-any.whl.
File metadata
- Download URL: z3rno_evals-0.3.1-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
022b44f7ec1580a7194036a16e24798a3da7dca55c3ddeec65ca088236a83471
|
|
| MD5 |
f09dce68ad2f3f7588933a338d9fdb58
|
|
| BLAKE2b-256 |
80f2521d3e8333507a9691e7c15dc19890abf390b3ebc2023ed0a11e1886928e
|
Provenance
The following attestation bundles were made for z3rno_evals-0.3.1-py3-none-any.whl:
Publisher:
release.yml on the-ai-project-co/z3rno-evals
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
z3rno_evals-0.3.1-py3-none-any.whl -
Subject digest:
022b44f7ec1580a7194036a16e24798a3da7dca55c3ddeec65ca088236a83471 - Sigstore transparency entry: 1516872558
- Sigstore integration time:
-
Permalink:
the-ai-project-co/z3rno-evals@562797e3db7169ba146e25a76caca6991fb6f1e1 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/the-ai-project-co
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@562797e3db7169ba146e25a76caca6991fb6f1e1 -
Trigger Event:
push
-
Statement type: