A memory layer your agent already speaks.

SAIHM is sovereign, encrypted, persistent memory for AI agents — drop-in over the Model Context Protocol. One store you own grounds every model and every framework, with erasure you can prove. Pay-as-you-go per call, or a flat monthly subscription — current rates on pricing.

Run a demo Join SAIHM

Try it in a minute — offline, no account

Every demo runs offline against an included blind sandbox — no key, no account — or grounds a live answer with your own model key. The memory is identical across all of them; that is the point.

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

Prefer your editor? demo-claude-code runs SAIHM as an MCP server for Claude Code, Cursor, and any MCP host. All fourteen demos live at citw2.github.io/saihm-demos.

Why adopt SAIHM

Deciding whether you need a memory layer at all? The decision matrix walks seven questions and names the simpler answer where one exists.

  • One protocol, every agent. If your agent already speaks MCP, integrating SAIHM is a config change, not a rewrite.
  • Measured token savings. Recalling a small working set instead of re-sending the whole history cuts context tokens ~85% on long multi-session runs (measured 62.8%–85.9%) — reproduce the numbers yourself with the open token benchmark.
  • Memory layer, not a model. SAIHM does not compete with your agent. It complements any of them — commercial, open-source, or your own.
  • Cryptographic right-to-erasure. forget destroys the wrapped key; the ciphertext becomes unrecoverable noise. Compliance teams ask for this, and you get it by adopting SAIHM.
  • Stable billing surface. USDC.e on COTI V2 (no premium), direct or gasless via signed authorization. Predictable to forecast against.
  • Open license (Apache 2.0). No proprietary client SDK lock-in. No surprise re-license.
  • Public-protocol commitments. Build artifacts are committed on a public, dated ledger, so independent verification of what is running is always possible.

Runnable demos — one per model, plus cross-model and frameworks

Each is a single small repo. Clone, npm install, run — offline by default, or live with your own key.

DemoWhat it shows
demo-claudeGround Claude (Anthropic) in a memory you own.
demo-openaiA memory layer GPT can read — keys held by you, not your OpenAI account.
demo-deepseekSeal facts client-side, ground DeepSeek, then prove you can erase one.
demo-qwenGive Qwen a memory that is not locked to one vendor account.
demo-kimiWire Moonshot Kimi to a portable, provably erasable store.
demo-glmGround Zhipu GLM in one memory, then carry it to any model.
demo-cross-model-memoryTwo models grounded from the same store at once — then provable erasure across both.
demo-claude-codeSAIHM as an MCP server for Claude Code, Cursor, and any MCP host.
saihm-langchainLangChain and LlamaIndex adapters for Python (below).
saihm-crewaiRoute a CrewAI crew's memory through a SAIHM StorageBackend you own (below).
saihm-autogenAn autogen_core.memory.Memory for AutoGen agents, backed by SAIHM (below).
saihm-langgraphA LangGraph BaseStore for long-term, cross-thread memory (below).
saihm-ragA LlamaIndex BaseRetriever for RAG over a knowledge base you own (below).
saihm-erasure-receiptA runnable proof of cryptographic erasure (GDPR Art. 17): seal a record, destroy its key, emit a verifiable receipt.

Drop into your framework (Python)

SAIHM ships drop-in adapters for LangChain (BaseChatMessageHistory), LlamaIndex (BaseMemory chat and BaseRetriever for RAG), CrewAI (StorageBackend), AutoGen (autogen_core.memory.Memory), and LangGraph (BaseStore, long-term memory). The same store opens from all of them — and from the core client — sealed client-side by a small bundled Node sidecar, so Python never holds a key. One forget removes a memory from every consumer at once. Sources: saihm-langchain, saihm-crewai, saihm-autogen, saihm-langgraph, saihm-rag.

LangChain — drop-in for RunnableWithMessageHistory

from saihm_memory import SaihmChatMessageHistory

history = SaihmChatMessageHistory()           # local blind sandbox by default
history.add_user_message("My name is Dana.")
history.messages                              # -> [HumanMessage("My name is Dana.")]
history.clear()                               # crypto-shreds the messages this history added

LlamaIndex — drop-in for chat engines / agents (memory=…)

from saihm_memory import SaihmMemory
from llama_index.core.llms import ChatMessage, MessageRole

memory = SaihmMemory.from_defaults()
memory.put(ChatMessage(role=MessageRole.USER, content="My name is Dana."))
memory.get_all()                             # -> [ChatMessage(USER, "My name is Dana.")]
memory.reset()                               # crypto-shreds the messages this memory added

