Usage
To add long-term memory to an agent, create a store and pass it tocreate_agent:
- InMemoryStore
- PostgreSQL
runtime.store parameter. See Read long-term memory in tools and Write long-term memory from tools for examples.
Memory storage
LangGraph stores long-term memories as JSON documents in a store. Each memory is organized under a customnamespace (similar to a folder) and a distinct key (like a file name). Namespaces often include user or org IDs or other labels that makes it easier to organize information.
This structure enables hierarchical organization of memories. Cross-namespace searching is then supported through content filters.
- InMemoryStore
- PostgreSQL
Read long-term memory in tools
- InMemoryStore
- PostgreSQL
Write long-term memory from tools
- InMemoryStore
- PostgreSQL
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

