Mimir persistent memory backend for LangGraph agents
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Mimir LangGraph Integration
Drop-in persistent long-term memory for LangGraph agents via Mimir.
Install
Install from source (not yet published to PyPI):
pip install langgraph
pip install -e integrations/langgraph/
Quick Start
from mimir_langgraph import MimirStore
# Create a Mimir-backed store
store = MimirStore(
binary="mimir", # or /usr/local/bin/mimir
db_path="~/.mimir/data/mimir.db",
)
# Use as a drop-in BaseStore replacement
store.put(("users", "123"), "preferences", {"theme": "dark", "language": "en"})
item = store.get(("users", "123"), "preferences")
print(item.value) # {"theme": "dark", "language": "en"}
# Search across namespaces
results = store.search(("users",), query="preferences theme")
for r in results:
print(r.key, r.value, r.score)
Integration with LangGraph Agents
from langgraph.graph import StateGraph
from langgraph.store.base import BaseStore
from mimir_langgraph import MimirStore
# Use MimirStore as your long-term memory
store = MimirStore()
# Build your graph with store
graph = (
StateGraph(AgentState)
.add_node("agent", agent_node)
.compile(store=store)
)
The store persists across sessions. Agents can retrieve context
from previous interactions using store.search().
Configuration
| Parameter | Default | Description |
|---|---|---|
binary |
"mimir" |
Path to the mimir binary |
db_path |
"~/.mimir/data/mimir.db" |
Path to the SQLite database |
timeout |
30.0 |
Tool call timeout in seconds |
encryption_key |
None |
Path to AES-256-GCM key file |
ollama_url |
None |
Ollama endpoint for hybrid search |
embedding_model |
None |
Embedding model name (requires ollama_url) |
How It Works
LangGraph's BaseStore interface maps cleanly onto Mimir's entity model:
| LangGraph | Mimir |
|---|---|
namespace: tuple[str, ...] |
category: str (joined with /) |
key: str |
key: str |
value: dict |
body_json: str (JSON) |
search() |
mimir_recall (FTS5) |
put() |
mimir_remember |
delete() |
mimir_forget |
Requirements
- Mimir v1.0.0+ installed (
curl -sSL https://raw.githubusercontent.com/Perseus-Computing-LLC/mimir/main/scripts/bootstrap.sh | bash) - LangGraph >= 0.2.0
- Python 3.10+
Project details
Release history Release notifications | RSS feed
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 mimir_langgraph-0.1.1.tar.gz.
File metadata
- Download URL: mimir_langgraph-0.1.1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7391204e0091dded9b3bccdc665a92297911b684c43ee8e1076b853565de3a5
|
|
| MD5 |
27c98eae65f620dbf9d720bf0b5fec8f
|
|
| BLAKE2b-256 |
9475de961244af08cce561e789ec64989d6c758ac9eb09436973baac2f5c6832
|
File details
Details for the file mimir_langgraph-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mimir_langgraph-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd003968315c83764780b9cfcb62011883b83bb2d5c7ef22c5e7eab7690e8e5c
|
|
| MD5 |
609d440e6aa90440663f7e18eb85e5e3
|
|
| BLAKE2b-256 |
337cfe87a8053ae18086d724f0b276b8e2de85f65204c3a15e042b28ed2bdd91
|