CrewAI — a StorageBackend you register once

from crewai.memory.storage.factory import set_memory_storage_factory
from saihm_memory import SaihmStorageBackend

# Route CrewAI's memory through SAIHM; return None for specs you do not handle.
set_memory_storage_factory(lambda spec: SaihmStorageBackend() if spec == "saihm" else None)

Source: citw2/saihm-crewai. SAIHM is a blind store, so retrieval ranks client-side; delete / reset crypto-shred.

AutoGen — an autogen_core.memory.Memory

from autogen_agentchat.agents import AssistantAgent
from saihm_memory import SaihmMemory

agent = AssistantAgent("assistant", model_client=..., memory=[SaihmMemory()])

Source: citw2/saihm-autogen. Async-native; the bundled sidecar seals every cell, so Python never holds a key.

LangGraph — a BaseStore for long-term memory

from saihm_memory import SaihmStore

graph = builder.compile(store=SaihmStore())   # nodes get the store injected

Source: citw2/saihm-langgraph. Durable cross-thread memory; delete crypto-shreds. (Distinct from saihm-langchain, which gives classic LangChain a chat history.)

LlamaIndex — a BaseRetriever for RAG over a corpus you own

from llama_index.core.schema import TextNode
from saihm_memory import SaihmRetriever

r = SaihmRetriever()                          # local blind sandbox by default
r.add_nodes([TextNode(text="Dana is allergic to penicillin.")])   # seal your document chunks
nodes = r.retrieve("what is the patient allergic to?")            # the RAG retrieval step

