Alpha Notice: These docs cover the v1-alpha release. Content is incomplete and subject to change.For the latest stable version, see the v0 LangChain Python or LangChain JavaScript docs.
Overview
LangChain agents use LangGraph persistence to enable long-term memory. This is a more advanced topic and requires knowledge of LangGraph to use.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.
Read long-term memory in tools
A tool the agent can use to look up user information
Write long-term memory from tools
Example of a tool that updates user information