Packs / embeddings-rag-public
local-embeddings-ollama
Embed notes and questions locally with Ollama (nomic-embed-text) and retrieve by cosine similarity; free, private, and checked against the BM25 baseline with recall@k.
Install
logicpacks pack use embeddings-rag-public/local-embeddings-ollamaget_pack embeddings-rag-public/local-embeddings-ollamaThe 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)
- OPENAI_API_KEY
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
ollama-macopenai-embeddings - Checks: 1 in
outcome/checks.yaml - Code:
bm25.pychunk.pyeval_retrieval.py - Tools: python3, ollama
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
Vector retrieval over our notes running fully on the Mac, at least as good as BM25 on our qrels.
Steps
ollama pull nomic-embed-text.- Chunk with chunk-markdown-notes.
python3 code/eval_retrieval.py chunks.jsonl qrels.jsonl --method ollamaand compare with--method bm25.- Hybrid (BM25 + vectors) usually wins on names and codes; keep both when unsure.
Edge cases
- nomic-embed-text wants the search_query:/search_document: prefixes (eval_retrieval.py adds them).
- Re-embed everything when you change the model.
Don'ts
- Don't send private notes to a hosted embedding API.