ENGINEERING · RAG INFRASTRUCTURE

Two bugs my test suite missed and a real workload found

Two hundred tests passed. Then I pointed VaultKV at my own notes on a real Kubernetes cluster, let it run on a schedule, and watched a dashboard. The same day, two bugs showed up that no test had imagined.

Grafana dashboard for VaultKV showing 180 documents, 2.86K chunks, answers, blocked answers and latency charts.
Figure 1. The real dashboard from the run: content version, documents, chunks, answer latency and pipeline events. The climbing version counter is what exposed bug 1.
23 → 69
content epochs with nothing changed
11.6 min
cold index on CPU
~0.6 s
exact repeat from the answer cache
202
tests after both fixes

Why run a side project like production

VaultKV is a transactional RAG service. It answers questions from a knowledge base using immutable snapshots, checks permissions before any answer leaves, and exports Prometheus metrics to a Grafana dashboard.

The job descriptions I was reading kept asking for the same things: Kubernetes, monitoring, evaluation-gated CI and real users. I had built VaultKV and tested it, but I had never run it the way a team would run a service. So I gave it real infrastructure and a real, boring, repeating workload.

I deployed it with Helm on a local kind cluster (4 vCPUs, 8 GB) and ran the ingest job over my actual notes vault: 180 documents and 2,859 chunks, refreshed every 15 minutes by a CronJob. The first cluster, created while my disk was full, came up with broken networking, so the deployment began by tearing it down and building it again.

Bug 1: an odometer ticking in a parked car

The dashboard showed the content version climbing on every ingest run, from epoch 23 to 69 and 8,577 chunk versions, although nothing had changed. It was an odometer ticking away in a parked car. Re-importing an unchanged file published a new version each time.

That was not cosmetic. Caches in VaultKV are keyed by version, so a new version invalidates them. A version that changes every 15 minutes means a cache that never gets to work. The fix skips documents whose content is unchanged. Verified live, the next run republished 0 documents.

Bug 2: a game with no save points

Cold embedding on CPU runs at about 4.4 chunks per second, so the first full index took 11.6 minutes. Embeddings were only saved when a request finished. Anyone who has played a long game level without save points knows the result: one timeout near the end and all the work so far was gone. Embeddings are now saved every 16-chunk batch, so an interrupted run picks up where it stopped.

Results and limits

After the fixes, warm questions take 5 to 6 seconds and exact repeats about 0.6 seconds from the answer cache. Both fixes shipped with tests, bringing the suite to 202. Access control works in the cluster: an unauthorized user gets no sources.

The honest limitation is the model. Retrieval finds the right documents, but a 1.5B local model often abstains or cites the wrong fact. That needs a bigger model or a larger excerpt budget, not more infrastructure.

Neither bug was exotic. Both were invisible to unit tests because unit tests check the behaviour you thought of. A real workload, repeated on a schedule with a dashboard watching it, checks the behaviour you did not.

Time to an answer (seconds, log scale)

Cold first index, CPU
11.6 min
Warm question
5–6 s
Exact repeat, answer cache
~0.6 s
Figure 2. Cold indexing is slow because embedding runs on CPU. Caching brings repeat questions under a second. The axis is logarithmic.
← All writingDiscuss this →
RELATED WRITING
ENGINEERINGOctober 2026

How do you fit three times the message through a radio that only holds 239 bytes?

A LoRa radio has room for only a few sentences before its packet fills up. I built a tiny, exact compressor for mesh messages, learned where the real gains were, and stopped when the remaining problem became bigger than the product I was trying to ship.

Read →
ENGINEERINGOctober 2026

The trace was flat because every chain node had disappeared

You cannot test a debugger on code that works. I built an agent designed to fail, pointed my own time-travel debugger at it, and found that the debugger was the thing with the bugs.

Read →