Skip to main content

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 format
  • src/z3rno_evals/metrics.py — pure-function metric implementations
  • src/z3rno_evals/runner.py — drives the eval against a live server via the z3rno SDK
  • src/z3rno_evals/judges/FaithfulnessJudge ABC + LLM + stub implementations
  • src/z3rno_evals/report.py — JSON + Markdown report renderers
  • src/z3rno_evals/cli.py — argparse entry point (z3rno-evals run, z3rno-evals seed)

License

Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z3rno_evals-0.3.1.tar.gz (231.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z3rno_evals-0.3.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

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

Hashes for z3rno_evals-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a2560d97afe4e68fe5245b7862711597b535cea473cfcfe837a3032f9c5c3c38
MD5 6df8d35abf55c237eab90beec638e781
BLAKE2b-256 6e29a14361c361c4d8dda8b37c26ad0f0b45d73c96c0d68fe059ee0a895ba3cc

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for z3rno_evals-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 022b44f7ec1580a7194036a16e24798a3da7dca55c3ddeec65ca088236a83471
MD5 f09dce68ad2f3f7588933a338d9fdb58
BLAKE2b-256 80f2521d3e8333507a9691e7c15dc19890abf390b3ebc2023ed0a11e1886928e

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page