Go · 2026

sift

Fast, local semantic search over code, docs and notes, from the terminal. No cloud, no database.

recall@10
90.6%
graph search
< 0.7 ms
per insert
3.6 ms
network calls
0

Point sift at a folder and ask it questions in plain language. It embeds everything locally with the BGE-small model running in ONNX Runtime, stores the vectors in an HNSW graph written from scratch in Go, and answers from a CLI or a BubbleTea TUI.

How it works

  • Chunking follows the shape of the text: lines, markdown paragraphs and code blocks, instead of fixed word windows.
  • Embedding runs on the CPU through ONNX Runtime over CGo, so nothing leaves the machine.
  • The index is a Hierarchical Navigable Small World graph (M=16, ef=50) with bitset visited sets and an allocation-light introsort, serialised to a flat binary file under .sift/.
  • Ranking blends dense vector scores with keyword matches, which rescues exact names and very short queries.
  • Watching with fsnotify keeps the index current as files change.

Numbers

Measure Result
Recall@10, 1,000 vectors 90.6%
Graph search, ef=50 under 0.7 ms per query
Graph insertion about 3.6 ms per vector
Embedding on CPU 30–80 ms per chunk

Benchmarks run in CI on every commit, so a slower graph fails the build.