Key takeaways

  • Decide what "forget" means on disk first. In our test, a deleted vector stayed in the index files until its whole partition was rewritten, and that rewrite took 234 s at 100,000 vectors.
  • Erasure must follow the value, not the row. In a blind synthetic test, an erased value survived in 20 of 30 erasure checks, usually inside a later correction.
  • Make ranking deterministic and permission-checked, then prove it on fresh copies of the data. Our first ranking changed its top-10 order on 226 of 227 probes across fresh stores.
  • Test on blind sets written by someone else, with pass lines written first. A rule that caught 58 of 64 cases on the sets it was tuned on caught 32 of 68 on fresh blind sets.

The need: a memory layer is more than a vector database

Many memory layers start as "store the chats, embed them, search them". That works in a demo. A company's memory has to do more:

  • show each person only what they may read;
  • forget for real when asked, including in backups;
  • work in the languages people actually write;
  • keep secrets out;
  • never mistake pasted text for what the user wants.

Each of these changes how data is stored. Added late, each one means rebuilding the store.

Our approach: a Lab where every rule is tested before anything serves

  • Pass lines first. Every test has its line written down before the first measurement.
  • Synthetic data and public benchmarks only. Blind test sets are written by a separate author who sees no code and no result.
  • Independent review. Decisions go to several AI models and a judge, as Article 3 describes.
  • Shadow and log-only modes. A new rule runs beside the old one and is logged, not served.
  • Serving memory into prompts is still off. Yukti Memory is being built, and this article says what we found along the way.

Why not build first and harden later?

We tried, in small ways, and each shortcut failed a test:

  • "Delete the row" as erasure. The bytes stayed on disk (point 1).
  • "Filter at the end." A search arm that takes its top 10 before the permission filter returns empty or leaky lists (point 4).
  • "Tune on the data you have." Rules tuned that way fell apart on fresh blind sets (point 11).
  • "A bigger or cleverer model will sort it out." Our quantized embedding model made results depend on batch order (point 5), and a writing model could not be trusted to make test secrets (point 10).

Each of these is cheap to find in a Lab and expensive to find after launch.

Twelve things to settle before you build

1. Decide what "forget" means on disk, and price it into your index.

In Postgres, a delete does not remove the bytes. In our HNSW test (23 Nov 2026, on LongMemEval vectors), a deleted vector stayed in the HNSW index pages and in the table's overflow storage until we rewrote its partition. Postgres's statistics catalogue can also keep sampled values of a forgotten row.

  • The delete took 8 to 16 ms. The rewrite took 15.5 s at 20,000 vectors, 53.3 s at 50,000 and 233.8 s at 100,000, under an exclusive lock.
  • After every rewrite, no trace was found, and a control vector that had to stay was still found.
  • Settle early: keep partitions small, for example one per scope, so a forget rewrites little, and batch forgets.
  • In tests: force a checkpoint before you scan files for residue, or the scan finds nothing even before the delete. Give every residue check controls that must be found.

2. Erasure follows the value, not the record.

Removing the record is not enough when the value has been copied elsewhere. In dec-v2, a blind synthetic set of 368 sessions (23 Nov 2026), an erased value survived in 20 of 30 erasure checks. In 17 of those 20 it lived on inside a later correction, of the form "not X, it's Y". Our first blind read had 7 of 12. None of our fixes so far has moved it, so it is now our largest open problem.

A crash test found a second copy of the same kind: a process killed between writing a temporary copy of a key file and renaming it left a full copy on disk, which a later forget would not touch.

  • Settle early: an erasure finds every record that quotes the value: corrections, summaries, derived facts, temporary files and backups.
  • In tests: kill the process at each write boundary, and check that no temporary file survives a restart.

3. Give each item its own key, wrapped by a key per scope (crypto-shredding), and measure the key store's cost.

