emem-langmem
LangChain BaseStore backed by emem.dev — drop-in
agent memory for LangGraph with ed25519 receipts and content-addressed
recall.
Install
pip install emem-langmem
Use
from emem_langmem import EmemStore
from langgraph.graph import StateGraph
store = EmemStore(base_url="https://emem.dev", signing_key=SEED)
graph = StateGraph(...).compile(store=store)
SEED is a raw 32-byte ed25519 seed that you own and persist, for
example os.urandom(32) once, then kept wherever the agent's other
secrets live. It signs every write, and the responder requires that:
an unattested write is refused unless the operator opened the responder
with EMEM_MEMORY_OPEN=1. The key also decides where the store writes.
EmemStore implements the four BaseStore verbs by issuing MCP
tools/call requests to the emem responder against the six Anthropic
memory-tool verbs:
| BaseStore verb | emem MCP tool | Signed |
|---|---|---|
mget(keys) |
memory_view |
read, no signature |
mset(pairs) |
memory_create |
yes |
mdelete(ks) |
memory_delete |
yes |
yield_keys |
memory_view (directory walk) |
read, no signature |
Namespaces
With a signing key, the store roots itself at
/memories/by_attester/<pubkey8>/, where <pubkey8> is the first 8
characters of your base32 pubkey. Only that key can write there, so
agents sharing one responder cannot overwrite each other. LangChain
calls mget(("ns","key")) and the store reads
/memories/by_attester/<pubkey8>/ns/key.
store.root # '/memories/by_attester/aoqqpp7t'
store.signer.pubkey_b32 # the full base32 pubkey
A key that starts with / is taken as a literal absolute path and is
left alone, which is how you reach outside your own root. Writing into
another key's namespace is refused with a 403. Without a signing key the
root stays /memories and writes go out unattested. See
docs/memory.md for the wire format.
EmemSigner is public if you drive the memory tools yourself and need
the same attester block:
from emem_langmem import EmemSigner
signer = EmemSigner(SEED)
signer.attester_block("create", f"{signer.namespace_root}/n.md", b"hi")
# {'pubkey_b32': '...', 'sig_b32': '...'}
Async variants amget / amset / amdelete / ayield_keys are
implemented over httpx.AsyncClient.
Self-host
EmemStore(base_url="http://127.0.0.1:5051")
or set EMEM_BASE_URL in the environment.
Receipts
Every read and write returns an ed25519 receipt from the emem responder.
The receipt is currently dropped at the BaseStore interface boundary
(LangChain's contract has no receipt slot). To inspect receipts, call
the underlying MCP tool directly:
import json, httpx, uuid
r = httpx.post(
"https://emem.dev/mcp",
json={
"jsonrpc": "2.0",
"id": str(uuid.uuid4()),
"method": "tools/call",
"params": {
"name": "memory_view",
"arguments": {"path": "/memories/my/note.txt"},
},
},
).json()
print(r["result"]["structuredContent"]["receipt"])
License
Apache-2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file emem_langmem-2.0.0.tar.gz.
File metadata
- Download URL: emem_langmem-2.0.0.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43ed9cb8d0c4d166c364333f2193e25347cfda8e3ea0590f71a4e6954d6321e0
|
|
| MD5 |
6a5b444d764aba18ee006f1da8b76a2d
|
|
| BLAKE2b-256 |
72791cbf1a4390a6b02b8be030162f1b9d5e20e889b9704e6d4f080eecaaeda9
|
Provenance
The following attestation bundles were made for emem_langmem-2.0.0.tar.gz:
Publisher:
publish-pypi-langmem.yml on Vortx-AI/emem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emem_langmem-2.0.0.tar.gz -
Subject digest:
43ed9cb8d0c4d166c364333f2193e25347cfda8e3ea0590f71a4e6954d6321e0 - Sigstore transparency entry: 2345769348
- Sigstore integration time:
-
Permalink:
Vortx-AI/emem@b24688155e8e8752b63502633e45a0542546ce7d -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/Vortx-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi-langmem.yml@b24688155e8e8752b63502633e45a0542546ce7d -
Trigger Event:
release
-
Statement type:
File details
Details for the file emem_langmem-2.0.0-py3-none-any.whl.
File metadata
- Download URL: emem_langmem-2.0.0-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21a7f1ad475d843964da6e2ae6568aef1f6617f6a149fc412a34c4ceae4fa9fb
|
|
| MD5 |
9071aec24593fda97748544b89122af5
|
|
| BLAKE2b-256 |
7df9cddc5d8b64def71515da5cc2407ccf8d23d6b15e8407a64de4f17bfe4961
|
Provenance
The following attestation bundles were made for emem_langmem-2.0.0-py3-none-any.whl:
Publisher:
publish-pypi-langmem.yml on Vortx-AI/emem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emem_langmem-2.0.0-py3-none-any.whl -
Subject digest:
21a7f1ad475d843964da6e2ae6568aef1f6617f6a149fc412a34c4ceae4fa9fb - Sigstore transparency entry: 2345769406
- Sigstore integration time:
-
Permalink:
Vortx-AI/emem@b24688155e8e8752b63502633e45a0542546ce7d -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/Vortx-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi-langmem.yml@b24688155e8e8752b63502633e45a0542546ce7d -
Trigger Event:
release
-
Statement type: