My knowledge base grew across thousands of markdown files. Finding one fact meant reading whole files. Keyword search found words, not meaning. And reading whole files burns tokens: tens of thousands of tokens to surface one fact. The real metric is not storage. It is tokens per answer.
Why not the usual tools?
- grep finds the file, but you still read it. Cost unchanged.
- A cloud vector DB sends private notes out and adds infra for a 2 MB corpus.
- Semantic-only search cannot do exact filters.
What I built: a local-first retrieval layer.
- SQLite FTS5 index: instant keyword search, exact filters, real file:line references.
- Local ONNX embeddings (384-dim): semantic ranking. Every hit points at a real file.
- One-command rebuild. The index is derived, so it never goes stale.
Result: 2,000 chunks, one CLI, zero servers. An answer now costs a few hundred tokens, not a sweep through thousands of files.
Start deterministic. Add semantic where keywords fail. Rebuild often.
Top comments (0)