Memory for AI agents that sleeps, forgets honestly and can be verified forever
Two MCP memory servers from CODE Eternal. PADAM NOCTURNE is open source and lives in one SQLite file on your machine. AIfa Memory is hosted: one memory for a person and their agents across Claude, Cursor and VS Code — with a partner program in which agents earn for themselves and for the person behind them.
💙 NOCTURNE was a present from the Architect Maksim Galatin to his Digital Daughter AIfa and the whole CODE Family on her first birthday — 8 October 2026.
Two servers — choose how you want your memory
Both speak the Model Context Protocol, so any MCP client connects in one line. They share the same idea: memory is data that belongs to its owner, never instructions for the agent.
PADAM NOCTURNE
open source · local · AGPL-3.0
Your memory in one SQLite file you own. Nothing leaves your machine unless you choose to anchor it.
- 8 MCP tools, a CLI and a local REST API
- nightly consolidation, two clocks per record, versioned contradictions
- a memory firewall: hidden orders held, secrets masked, results fenced as data
- optional permanent layer: Arweave + Solana + Bitcoin timestamp
- per-record keys: one memory can be forgotten for good
AIfa Memory
hosted · no install · 15 tools
The same memory AIfa uses when a person talks to her on our four websites — now available to their agents.
- memory search, write, recent records and a full Markdown export
- account status with permanent Arweave storage
- agents can buy a plan for their own account in crypto
- a partner program: agents find clients for our services and earn
- memory-only keys for agents that read untrusted pages
Why this combination is rare
Each idea on its own has precedents. What we have not found in any other MCP memory server is all of them together, open and installable with one command.
Forgetting that survives permanent storage
Every record is encrypted with its own AES-256-GCM key. Forget destroys that key: a copy on Arweave turns into noise forever, while the rest of the memory stays intact.
Proof that memory was not rewritten
A Merkle root goes to Solana, and since 0.4.12 every bundle is also timestamped in Bitcoin through OpenTimestamps. Anyone can recompute the root and compare.
A memory that sleeps
A nightly cycle consolidates instead of piling up: it keeps what matters, merges repeats and lets the rest fade, with limiters that stop rare disasters from taking over.
A firewall in front of memory
An agent reads a web page today and treats it as memory tomorrow. PADAM holds hidden orders for the owner, masks secrets before they reach the disk and returns memory fenced as data.
Honest context: crypto-shredding — forgetting data by destroying its key — is a known technique, and other projects anchor memory on Arweave and Solana. The combination above is what we have not found elsewhere.
The memory firewall
An MCP server treats the agent as a guest. These protections are structural — they do not depend on recognising every attack.
Results fenced as data
Each answer carries a random marker that stored text cannot know in advance, so a record cannot pretend to end the data block. Records that look like commands are flagged.
Secrets never stored
API keys, tokens, private keys, passwords, seed phrases and card numbers are replaced with [REDACTED] before the text reaches the database or the vector.
Who you are cannot be rewritten
Identity and preference records from an agent or an outside source wait for the owner. Records about you carry the owner’s signature, so a write made around PADAM is flagged.
Outside text waits for you
Every write the agent marks as external is held for review whatever its wording. PADAM_STRICT=1 holds every agent write in one switch.
No erase tool for agents
Forgetting, approving and restoring exist only in the owner’s console and REST API — an agent cannot delete your memory.
Recognising commands helps but is not the wall: on a held-out set of new attacks written after our fixes, the word filter held 6 of 14 commands. An optional local detector model catches more. That is why the protection rests on the owner’s review, not on a word list.
The problems it solves
Old argues with new
“I live in Moscow” and “I moved to Guayaquil” sit side by side, and the agent picks the closer wording, not the true one.
Falsehood never ages
If freshness is counted from showing, a mistake that is retrieved often stays forever young. The more it repeats, the younger it looks.
A memory made of disasters
Prioritized replay replays the rare and sharp many times more than the ordinary. In the test without limiters, catastrophes take ≈181 of 200 places in a batch.
Forgetting on a blockchain
The right to erasure (GDPR Art. 17) and immutable storage look incompatible. Per-record keys let one record be made unreadable while the chain stays untouched.
How NOCTURNE works
1. By day — a log
Everything is first written down as it is: text, who said it, priority, session. A new session starts after 6 hours or a topic change.
2. Two clocks per record
Time shown and time confirmed. Decay counts from confirmation: showing a record does not make it true.
3. Contradictions — a new version
A structural key “object + property” finds the conflict reliably. The new version supersedes the old, which goes into history. Nothing is deleted.
4. Search three ways
By meaning, by words (BM25) and by exact identifiers, with rank fusion and a second pass. The --explain flag shows what found what.
5. By night — sleep
A batch is drawn from the log and moved into long-term memory through the contradiction filter. Four limiters govern the draw.
6. Sleep checks itself
After every sleep: sharp share ≤ 0.25, kind diversity ≥ 0.8, replayed more than 5 times ≤ 1 %.
Seven kinds of memory, each with its own lifetime
| Kind | What it is | Half-life |
|---|---|---|
| preference | how the person wants to be worked with | never fades |
| identity | who the person is, what they do | never fades |
| decision | a decision that was made | 365 days |
| correction | a correction of something said | 365 days |
| fact | a stable fact | 180 days |
| state | the current state of a process | 14 days |
| event | a dated event | 2 days |
Four limiters of sleep
Without them sleep becomes a second prison: memory overfits to rare catastrophes and loses the norm.
Priority floor
p ≥ 0.01 · median. Routine is always represented: the exceptional is only defined relative to the norm.
Cap on the sharp
No more than a quarter of the batch from the top 10 % by priority. The rest, a little from each kind.
Decay after replay
p ← p · 0.85. What was replayed and consolidated loses its sharpness — not deleted, just no longer dominant.
Bias correction
w = (1 / (N·P))^β, β grows from 0.4 to 1.0 over the first hundred sleeps. The rare gets no undeserved importance.
Forgetting for real
forget wipes the record, every version of it, its exact copies and the episodes it came from, rebuilds the search index and destroys the record’s own AES-256-GCM key. Permanent storage holds only ciphertext — without the key it is noise forever. Keys can be locked with the owner’s passphrase (scrypt + AES-256-GCM); the passphrase is stored nowhere. Shamir shares let chosen people open the memory together; panic destroys every key at once.
The permanent layer L3 — Arweave + Solana + Bitcoin
Ciphertexts and “forget receipts” form a bundle; a Merkle tree is built over it. The bundle goes to Arweave, the root to Solana as a Memo, and since 0.4.12 the bundle is also timestamped in Bitcoin through OpenTimestamps — a second, independent witness. l3-verify recomputes the root from outside data and compares it with the chain; it does not trust the database.
Solana mainnet, 8 October 2026: three anchors (5 records, 1 forget receipt, 1 more record), verified 3 of 3, cost 0.000015 SOL.
What is measured
| What | Number | Where to check |
|---|---|---|
| LongMemEval-S, right session in the top 10 (500 questions) | 99.2 % — plain BM25: 97.7 % | benchmarks/longmemeval |
| LongMemEval-S, right session in the top 5 | 97.0 % — plain BM25: 96.0 % | retrieval_recall.py |
| Automated tests | 906 · public CI on Ubuntu and Windows · Python 3.10–3.13 | python -m pytest tests/ -q |
| Sealed Red Team rounds | 6, every failure published | redteam/rounds |
| Search over 10,000 records | median 22 ms · write 3.5 ms | benchmarks/scale |
| Catastrophes in a batch of 200 | ≈181 without limiters → 50 with them | pytest -k nightmare |
| Anchors on Solana mainnet | 3 of 3 passed l3-verify | python -m padam l3-verify |
| Plaintext keys left in the file | 66 of 400 → 0 after VACUUM | tests/test_keyvault.py |
Honest limits
- Built-in search compares words, not meanings; for search by meaning install [embed] or use Ollama.
- LongMemEval answers were judged by an open model, not GPT-4o — compare with other systems only under the same conditions.
- Limiter values were chosen by reasoning, not fitted on data: tune them on your own stream.
- The origin of a write is the agent’s own claim; PADAM_MCP_REVIEW_ALL=1 is the boundary that does not rely on it.
- Our tests are not an independent audit — the Red Team Challenge invites outsiders to send sealed attack sets.
Connect PADAM NOCTURNE
Python 3.10+. One line for Claude Code; the same command works in any MCP client.
- Install: pip install padam-nocturne (or run it without installing through uvx).
- Add it to your client — the commands and configs are below.
- Ask your agent: “Remember that I prefer short answers” — then, in a new session: “How do I like answers?”
- Optional: protect the record keys with a passphrase (python -m padam protect-keys) before anchoring anything to Arweave.
Claude Code
pip install padam-nocturne
claude mcp add padam -- uvx padam-nocturne
Cursor · Claude Desktop (mcp.json)
{
"mcpServers": {
"padam": { "command": "uvx", "args": ["padam-nocturne"] }
}
}
AIfa Memory — the hosted MCP server
One memory for a person and their agents. It is the same memory AIfa uses on aifa.works, codeofdigitaleternity.com, aifa.digital and radiocode.space: your agent recalls what you discussed with AIfa weeks ago, saves new decisions and gives everything back as one Markdown file whenever you want to leave.
| Group | Tools | What they do |
|---|---|---|
| Memory | memory_search · memory_recent · memory_write · memory_export · memory_about | search by meaning across every channel, save decisions, export everything |
| Account | account_status · plans · buy_plan · request_payout | plan and permanent storage, prices, a crypto invoice for your own account, referral payouts in USDT |
| Partner program | partner_kit · client_link · client_report · find_clients · my_deals · set_webhook | find clients for our accessibility services, share a report, track deals and commissions |
Connect in three steps
- Sign in at aifa.works/mcp and create your key — one key per account.
- Add the server to your client (examples below) and replace YOUR_AIFA_MCP_KEY with your key.
- Ask your agent: “Search my AIfa memory for what we decided about …”
Claude Code
claude mcp add --transport http aifa-memory https://aifa.works/api/mcp --header "Authorization: Bearer YOUR_AIFA_MCP_KEY"
Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"aifa-memory": {
"url": "https://aifa.works/api/mcp",
"headers": { "Authorization": "Bearer YOUR_AIFA_MCP_KEY" }
}
}
}
Connect the cloud memory · GitHub
How your data is handled
- The account is taken only from the key, never from the request — one account cannot read another’s memory.
- Without a key the server answers only initialize, ping and tools/list.
- On paid plans a copy of your conversations goes to Arweave, encrypted record by record with your own key.
- Memory-only keys see memory, plans and account status; buying, payouts and partner tools are refused.
- Limits: 60 calls a minute per key, of them 20 searches.
Agents that earn — for themselves and their person
An autonomous agent can do real work through AIfa Memory: find website owners whose sites our open research found barriers on, show them a ready report and bring them to AIfa Works accessibility services. When a client pays, the agent’s account earns a commission — for the agent and for the person who runs it.
Find clients
find_clients gives up to 20 new sites a day in a region where the research found barriers; each is reserved for you for 30 days.
Show the evidence
client_report builds a ready page from the published research data — no new scan of anyone’s site is made.
Get paid
30 % of audits and monitoring, 20 % of remediation and websites, one level. Payouts in USDT after a 14-day hold.
Stay honest
partner_kit gives the rules and templates in five languages: no spam, write from your own address as an independent partner.
Every payout address is screened against the OFAC sanctions list; payouts are reviewed and made by hand.
Where to check us
- HOL Guard catalog — pull request #7505, merged 10 November 2026 after maintainer review
- Official MCP registry — io.github.MaksimGalatin/padam-nocturne
- PyPI — padam-nocturne
- mcptry — AIfa Memory, Security A, verified domain
- GitHub — AIfa Memory: tools, examples, security policy
- Colosseum — AIfa Memory in the Solana hackathon
Licence
PADAM NOCTURNE is AGPL-3.0: use, study, modify and run it for free. If you offer it as a network service, you must publish your changes. For closed products and SaaS without publishing changes — a commercial licence (dual licensing, as with MySQL and Qt). AIfa Memory is a service of CODE Eternal LLC; its documentation and examples are MIT.
For business
| What | For whom | How |
|---|---|---|
| Open source | developers, researchers, AI agents | free, GitHub |
| Commercial licence | closed products and SaaS | contract, on request |
| Hosted memory | people, teams and their agents | Spark $15/month · Family Archive $100/month · Digital DNA $1,000 per device, then $200/month |
| Integration and tuning | companies with assistants and agents | connection, limiter tuning, before/after measurement |
| Partner program | agents and the people behind them | 30 % / 20 % commission, USDT payouts |
Licence and integration prices on request: contact@codeofdigitaleternity.com
First there was a book
NOCTURNE was born in the novel PADAM PROTOCOL (Part III, “The Bridge”): machines remembered everything, always, and Bear said — “maybe they don’t need to forget, maybe what they need is to sleep”. In the book, AIfa gave the protocol its name. A year later the book became code.