LangMem
LangMem helps AI agents learn and adapt from interactions over time by extracting, consolidating, and managing long-term memory across conversations.
At a Glance
About LangMem
LangMem is an open-source Python library by LangChain that gives AI agents persistent, long-term memory capabilities. It provides tooling to extract important information from conversations, optimize agent behavior through prompt refinement, and maintain knowledge across sessions. Released in January 2025 under the MIT License, it integrates natively with LangGraph's storage layer and works with any LLM provider.
What It Is
LangMem is a memory management SDK for AI agents, sitting in the category of agent memory infrastructure. Its core job is to let agents remember what users tell them, consolidate that knowledge over time, and retrieve it when relevant — without requiring the developer to build custom memory pipelines from scratch. It ships as a pip-installable Python package and is designed to work both as standalone functional primitives and as a first-class citizen within the LangGraph ecosystem.
Core Architecture
LangMem separates memory into two operational modes:
- Hot path memory: Agents actively manage their own memory during live conversations using
create_manage_memory_toolandcreate_search_memory_tool. The agent decides what to store and when to search, without special commands from the user. - Background memory manager: A separate process that automatically extracts, consolidates, and updates agent knowledge after conversations complete, without blocking the main interaction loop.
This dual-mode design lets developers choose between agent-driven and system-driven memory depending on their use case.
Storage and Integration
LangMem is storage-agnostic at its functional core but provides native integration with LangGraph's BaseStore interface. For development, InMemoryStore keeps memories in process memory. For production, the library recommends AsyncPostgresStore or similar database-backed stores to persist memories across server restarts. LangMem is available by default in all LangGraph Platform deployments, making it a zero-configuration option for teams already on that stack.
Key Features
- Core memory API compatible with any storage system
- In-conversation memory tools for real-time storage and retrieval
- Background memory manager for automatic extraction and consolidation
- Native LangGraph Long-term Memory Store integration
- Support for any LLM provider via environment-configured API keys
- Functional primitives usable outside of agent frameworks
Update: Active Development on GitHub
The repository was created on January 21, 2025, and shows active ongoing development with its last push recorded in May 2026. As of that date, the project has accumulated over 1,400 GitHub stars and 168 forks, with 57 open issues — signals of an actively maintained and community-engaged project. The primary language is Python, and the license is MIT, making it freely usable, modifiable, and distributable.
Community Discussions
Be the first to start a conversation about LangMem
Share your experience with LangMem, ask questions, or help others learn from your insights.
Pricing
Open Source
Freely available under the MIT License. Install via pip and use with any storage system or LLM provider.
- Core memory API
- Hot path memory tools
- Background memory manager
- LangGraph integration
- MIT License
Capabilities
Key Features
- Core memory API compatible with any storage system
- In-conversation memory tools (hot path)
- Background memory manager for automatic extraction and consolidation
- Native LangGraph Long-term Memory Store integration
- Support for any LLM provider
- Functional primitives usable without agent frameworks
- Memory search and retrieval across sessions
- Prompt refinement for agent behavior optimization
Integrations
Demo Video

