# 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.

- **Space:** embeddings-rag-public (https://github.com/Tech-Realm/space-embeddings-rag-public/tree/main/local-embeddings-ollama)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** OPENAI_API_KEY
- **Tools:** python3, ollama
- **Routes:** ollama-mac, openai-embeddings; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use embeddings-rag-public/local-embeddings-ollama` or MCP `get_pack embeddings-rag-public/local-embeddings-ollama`
- **Files:** CHANGELOG.md, code/bm25.py, code/chunk.py, code/eval_retrieval.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/corpus/delivery.md, outcome/fixtures/corpus/returns.md, outcome/fixtures/corpus/riders.md, outcome/fixtures/corpus/support.md, outcome/fixtures/qrels.jsonl, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (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.



---

Canonical URL: https://logicpacks.io/packs/embeddings-rag-public/local-embeddings-ollama

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
