Key takeaways
- At about 100,000 chunks, verified vector search failed on every question. In our context-scale test the vector search errored on 806 of 806 questions, and keyword search on 741 (2 Dec 2026).
- The cause was a per-row safety check run before the sort. It cost about 110 to 170 microseconds a row and ran for every readable row, twice.
- The fix: sort first, then check rows one by one until enough pass. The same rows, in the same order, are served.
- It passed its server test on every line (5 Dec 2026). 0 errored or late searches across three store sizes, 0 differences against the old search in 240 real-embedding queries, and the slowest 5% of vector searches at 3.1 s against a 5 s line.
- It is not fast enough yet, and ranking at that size is poor. 3.1 s is about 7.7 times our 400 ms budget, and the right evidence came back in the top 10 for 0.085 of questions.
The need: only serve what was verified
Our memory checks that each stored passage really came from a verified capture before serving it. In the database, that check is a small function that decides, row by row, whether a passage may be served to this reader. It sits inside the verified version of vector search.
What went wrong at 100,000 chunks
Our context-scale test asks the same 806 questions three ways: with each identity's memory searched alone, with 40 identities sharing one store of about 11,700 chunks, and with one shared store of about 100,000 chunks across hundreds of identity scopes. At the largest size the vector search never answered:
- vector search errored on 806 of 806 questions, and keyword search on 741;
- the right evidence came back in the top 10 for 0.0014 of questions, against 0.5702 when each identity's memory was searched alone.
A laptop bench found why. The verification function cost about 110 to 170 microseconds a row. The search called it for every readable row twice: once to count them and once in the exact scan, before sorting by distance. At 100,000 rows that is far beyond any client's patience. The missing index we first suspected was not the cause.
The fix: check after the sort
The patch keeps the same verification and changes where it runs:
- Sort the readable rows by distance, exactly as before.
- Walk down the sorted list, verifying each row, and stop once enough rows have passed.
- Keep the readable count, computed in one set-wise pass by a helper that applies the same rule.
Because the same rule decides and the order is unchanged, the served rows must be the same. We tested that rather than assumed it.
How we tested it
On the laptop, before the server:
- 0 differences over 807 schema-check calls, 760 query shapes and 2,468 edge cases;
- 13 of 13 deliberately broken versions caught by the checks;
- the slowest 5% of searches over every scope fell from 140,895 ms to 1,679 ms on synthetic vectors.
On the server, with real embeddings (5 Dec 2026; one run, about 6 hours, $0):
- 0 searches errored or ran late at each of three store sizes: 0 of 806 questions at each.
- Every planted fact was still findable: 726 of 726 at each size.
- 0 differences in 240 queries between the patched search and the old one, on real embeddings: the same rows, the same order, the same plans and the same counts.
- The slowest 5% of vector searches at the largest size: 3,090 ms, inside the 5 s line.
- The install check passed: 97 of 97.
The largest store reached 87,071 chunks, not 100,000, because the test server's disk floor stopped its growth. That is above the 50,000 minimum the test requires.
What it did not fix
- Speed against our real budget. 3.1 s is about 7.7 times our 400 ms target, and keyword search at that size is also slow (2.0 s).
- Load. Four searches at once took up to 5.4 s.
- Ranking across many people's memories. At the largest size, the right evidence reached the top 10 for 0.085 of questions, against 0.570 when each identity's memory is searched alone. The search now answers; it does not yet answer well. Mixing many identities in one store is a ranking problem, and it stays on our list.
What we'd suggest
- Put row-level checks after the cheap ordering step whenever the check doesn't change the order.
- Prove "same results" on real data, not only on synthetic vectors.
- Test at the store size you fear, not the one you have. Our live store is small; this would have surfaced much later.
- Report what a speed fix leaves undone, so a passing test isn't read as "done".
Frequently asked questions
Is this live?
Not yet. It passed its tests and is accepted in the Lab. Installing it live is a separate step, after a full gate, on the owner's yes.
Did the fix change what is served?
No. On every comparison the rows, their order and the counts were identical.
Why not use an approximate index instead?
An approximate plan we tried on one large shared store found about half of the right rows on synthetic vectors. We kept the exact plan.
Yukti Memory is Melta's Memory Infra. We publish what we measure, including what fails.