Skip to content

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-ollama
get_pack embeddings-rag-public/local-embeddings-ollama

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)

  • 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

  1. ollama pull nomic-embed-text.
  2. Chunk with chunk-markdown-notes.
  3. python3 code/eval_retrieval.py chunks.jsonl qrels.jsonl --method ollama and compare with --method bm25.
  4. 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.