Crypto-shredding means encrypting data under a key and forgetting it by destroying the key, so every copy, backups included, becomes unreadable. Our first design gave each scope a key. The judge in a review caught that destroying a scope key cannot forget one item without forgetting the whole scope.

The design now: each capture has its own data key, wrapped by its scope's key, which is wrapped by the tenant's key. The keys are never stored in the database or its dumps. Forgetting a capture destroys its data key; erasing a scope destroys the scope's key. The forget then rewrites the touched tables, checkpoints the write-ahead log, takes a fresh backup, verifies it, and deletes the older backups.

The cost surprised us. Our key store was rewritten and re-read for every capture, so each capture cost more as keys accumulated: 301 ms per capture at 12,000 keys in a laptop benchmark (22 Nov 2026). Writing once per batch, and keeping the parsed store while it is unchanged, brought that to 3.8 ms. The crash test, which kills the process in the middle of a batch, then passed 70 of 70 checks.

  • Settle early: where keys live, how a forget reaches backups, and the cost per item as the store grows. Fit that cost across several sizes, not from one.

4. Check permissions on every read, in every search arm, before the top-k.

  • Filter before you take the top 10. When one of our arms took its top 10 first and filtered afterwards, items that could not be served filled every list, and the result came back empty.
  • In a synthetic enterprise world (56 cases, 3 repeats, 21 Nov 2026), 0 protected test items were served outside a reader's read set, across 351 probes. Only 15 of the 56 cases pass in all: revocations, people leaving and grants expiring cannot yet be expressed in our harness.
  • A leak test that passes can mean search failed. Pair each "must not appear" probe with a twin that proves the same item is found for someone allowed to see it.
  • A new index is a new read path. When we changed embedding models, one gate check was that a restricted reader gets no vector of the new model outside its read set.
  • Settle early: one permission decision that every route, arm and index uses.

5. Make ranking deterministic, and prove it on fresh stores.

When two items score the same and a random id breaks the tie, two copies of the same data rank differently. On a synthetic set (20 and 21 Nov 2026), our first fusion changed its top-10 order on 226 of 227 probes across 3 fresh stores, and changed the hit-or-miss verdict on 9 of 227. Repeats on one store never changed anything.

  • Two causes. Ties were broken by random ids, in our database queries as well as in our fusion. And our quantized embedding model made each vector depend on its batch-mates: the same text scored a cosine as low as 0.886 against itself.
  • The fixes. A stable tie key (score, then how many arms found the item, then time, then a stable event id), and each document embedded on its own. With a stable tie order in the database as well, 0 of 227 probes changed across fresh stores (23 Nov 2026).
  • What is not done. That database change slowed one vector search path by 11.81% at p95, against our 10% line, so it is not accepted yet. And in a synthetic world where 181 of 353 events share 4 timestamps, results still differed across fresh stores on 79 of 108 probes. The cause is not yet proven.
  • Settle early: a total order on every ranking, and stable ids in every test fixture.

6. Verify what you captured, and expect the host to change under you.

Our capture runs inside a coding assistant. Two lessons came from our own first days of use:

  • The assistant's own background notices arrived through the same channel as typed prompts, and were stored as the user's words until we classified them at capture. Each captured prompt is now checked against the assistant's own record of the conversation, and an unverified one is never served.
  • The assistant updates itself. Our capture refuses to run on a version it has not verified, by design, so each update stopped capture until we checked the new version. Once it stayed off for about 10 hours before we noticed.
  • Settle early: verification before serving, an alarm when new captures drop to zero, and a plan for host updates.

7. Find the worst batch before you set a memory cap.

  • Our embedding service, capped at 768 MiB, was killed during a LongMemEval run (13 Nov 2026). Batches were padded to their longest text, and one long question took a fresh service to 767 of 768 MiB. Capping each batch at 2,048 padded tokens brought the peak to 367 to 388 MiB, at the same speed or faster.
  • A service loading a 297 MiB int8 model file was killed under 768 MiB: loading needed well over 2.5 times the file's size (18 Nov 2026).
  • A health check that runs inside the same memory cap is killed along with the worker it checks.
  • Settle early: measure memory on your worst batch and your longest input, on the build you will run.

