
LangMem
LangMem is a Python SDK for adding long-term memory to LLM agents. It provides two complementary paths:
- Hot path tools (create_manage_memory_tool, create_search_memory_tool) that agents call during conversations to store and retrieve facts, preferences, and other context.
- Background manager that periodically extracts, consolidates, and updates memories outside the request path.
The core API is storage-agnostic and works with LangGraph’s BaseStore implementations (e.g., in-memory for dev, Postgres for production). It supports semantic and episodic memory patterns, prompt optimization/“procedural memory,” and dynamic namespaces for user- or team-scoped memories. Typical setups pair LangMem with LangGraph agents, Postgres/pgvector for persistence, and common model providers (Anthropic, OpenAI).
Install: pip install -U langmem Requires: Python 3.10+
Use it to build agents that remember user preferences across sessions, keep evolving profiles, and refine prompts over time—without hand-rolling memory extraction, deduplication, and retrieval plumbing.
No discussions yet
Be the first to start a discussion about LangMem
Demo Video for LangMem
Developer
Pricing and Plans
Plan | Price | Features |
---|---|---|
Open Source (MIT) | Free |
|
Managed memory service (invite/beta) | Contact us |
|