cd /news/ai-agents/i-made-my-ai-agent-s-notes-vault-ret… · home › topics › ai-agents › article
[ARTICLE · art-169279] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

I made my AI agent's notes vault retrievable: 35 MB embedder, llama.cpp reranker, corrections as regression tests

A developer built Haystack, an open-source (MIT) semantic router for markdown note vaults that lets AI agents retrieve notes through hybrid search combining embeddings with corpus-IDF term statistics, RRF fusion, and cross-encoder reranking via llama.cpp, all running locally on a single 35 MB model at roughly 10 ms per query. The system turns user corrections into permanent rules and QA pairs that reindex and rerun as regression tests, exiting with code 1 on any regression, and it pins a learned phrasing only when it outranks the corpus's own best hit. The developer reports Recall@3 of 1.000 across an English vault, a Portuguese vault, and a foreign llama.cpp documentation corpus, and documented ten real failures in a shortcomings catalog.

by read2 min views3 publishedNov 13, 2026

Ok, I made a thing! LLMs have their... quirks. Namely re-reading the same notes, wandering back and forth, and spending 10x more tokens than needed because I can't be explicit.

So I built Haystack — a semantic router for a markdown vault. Instead of the agent digging through files, it queries: hybrid retrieval (embeddings + corpus-IDF term stats, RRF-fused, cross-encoder reranking via llama.cpp), all local, zero cloud, one 35 MB model, ~10 ms per query. MIT, one-command setup: github.com/diogocccarvalho/haystack.

Your corrections become regression tests. Every retrieval miss you fix becomes a permanent rule AND a QA pair. The audit reindexes and runs every pair — it exits 1 on a regression, so the same question can't silently fail twice.

And the learned rules only pin when they actually beat retrieval: a stored phrasing must outrank the corpus' own best hit for the same query. Scale-free, not absolute-threshold — so swapping embedders doesn't break your corrections. I A/B'd models against frozen QA sets and rejected two (a reranker that was 2x faster but -16pp Recall@3; a 97M embedder at -7pp). Numbers in docs/RESEARCH.md.

Corpus Recall@3 MRR
English vault (68 pairs, nickname-style) 1.000 0.917
Portuguese vault (14 pairs, synthetic) 1.000 1.000
Foreign corpus (llama.cpp docs, 33 pairs) 1.000 0.970

The foreign-corpus row matters more than the home-vault row: the chunker generalizes beyond the corpus it was tuned on. Also: llama-server does both the embeddings (bge-small-en GGUF) and the reranking (--reranking flag on ms-marco MiniLM-L12) — one binary, tested with llama.cpp v1.0.0.

The agent that uses Haystack daily also built most of it with me. Every gate in the repo was run by the agent against its own index — that's how the setup-script bugs got caught. And docs/SHORTCOMINGS.md is the failure catalog: ten real failures (a reranker overriding user corrections live; a rebuild that once deleted every correction; an over-context chunk killing a whole batch), each one now a design rule.

./setup.sh --start          # model + config + embeddings server, one command
python3 haystack.py reindex
python3 haystack.py query "that thing about the invoices"

Any OpenAI-compatible endpoint works instead (Ollama, LM Studio, remote API). Python 3.11+, stdlib + numpy only — no framework, no vector DB daemon, no cloud.

The open question I'd genuinely love answers to: this was tuned entirely on my vault. I want to know how the default config holds up on other people's notes. If you run it, tell me what breaks.

── more in #ai-agents 4 stories · sorted by recency
── more on @haystack 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-made-my-ai-agent-s…] indexed:0 read:2min 2026-11-13 · —