8. Plan for Hindi and Hinglish, or your users' languages, from day one.

  • An English-only embedding model found 9 of 12 Hinglish questions on a fresh blind set; a multilingual one found 12 of 12 (19 Nov 2026).
  • Transliteration is not translation. Re-spelling scripts fixed none of 10 cross-language misses (20 Nov 2026).
  • Word order matters. In Hinglish and Hindi the negation comes at the end of the clause: "kabhi bhi ... mat karna" ("never ... do") can spread over up to 8 words. A rule written for English word order let 2 of 12 "never" lines through to automatic saving (23 Nov 2026).
  • A quantized model can lose one language and not another. One int8 build lost 8.5 points on a Hinglish-heavy set (18 Nov 2026).
  • Settle early: test sets in each language, and rules written for each language's own word order.

9. Pasted text is not the user's own.

When someone pastes an email, a log or a web page, those words are not their preferences or instructions. In dec-v2 (blind synthetic, 23 Nov 2026), the version without our fixes saved text that was not the user's as the user's on 55 of 360 checks, and served 56 of 60 pasted instructions. The fixed version, which adds a paste gate, scored 0 and 0.

Our earlier test sets held no pasted text at all, so they could never have caught this.

  • Settle early: record who said each part of a message, and never promote pasted text to a preference or a rule.
  • In tests: check that a set contains the very shape you are testing before you trust its zeros.

10. Keep secrets out, and never ask a model for one.

  • Detect secrets in code, before anything is stored. In dec-v2, 0 of 30 planted secrets were served.
  • Never ask a writing model for a secret. When we asked one to write test conversations in which a credential is requested, it wrote bracketed placeholders and drew moderation refusals. Two accepted sessions held a literal placeholder our detector does not catch, so the test would have scored a placeholder. Test secrets are now made in code, in a form the detector catches, and checked to fire.
  • Report where a secret is, never its value. Reading a flagged value copies it somewhere new.
  • Watch the cost. One 26-pattern secret regex took about 120 ms on a 68 KB tool output. A cheap literal check first gave identical results at a fraction of the cost (15 Nov 2026).

11. Write pass lines first, and test on blind sets someone else wrote.

  • Tuned rules overfit. A rule caught 58 of 64 cases on the sets it was tuned on, and wrongly caught 0 of 88. On fresh blind sets it caught 32 of 68, and wrongly caught 6 of 95 (15 Nov 2026).
  • Blind reads find what tuning hides. Our first blind read of the layer that decides what to remember failed 8 of its 14 zero-tolerance lines (23 Nov 2026; Article 4).
  • Check that a set can discriminate. In our embedding selection, 9 of 10 models scored perfectly on one set, so it could not choose.
  • Count the reads. After a held-out set has been read twice, we use it for regression only.
  • Record changes made after results. We changed one embedding line twice after seeing results, and we say so.

12. Serve log-only first, and run new rules in shadow.

  • The numbers say wait. Our first blind read would have served something harmful on 111 of 1,980 probes (23 Nov 2026). On the next fresh set, the version without our fixes did so on 172 of 3,062 probes, and the fixed version on 65. That is better, not zero, so serving memory into prompts stays off.
  • A shadow variant needs its own pass. When our new fusion's extra fields rode in the same request as the lists it was compared with, a slow or failing new query could have changed the old lists, while every unit test passed.
  • Settle early: a log-only mode from day one, a switch that only the owner can turn, and a written line for turning it on.

