LangMem icon

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

LangChain is a company focused on building a comprehensive framework for developing applications with large language models (LLMs) thro…read more

Pricing and Plans

PlanPriceFeatures
Open Source (MIT)Free
  • Python package via PyPI
  • All core SDK features
  • Self-hosted storage (in-memory, Postgres/pgvector)
Managed memory service (invite/beta)Contact us
  • Hosted long-term memory store
  • LangGraph-native integration

System Requirements

Operating System
WINDOWS, MACOS, LINUX
Memory (RAM)
8GB (recommended)
Processor
64-bit x86_64 or ARM
Disk Space
200MB+

AI Capabilities

Long-term-memory
Semantic-memory
Episodic-memory
Prompt-optimization
Vector-search
Agent-tools