LangGraph + Memanto
BaseStore to persist semantic memory across different threads or sessions. Memanto integrates seamlessly as a native BaseStore or via @tool functions to give your agents long-term recall.
How It Works
- BaseStore: A drop-in
BaseStoreimplementation that provides cross-thread semantic memory while respecting LangGraph’s namespace architecture. - Nodes: Pre-built graph nodes for automatic memory injection before LLM calls and storage after responses.
- Tools: Pre-built agent tools (
remember,recall,answer) injected directly into your LangGraphToolNode.
Prerequisites
- Python 3.10+
- Moorcheh API key
- Memanto package installed
Install
Pattern 1: BaseStore Integration
LangGraph uses a split memory architecture: Checkpointers for short-term thread state, and Stores for long-term semantic memory.MemantoStore maps LangGraph’s key-value namespace API directly to Memanto’s isolated agent buckets (e.g., langgraph_user123_preferences), providing instant, zero-latency semantic recall.
Setup the Store
Access Memory in Nodes
In any node, simply require thestore: BaseStore parameter. LangGraph will automatically inject MemantoStore.
Pattern 2: Node-Based Integration
If you prefer a structured, deterministic approach without relying on the LLM to autonomously call tools, you can add pre-builtrecall and remember nodes directly to your graph’s edges. This guarantees memory is injected before every generation and saved after every response.
Pattern 3: Tool-Based Integration
If you prefer to let the LLM autonomously decide when to search or save memories (rather than hardcodingstore operations in nodes), you can inject Memanto as tools.