- DATE:
- AUTHOR:
- The LangChain Team
LangMem SDK for long-term agent memory
The LangMem SDK is a lightweight Python library that helps your agents learn and improve through long-term memory. It provides tooling to extract information from conversations, optimize agent behavior through prompt updates, and maintain long-term memory about behaviors, facts, and events.
How it fits into LangChain's ecosystem:
LangGraph Checkpointers allow for durable execution & message history
LangGraph BaseStore provide long-term memory with vector search
LangMem SDK provides the actual logic for creating, updating, and retrieving memories
Why LangMem is valuable:
Flexible & modular → Works standalone or with LangGraph, compatible with any storage backend
Structured updates → Uses trustcall for type-safe memory consolidation & invalidation
Beyond raw chat history → Captures user preferences, procedures, and policies, making agents more adaptive over time
Efficient memory management → Avoids reliance on long-context models or purely retrieval-based approaches
We’re also chatting with folks on the waitlist for a hosted/managed memory service. Sign up for the waitlist here.