Skip to content

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.

L2 Checks passed 3 of 3 runsv0.1.0Tech-Realm/space-embeddings-rag-public

Install

logicpacks pack use embeddings-rag-public/retrieval-eval-recall
get_pack embeddings-rag-public/retrieval-eval-recall

The 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

  1. Write 20-50 real questions with the chunk ids that answer them (qrels.jsonl).
  2. Run the BM25 baseline.
  3. Run the candidate (embeddings, new chunk size) with the same qrels.
  4. 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.