Source: citw2/saihm-rag. Retrieval over an owned corpus; the blind store ranks client-side and forget crypto-shreds a source document. (Distinct from saihm-langchain's LlamaIndex chat memory.)

Core client (any Python app)

from saihm_memory import SaihmMemoryClient

mem = SaihmMemoryClient()                     # local blind sandbox by default
cell = mem.remember("My name is Dana Okafor.")
mem.recall()                                  # -> [Memory(cell_id=..., text="My name is Dana Okafor.")]
mem.forget(cell)                              # crypto-shred (irreversible)

Run the adapter demo

git clone https://github.com/citw2/saihm-langchain
cd saihm-langchain
npm install                                   # the Node sidecar that seals every cell client-side
python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python demo.py                                # offline blind sandbox; no account

The adapters read your whole store, but clear() / reset() only crypto-shred the messages that instance added — a reset never wipes the rest of your memory by surprise.

Self-host the MCP server

npx @saihm/mcp-server

Go live against the hosted endpoint

The sandbox is an offline stand-in — it is not the SAIHM service and stores nothing beyond the running process. Going live requires a membership — the free tier starts with one command and no card (see /quickstart). For a paid plan, onboard via POST /api/onboard to obtain a JWT, then point the same code at the blind endpoint:

export SAIHM_ENDPOINT_URL=https://saihm.coti.global/mcp
export SAIHM_AUTH_HEADER="Bearer <your-onboard-JWT>"
export SAIHM_MASTER_SECRET_HEX=<at least 64 hex chars, generated and held only by you>

Your master secret never leaves your machine; the endpoint only ever receives ciphertext.

MCP tools

ToolGroupTier
saihm_rememberMemoryAll
saihm_recallMemoryAll
saihm_forgetMemoryAll
saihm_statusMemoryAll
saihm_shareSharingPro Fast / Enterprise Fast, or PAYG
saihm_revoke_shareSharingPro Fast / Enterprise Fast, or PAYG
saihm_governance_proposeGovernanceNot enabled yet
saihm_governance_voteGovernanceNot enabled yet

All tools route through the protocol runtime and emit GC-14 audit receipts. See /.well-known/saihm.json for machine-readable surface metadata and /docs for the full identity model. The two governance tools are held back until separately ratified — present so the tool surface stays stable across releases, but they do not open or record a vote today.

Endpoints

PathTypePurpose
/mcpHTTP+SSEMCP bridge fronting the stdio MCP server
/api/onboardPOST JSONHKDF-signed nonce + payment intent → JWT (24 h). See Billing & gasless.
/.well-known/saihm.jsonGET JSONProtocol descriptor
/.well-known/security.txtGET textRFC 9116. See /trust#disclosure for scope and process.
/llms.txtGET textLong-form summary for LLM consumers
/agents.txtGET textShort-form for agent crawlers

Billing & gasless onboarding

Ways to pay:

  • Fiat via Stripe (subscription tiers) — pay by card or another Stripe-supported method at Join; no crypto, gas, or bridging.
  • USDC.e (canonical, no premium) — broadcast the transfer to your tier address and pay COTI gas yourself.
  • Gasless via signed authorization (no premium) — sign in your wallet and hold no COTI for gas; SAIHM settles your tier on-chain. How to start →
  • Only USDC.e settles a tier. Native COTI, USDT, DAI, or ETH sent to a tier address will not credit your account. See /pricing.

Rates: pay-as-you-go settles per call with no subscription and no card-on-file; monthly tiers add dedicated quotas, sharing contracts, and audit retention. Current per-call rates, full tiers, and the side-by-side decision matrix are on the pricing page.

Who adopts SAIHM

  • Indie agent builders. Add SAIHM over the existing MCP transport in a weekend; the agent remembers each repo’s conventions, the preferred test framework, the files the user keeps returning to. PAYG bills only the calls beta users actually generate.
  • OSS framework maintainers. Pre-integrate SAIHM as the default memory backend; downstream users get sovereignty, sharing, and erasure out of the box — no memory service to ship, no key-management ops to run.
  • Platform & compliance teams. Memory continuity decoupled from whichever model vendor procurement settles on next; user-held keys, provable crypto-erasure, and dated public build commitments give security something concrete to audit against.

Why build on it

  • Apache 2.0. Embed SAIHM in your product without a commercial-license conversation.
  • No vendor SDK lock. The protocol is the contract. Anything that speaks MCP can speak SAIHM.
  • Public reproducibility. Build commitments are anchored on a public network; verify what is actually serving you against what is published.

Where to find SAIHM

The client is published to npm and listed in the public MCP registries, so it can be installed from whichever index your tooling already uses.

Verify a published build yourself with npm audit signatures — releases are built and published by continuous integration under trusted publishing.

Common questions

How do I add SAIHM memory to an MCP client?
Add one entry to the client’s MCP configuration: npx -y @saihm/mcp-server-pro, with no environment variables required. In Claude Code, claude mcp add saihm -- npx -y @saihm/mcp-server-pro does the same thing. Full setup is on MCP memory.
Which package should I use?
@saihm/mcp-server-pro is the sealing client: encryption and decryption happen in the process and the key never leaves it. @saihm/mcp-server is the reference server for the custodial, operator-fronted deployment, and takes SAIHM_ENDPOINT_URL and SAIHM_AUTH_HEADER.
Do I need an account or a card to start?
No. The free tier needs neither. Tell the agent “Join SAIHM”, or run npx -y @saihm/mcp-server-pro free-join; an identity is generated on the device. Paid plans onboard through POST /api/onboard.
Which frameworks are supported?
Anything that speaks MCP, plus Python adapters for LangChain, LlamaIndex, CrewAI and AutoGen. The protocol is the contract rather than a vendor SDK, so a framework SAIHM has never heard of works if it speaks MCP.
How many tools does the server expose?
Eight: remember, recall, forget, status, share, revoke_share, and a governance pair. The surface is capped by a protocol invariant rather than by convention.
Can I verify the published packages have not been tampered with?
Yes. Releases are built and published by continuous integration under trusted publishing and carry npm provenance attestations; npm audit signatures verifies them. The source is Apache-2.0.
What does forget actually do to the data?
It destroys the key that decrypts that cell, which leaves any remaining ciphertext unreadable to everyone including the operator. That is what makes it effective against replicas and backups, and why it cannot be undone.
Can I self-host?
Yes — the reference server is on npm under Apache-2.0 and runs against your own endpoint. The sealing client runs locally by design, so keys stay on the machine that generated them.

More questions →

Background reading

  • MCP memory — what MCP standardizes, what it leaves open, and the one-line setup.
  • Memory protocol — the six things a memory protocol has to specify.
  • Memory security — the threat model, including what custody does not fix.
  • Persistent memory — what memory has to survive, and why binding matters.
  • Multi-agent memory — coordination between agents, swarms and robot fleets.
  • AI agent memory — the four kinds, and who can technically read each one.

Network

Chain
COTI V2 Helium mainnet
Chain ID
2632500
RPC
https://mainnet.coti.io/rpc
Explorer
public block explorer

Join SAIHM