Packs / embeddings-rag-public
retrieval-eval-recall
Measure search quality before changing chunking or models: recall@k and MRR on labelled questions, BM25 baseline in pure Python, same harness for Ollama embeddings.
Install
logicpacks pack use embeddings-rag-public/retrieval-eval-recallget_pack embeddings-rag-public/retrieval-eval-recallThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
bm25-stdlibollama-embed - Checks: 2 in
outcome/checks.yaml - Code:
bm25.pychunk.pyeval_retrieval.py - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
recall@k and MRR numbers for a retrieval setup, so changes are kept only when they help.
Steps
- Write 20-50 real questions with the chunk ids that answer them (qrels.jsonl).
- Run the BM25 baseline.
- Run the candidate (embeddings, new chunk size) with the same qrels.
- Keep the change only if recall@k rises.
Edge cases
- Chunk ids change with chunking: regenerate qrels by matching text, not ids, when chunk size changes.
Don'ts
- Don't write questions by copying chunk text word for word.