Skip to main content

saihm-langgraph — memory for LangGraph agents

Portable memory for LangGraph agents. A LangGraph BaseStore whose memories are encrypted on your machine and follow your user to other models and frameworks. Any memory can be erased for good.

PyPI version license Star on GitHub Sponsor SAIHM Subscribe on YouTube Follow on X

saihm-langgraph is now the LangGraph adapter inside the consolidated saihm-adapters package. Installing it pulls saihm-adapters[langgraph]. This package ships no code of its own.

New to SAIHM? Watch the 6-minute overview (captions and transcript). Prefer to read? The SAIHM manual (PDF) is a decision-maker's guide to SAIHM.

Encrypted at rest, by default. Every memory is encrypted on your own machine before it goes anywhere, and SAIHM stores only that ciphertext. Nobody else can read your memories — not the storage, not SAIHM. With your key in a key file, Python never reads the key. With the default free-join key file, the client also keeps a local copy of your memories, so recall is fast. That copy is not encrypted, and only your user account can read it. Setting SAIHM_RECALL_CACHE=0 in every app that uses this key, MCP hosts included, stops new copies. A copy written earlier stays, and SaihmStore.delete no longer updates it. To remove it, delete ~/.saihm/recall.*, or recall.* in SAIHM_HOME if you set it; with SAIHM_RECALL_CACHE_PATH, delete that file and its .lock and .tmp.* files too (details).

Start free — one command

npx -y @saihm/mcp-server-pro free-join

No card and no wallet. The command creates your key on this machine and shows a link and a short code. Open the link, sign in to GitHub, enter the code and approve; the command then finishes by itself and shows where your key is saved. If a join is interrupted, join again on the same machine: it reuses the key it already created. The saihm-adapters README has the details, including how to start without a GitHub account.

Add SAIHM to your graph

pip install saihm-langgraph        # -> installs saihm-adapters[langgraph]; also needs Node.js >= 20 on PATH

Compile your graph with the store; every node that takes store reads and writes SAIHM:

from typing import TypedDict

from langgraph.graph import END, START, StateGraph
from langgraph.store.base import BaseStore

from saihm_adapters import SaihmStore


class State(TypedDict):
    user: str
    answer: str


def remember(state: State, *, store: BaseStore):
    store.put(("users", state["user"]), "drink", {"text": "likes tea"})
    return {}


def recall(state: State, *, store: BaseStore):
    item = store.get(("users", state["user"]), "drink")
    return {"answer": item.value["text"] if item else ""}


graph = StateGraph(State)
graph.add_node("remember", remember)
graph.add_node("recall", recall)
graph.add_edge(START, "remember")
graph.add_edge("remember", "recall")
graph.add_edge("recall", END)

app = graph.compile(store=SaihmStore())
print(app.invoke({"user": "ada", "answer": ""}))  # {'user': 'ada', 'answer': 'likes tea'}

With no SAIHM_ENDPOINT_URL set, the store uses a local sandbox whose memory ends with the process, so you can try it with no sign-up. To go live once free-join has finished:

export SAIHM_ENDPOINT_URL=https://saihm.net/mcp

SaihmStore is a drop-in langgraph.store.base.BaseStore — get / put / search / delete / list_namespaces, sync and async. In live mode, SaihmStore() raises SaihmNoIdentityError when this machine has no active identity, with the command that fixes it, and a call the service refuses raises RuntimeError with the service's reason.

Migration — one line

The import root changed from saihm_memory to saihm_adapters:

from saihm_adapters import SaihmStore          # was: from saihm_memory import SaihmStore

SaihmMemoryClient, Memory, SaihmTimeout, and the start-up errors SaihmStartupError / SaihmNoIdentityError come from saihm_adapters:

from saihm_adapters import SaihmMemoryClient, Memory, SaihmTimeout, SaihmNoIdentityError

After upgrading, import saihm_memory fails with ModuleNotFoundError, which marks the one line to change.

What it costs

Start free. The free tier is a fixed, one-time allowance for trying SAIHM on real infrastructure — it doesn't reset or refill. No card, and nothing to cancel. Paid plans are monthly; prices are on the pricing page. Upgrading keeps the same key and every memory you already have.

Support SAIHM

  • Star it on GitHub. Stars help other developers find SAIHM.
  • Share it with a colleague, your team, or anyone whose agents keep forgetting.
  • Follow @SAIHMemory on X for news and updates.
  • Sponsor it through GitHub Sponsors, monthly or one-time.
  • Follow along on YouTube: like the videos, subscribe to the channel, and turn on notifications with the bell 🔔 for new videos and updates.
  • Questions or problems? See contact and support.

More: the consolidated package, its source and full guide, the demos, and what SAIHM is.

License

Apache-2.0 © SAIHM

Metadata

Release files for saihm-langgraph 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for saihm-langgraph 0.1.4
File Size Uploaded Provenance Actions
saihm_langgraph-0.1.4.tar.gz 9.7 kB Without provenance Details for saihm_langgraph-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for saihm-langgraph 0.1.4
File Interpreter ABI Platform Actions
saihm_langgraph-0.1.4-py3-none-any.whl Python 3 none any Details for saihm_langgraph-0.1.4-py3-none-any.whl

Total release size: 18.0 kB

Release files / saihm_langgraph-0.1.4.tar.gz

Download URL saihm_langgraph-0.1.4.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ffbda53dcc1cadaee2865e7c6cf9c7e84a927a854e10c6fb54fbfa691f4d565e
BLAKE2b-256 checksum
How to use checksums
81f1bb5cf1ee452f24e7026df2d4f9f214959d6e50209f62535e74b2cb60d108
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / saihm_langgraph-0.1.4-py3-none-any.whl

Download URL saihm_langgraph-0.1.4-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b765161825a973e11b6a97a6a5c44db8f8f4e3c9876343b3115dbbac7e02c1c6
BLAKE2b-256 checksum
How to use checksums
8aba4685687d352490d51ec72de88acc5ca2a1530ddd97195ad6ae9e8da5b298
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for saihm-langgraph 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page