# LangMem > Open-source SDK from LangChain for long-term memory in LLM agents, with hot-path tools, a background memory manager, and native LangGraph storage integration. 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. ## Features - Hot-path memory tools for store/search within agent runs - Background memory manager for batch extraction and consolidation - Storage-agnostic core API; works with LangGraph BaseStore - Native integrations for InMemoryStore and AsyncPostgresStore - Dynamic namespaces for user/team-scoped memories - Supports semantic, episodic, and procedural (prompt) memory patterns - Embeddings-based retrieval (e.g., OpenAI text-embedding-3-small) - Typed/structured memories via Pydantic models - CrewAI and custom-agent usage guides - MIT-licensed; Python package via PyPI ## Integrations LangGraph, LangGraph Platform, PostgreSQL (pgvector), Anthropic, OpenAI, CrewAI ## Platforms DEVELOPER_SDK, WEB, WINDOWS, MACOS, LINUX ## Pricing Open Source, Free tier available ## Version 0.0.29 ## Links - Website: https://langchain-ai.github.io/langmem/ - Documentation: https://langchain-ai.github.io/langmem/ - Repository: https://github.com/langchain-ai/langmem/ - EveryDev.ai: https://www.everydev.ai/tools/langmem