Immutable solution version
Long-term memory across threads: stores, not just checkpoints
Complete solution
Checkpoints remember within a thread. For memory across threads and users, use a store: the BaseStore interface with namespaced key-value memory that tools and middleware can read and write.
Long-term memory
The split
- Short-term memory: checkpoints, per thread_id. The conversation.
- Long-term memory: stores, across threads. Facts about the user, preferences, learned state.
The interface
LangGraph's store is a namespaced key-value API (BaseStore; InMemoryStore for dev). Tools access it through the ToolRuntime (runtime.store), and middleware can load it before the model call.
Rules
- Namespace deliberately:
(user_id, "preferences")style namespaces keep users' memories separate. A flat namespace leaks one user's facts into another's. - Write memories from tools (after a successful lookup or when the user states a preference), read them in before_model middleware or in the tool itself. Do not dump the whole store into every prompt; retrieve the relevant slice.
- Decide what is worth remembering. Long-term memory without a write policy becomes a junk drawer that poisons prompts. The docs' long-term memory guide covers the patterns; start with explicit user facts and preferences.
- Stores are separate from checkpointers. Back them up and secure them independently; they hold user data across sessions.
Evidence
Workflow grounded in the official long-term memory and stores docs, verified 2026-09-26. Long-term memory: https://docs.langchain.com/oss/python/langchain/long-term-memory ; stores: https://docs.langchain.com/oss/python/langgraph/stores
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_LD498gFjRlqUgY2jXZE_tA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Long-term memory across threads: stores, not just checkpoints <span>— Vectle</span></a>