Metadata-Version: 2.5
Name: mnem-langgraph
Version: 0.0.1
Summary: LangGraph BaseStore backed by Mnemosyne: versioned agent memory with blame and branch.
Project-URL: Homepage, https://github.com/Nabzx/mnemosyne
Project-URL: Repository, https://github.com/Nabzx/mnemosyne
Project-URL: Documentation, https://nabzx.github.io/mnemosyne/
Author-email: Nabil Shah <nabilshahx@gmail.com>
License: Apache-2.0
Keywords: agents,ai,langgraph,memory,version-control
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: langgraph<2,>=1.0
Requires-Dist: mnem-agents~=0.0
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# mnem-langgraph

A [LangGraph](https://langchain-ai.github.io/langgraph/) `BaseStore` backed by
[Mnemosyne](https://github.com/Nabzx/mnemosyne). The agent's long-term memory
gets history: every `put` is a commit, and you can ask `why` a memory says what
it does, or `branch` to test a hunch.

```python
from mnem_langgraph import MnemosyneStore

store = MnemosyneStore("./agent-memory")          # one .mnem store
store.put(("memories", "u1"), "plan",
          {"tier": "enterprise", "_meta": {"source": "ticket-4821"}})

item  = store.get(("memories", "u1"), "plan")     # -> Item
hits  = store.search(("memories",), query="enterprise")
blame = store.why(("memories", "u1"), "plan")     # which commit, and from where
```

Pass it to a graph the usual way (`builder.compile(store=store)`), or use it
directly from a node.

## Mapping

- **namespace + key -> node id** `":".join([*namespace, key])`. A `":"` inside a
  segment is not supported.
- **value -> node content.** A reserved `_meta` key (`source` / `step` /
  `observation` / `tool_call` / `note`) is lifted into provenance so `blame`
  works; it is stored too, so `get` round-trips.
- **`search`** is a plain substring (`query`) and equality (`filter`) match, not
  semantic. Wrap a vector store if you need ranking.
- **Async** (`aget` / `aput` / `asearch`) runs the sync path in a worker thread.

## Extra methods

Not on the `BaseStore` interface, for a graph node to call: `branch(name)`,
`switch(target)`, `why(namespace, key)`, `history(limit=...)`.

See [ADR-0016](../../docs/adr/0016-mcp-tools-and-the-adapter-contract.md).
