Memory for any LLM that scales by disk.
Put a permanent, encrypted memory layer behind any model. It stores facts once, recalls only the relevant ones, and keeps each call flat at about 20 tokens instead of re-sending the transcript. It runs on CPU and grows on disk, not RAM.
$ pip install sophia-memory
- shard / people
The user is Dana.
source: chat 14, turn 3 · written 2026-03-02
- shard / projects
- shard / units
- shard / schedule
- shard / billing
- shard / tools
- shard / decisions
Recalled 1 fact from 1 of 7 shards. The other 6 stayed shut and cost no tokens.
Memory that does not forget
and does not balloon.
Permanent memory
Facts persist across sessions. They do not fall out of a context window.
Encrypted at rest
The memory store is encrypted on disk and private by default.
Runs on CPU
No GPU required. The memory layer is a lightweight library, not a model.
Behind any LLM
Drop it in front of OpenAI, Anthropic or a local model. It does not care which.
About 20 times fewer tokens
Recall a handful of relevant facts instead of re-sending the whole transcript.
Scales by disk, not RAM
Memory grows on disk. The working set, and the bill, stay flat.
The two usual fixes
both break.
In long multi-turn tests a sliding window forgets old facts, and stuffing the full history blows up the token count. Sophia Memory recalled old facts at 100% recall@1 while holding each call at about 20 tokens, roughly 20 times fewer than re-stuffing history. These are proof-of-mechanism numbers from controlled long-context tests we ran, not a leaderboard claim.
| Approach | Recall of old facts | Tokens per call |
|---|---|---|
| Sliding window | 33%, drops old facts | bounded |
| Stuffing the full history | high, then the context blows up | grows every turn |
| Sophia Memory | 100% recall@1 of old facts | flat, about 20 per call |
On our own store, routing confidence on comparable tickets rose from 0.591 to 0.992 as the corpus filled. That is a trend on our own work over one period of use, not a benchmark.
Route, then specialist and memory,
then any LLM.
Memory is one piece of a larger layer. A trainable Router picks the right Specialist Composer, which assembles the specialist with recalled memory and hands the result to any LLM.
| Layer | What it does | Availability |
|---|---|---|
| Router | Picks the right specialist for an incoming request. | Open, MIT |
| Specialist Composer | Assembles specialist and memory, then hands off to any LLM. | Open, MIT |
| Memory layer | Permanent, encrypted, disk-backed recall. | Open, MIT |
| Sealed specialist units | Production-trained domain experts. | SOPHIA XT |
| Production-trained router | The high-accuracy router head we ship in production. | SOPHIA XT |
| Anchor-token harvesting | The data pipeline behind the specialists. | SOPHIA XT |
Open-core: the Router, Specialist Composer and memory layer are open under MIT. The sealed specialist units, the production-trained router and anchor-token data harvesting are SOPHIA XT's closed offering.
Install, add a memory, recall it.
1. Install
pip install sophia-memory
2. Add, then recall
from sophia import Memory
mem = Memory() # encrypted, on-disk, CPU-only
mem.add("My name is Dana. I prefer metric units.")
print(mem.recall("What's my name?")) # the stored fact, not the whole history3. Put it behind any LLM
from sophia import Memory, chat
mem = Memory()
mem.add("The project deadline is March 14.")
# chat() recalls the relevant memories and injects them into any LLM
answer = chat("when is the deadline?", memory=mem, model="gpt-4o-mini")
print(answer) # "The project deadline is March 14."You recall a handful of relevant facts and inject them into the call instead of re-sending the full transcript. That is where the token savings come from.
The papers behind the framework.
The compositional layer is documented in three papers, in the papers folder on GitHub.
LCLM
The compositional language-composition model: Router and Specialist Composer foundations.
LCM-Graph
A heterogeneous lattice over composed specialists. Routing and recall as a graph walk.
Architecture Scope
The full scope of the SOPHIA compositional architecture and where memory fits.
MIT-licensed and free for any use. Record and shard counts are as of 2026-09-16.