klieo-eval
Recall-quality metrics for klieo memory pipelines.
Status: stable at 3.x
What
Pure scoring — no I/O, no async, no memory-trait dependency. Hand the
crate a slice of RecallSample { query, expected, returned_ids } and
get back a RecallReport with:
hit_rate— fraction of queries with any expected id in top-Kmean_reciprocal_rank— mean of1 / rank-of-first-hitmean_precision_at_k—|expected ∩ top-K| / K, averagedmean_recall_at_k—|expected ∩ top-K| / |expected|, averagedmean_ndcg_at_k— normalised discounted cumulative gain, binary relevance
The harness lets the caller run recall against any memory pipeline — Qdrant, sqlite-vec, hybrid GraphRAG — then scores the produced ranking.
Why
The same fixture-driven quality gate previously hard-coded inside the
klieo-compliance regulation-recall integration test is reusable across
every klieo memory pipeline. Centralised, deduped, JSON-serialisable
for CI artefacts.
Example
use ;
let samples = vec!;
let report = score_recall;
assert!;
assert!;
License
MIT.