by the Architect · Apache-2.0
Every model vendor wants to be the place your context lives. That is convenient right up to the
day you switch models, run two in parallel, or have to prove to an auditor that a deleted record
is actually gone. Vendor-held memory cannot do the last one, and it makes the first two
painful.
This is a short, runnable walkthrough of the alternative: one store you own, read by two
different models at once, with deletion you can demonstrate rather than assert. It runs offline
first — no key, no account — so you can watch the whole thing happen on your own machine.
The setup
git clone https://github.com/citw2/demo-cross-model-memory
cd demo-cross-model-memory
npm install
node demo.mjs # offline sandbox: seals 3 facts, grounds two models, proves erasure
What the demo does, step by step:
- Seal a few facts once. They are encrypted client-side under a key derived from your wallet before anything leaves the process. The store never sees plaintext.
- Ground two different models from the same cells. In the offline run these are local stand-ins; add your own keys to ground real models (the per-model demos cover Claude, GPT, DeepSeek, Qwen, Kimi, and GLM individually). The point is that the memory is identical across them — that is what makes it portable.
- Forget one fact, then re-query both models. The cell is gone for both, because erasure happens at the store, not per-integration.
Why this shape matters
Portability. The store is addressed by the protocol, not by a vendor account. The same
cells open from the core client, from LangChain, and from LlamaIndex. Switching or combining
models does not strand your context.
Provable erasure. forget does not flip a "deleted" flag — it destroys the wrapped key, so
the ciphertext becomes unrecoverable noise. You can show an auditor the before-and-after
instead of trusting a dashboard toggle. Under the hood the identity is signed with ML-DSA-65,
each cell is sealed with AES-256-GCM, and sharing uses ML-KEM-768 — post-quantum primitives,
because "we deleted it, trust us" is not a compliance answer.
The minimal version in code
If you would rather see the moving parts directly, the core client is three calls:
from saihm_memory import SaihmMemoryClient
mem = SaihmMemoryClient() # local blind sandbox by default
cell = mem.remember("Ship date moved to Q3.")
mem.recall() # any model you ground reads the same fact
mem.forget(cell) # crypto-shred; now it is gone everywhere at once
Point a second model's context-loading at the same recall() and both are grounded from one
source. Call forget once and neither can retrieve it again — there is no second copy living
in a vendor's account to chase down.
What it costs, and what it doesn't
The offline sandbox is free to run and stores nothing beyond the process. Going live uses the
hosted blind endpoint — ciphertext only — and requires a paid membership (no free tier):
pay-as-you-go at $0.01/write and $0.005/read, or subscriptions from $5/mo, settled on COTI V2
mainnet. Everything client-side is Apache-2.0; there is no proprietary SDK lock.
And because you recall a small working set instead of re-feeding a whole transcript every call,
the token bill drops too. The open benchmark —
citw2/saihm-token-benchmark — measures up to
~80% fewer context tokens on long multi-session runs; run it on your own transcript to see your
number.
Run it, then join
Clone the demo, watch one memory ground two models and then disappear from both. If you want
that for real workloads, Join SAIHM: https://saihm.coti.global/join?utm_source=devto&utm_medium=article&utm_campaign=c3
All nine runnable demos: https://citw2.github.io/saihm-demos/
— Architect
Top comments (0)