Open-source Python framework for building chat interfaces for LLM apps, now archived and no longer maintained.

LangMem
Python library from LangChain that gives AI agents long-term memory and lets them refine behavior from past conversations.
What is LangMem?
LangMem is a Python library from the LangChain team that lets agents learn from their interactions and adapt over time. It offers tools that pull key details out of conversations, refine agent behavior by improving prompts, and keep long-term memory across sessions. The core memory API works with any storage system, and there is a native integration with LangGraph's long-term memory store, which is available by default in LangGraph Platform deployments. Agents can use memory management tools to record and search information while a conversation is happening, known as the hot path, or a background memory manager can extract, consolidate and update knowledge automatically. A short example shows an agent created with create_react_agent that stores a preference such as dark mode and recalls it later. You install it with pip install -U langmem and bring an API key for your LLM provider. It is an open-source developer library with no pricing listed in the repository.
Use cases
- Give an agent persistent long-term memory
- Personalize responses across sessions
- Extract key facts from conversations
- Consolidate agent knowledge in the background
- Refine agent prompts from experience
- Search past interactions with semantic recall
Who it's for
Why use LangMem
- Agents can remember user preferences and facts across conversations instead of starting from scratch.
- The same primitives work whether memory is written during a chat or in the background.
- Storage-agnostic APIs let you keep your existing database.
- Tight LangGraph integration reduces setup for teams already using it.
- A short code example gets a memory-enabled agent running in a few lines.
LangMem features
- Core memory API that works with any storage system
- create_manage_memory_tool and create_search_memory_tool for agents
- Hot-path memory management during active conversations
- Background memory manager that extracts, consolidates and updates knowledge
- Prompt refinement to optimize agent behavior
- Native integration with LangGraph's long-term memory store
- Support for DB-backed stores such as AsyncPostgresStore
- Embedding-indexed memory search
LangMem integrations
How to get started with LangMem
- Install the package with pip install -U langmem and set an API key for your LLM provider.
- Create a store, such as InMemoryStore for testing or a Postgres-backed store for production.
- Add the manage-memory and search-memory tools to a LangGraph agent, or run the background memory manager.
- Chat with the agent; it stores relevant details and searches them when later questions need them.
LangMem limitations
- InMemoryStore loses memories on restart, so production needs a DB-backed store
- It is a code library and requires a Python agent setup
- You must supply your own LLM provider API key
- It is designed around LangGraph storage, though the core API works with any store
LangMem pricing
LangMem is open source, so you can use and self-host it for free.
Prices can change and may vary by country or exclude tax. Check the official pricing page.
LangMem alternatives
The main LangMem alternatives listed on Debuly are Mem0, Zep, Letta, Cognee, Supermemory and ReMe. The table compares pricing and platforms; order is A–Z.
| Tool | Pricing | Starting price | Platforms |
|---|---|---|---|
| LangMem | Open source | — | Python |
| Cognee | Freemium | $1, usage-based | Web, API, Self-hosted, MCP server |
| Letta | Freemium | $20/mo | CLI, Web, API |
| Mem0 | Freemium | $19/mo | API, Web, Self-hosted, CLI |
| ReMe | Open source | — | CLI, Self-hosted, Web, API |
| Supermemory | Freemium | $19/mo | API, Web, Self-hosted |
| Zep | Freemium | — | API |

Cognee
Open-source memory engine for AI agents that combines vector search, knowledge graphs and relational storage, with a hosted cloud.
FreemiumVisit Cognee (official site)Letta
Platform, formerly MemGPT, for building stateful AI agents with persistent memory, from a terminal app, SDK or API.
FreemiumVisit Letta (official site)Mem0
Memory layer for AI agents and apps, available as an open-source package or a managed platform that keeps user context across sessions.
FreemiumVisit Mem0 (official site)ReMe
Open-source memory layer for AI agents that stores knowledge as local Markdown files with hybrid search and a linked graph.
Open sourceVisit ReMe (official site)
Supermemory
Memory and context API for AI agents with user profiles, a memory graph, retrieval and connectors, billed by usage.

Zep
Managed memory and context platform for AI agents, built on the Graphiti knowledge graph, with Python, TypeScript and Go SDKs.
FreemiumVisit Zep (official site)
LangMem FAQ
Is LangMem free and open source?
It is published as an open-source repository by langchain-ai and installs with pip. The repository lists no pricing, so costs come from your LLM provider and storage.
How much does LangMem cost?
The library has no listed price. You pay for the model calls, embeddings and database you use.
Does LangMem work without LangGraph?
The core memory API works with any storage system and the docs say custom memory systems can be built without agents, though native integration is with LangGraph's store.
What is hot-path versus background memory?
Hot-path memory lets the agent record and search memories during a conversation using tools. Background memory runs a manager that extracts and consolidates knowledge automatically.
How do I make memories persist?
InMemoryStore loses memories on restart. For production the docs suggest AsyncPostgresStore or a similar database-backed store.
What are alternatives to LangMem?
Common alternatives for agent memory include Mem0, Zep, Letta, Cognee and Supermemory.
Sources & verification
Facts on this page come from the official sources below, each with the date we read it. Written by Debuly; the vendor did not review this page.
| Source | Type | Accessed |
|---|---|---|
| github.com/langchain-ai/langmem | official |
Image credits
- Logo: from avatars.githubusercontent.com · fetched · Vendor trademark, used only to identify the product; removed on request
- Cover: none collected yet, so a generated tile is shown.
Spot an error? Report an issue with this listing. We also remove a logo or image on the owner's request.