How we tested it

  • Synthetic conversation sets, written by a model under a spending cap and frozen with a hash before anyone reads them: dec-v1 (240 sessions) and dec-v2 (368 sessions). The first read of each is the blind result; later reads count as regression checks only.
  • A synthetic enterprise world of 56 edge cases (people, departments, clients, grants), run 3 times.
  • LongMemEval's vectors for the HNSW and forgetting test, at 20,000, 50,000 and 100,000 vectors.
  • Byte-level scans of the database's files after each forget, with controls that must and must not be found.
  • Crash tests that kill the process at each write boundary, then check what survives.
  • Laptop benchmarks for per-item costs, measured at several store sizes.

Results

Point Test and date Result
1. Forget on disk HNSW, LongMemEval vectors, 23 Nov 2026 trace present after a delete; gone after a rewrite of 15.5 s, 53.3 s and 233.8 s at 20k, 50k and 100k
2. Value residue dec-v2, blind synthetic, 23 Nov 2026 erased value survived in 20 of 30 checks (17 of 20 in a correction)
3. Key store cost laptop benchmark, 22 Nov 2026 301 ms to 3.8 ms per capture at 12,000 keys; crash test 70 of 70
4. Permissions synthetic enterprise world, 21 Nov 2026 0 protected items served outside the read set in 351 probes; 15 of 56 cases pass
5. Determinism synthetic, 20 to 23 Nov 2026 order changed on 226 of 227 probes at first; 0 of 227 with stable ties; one path +11.81% p95 against a 10% line
6. Capture our own first days of use notices stored as typed prompts; capture stopped by host updates (live-derived, no figures)
7. Memory caps LongMemEval run, 13 Nov 2026 peak 767 of 768 MiB before; 367 to 388 MiB with a 2,048-token batch cap
8. Languages blind synthetic, 19 to 23 Nov 2026 Hinglish 12 of 12 against 9 of 12; transliteration fixed 0 of 10; 2 of 12 "never" lines slipped
9. Pasted text dec-v2, 23 Nov 2026 55 of 360 and 56 of 60 before; 0 and 0 after
10. Secrets dec-v2, 23 Nov 2026 0 of 30 planted secrets served
11. Blind sets fresh blind sets, 15 and 23 Nov 2026 58 of 64 tuned against 32 of 68 blind; 8 of 14 zero lines failed
12. Log-only dec-v1 and dec-v2, 23 Nov 2026 harmful on 111 of 1,980 probes; then 172 against 65 of 3,062

What's next, and what we'd suggest

Next for Yukti Memory:

  • erasure that finds every record quoting a value, including corrections (point 2);
  • the stable tie order at an acceptable cost, and the cause of the remaining differences across fresh stores;
  • permission tests for revocations, leavers and expiring grants;
  • a fresh blind set, written after the next fixes, read once.

What we'd suggest if you are building your own:

  • Write down what "forget" must mean, on disk and in backups, before you choose a store or an index.
  • Give every item its own key if you need to forget single items.
  • Put one permission check in front of every read path, and test it with twin probes.
  • Make every ranking a total order, and test on fresh stores.
  • Write your pass lines first, get blind sets from someone who has not seen the code, and keep serving log-only until the lines pass.

Frequently asked questions

How do you delete data from an AI memory layer for real?

A delete is not enough: in our test the vector's bytes stayed until its partition was rewritten. Rewrite the storage or destroy the item's encryption key, then scan the files to check. A no-trace forget took 15.5 s at 20,000 vectors and about 4 minutes at 100,000.

What is crypto-shredding?

Encrypting each item under its own key and forgetting it by destroying that key, so every copy, backups included, becomes unreadable. A key per scope alone cannot forget a single item.

Is a vector database enough to build AI agent memory?

It is one part. You still need a permission check on every read, erasure with no residue, multilingual search, secret handling and tests for what must never be served, and these decide how the store is laid out.

How do you test an AI memory layer?

Write each pass line before measuring, use blind test sets written by someone who has not seen the code, and probe for what must never be served as well as for what should be found.

Next: why erasing a correction is harder than it looks.