--- id: langmem version: "0.0.30" license: MIT License Copyright (c) 2025 LangChain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # langmem — Prebuilt utilities for memory management and retrieval. License: permissive · Maintenance: aging · Downloads: 725.9K/mo ## What it is and what it does LangMem is a memory management library for LangGraph agents that helps them learn and adapt from conversations over time. It provides both a functional core API (usable with any storage system) and native integration with LangGraph's storage layer, allowing agents to extract important information, optimize behavior through prompt refinement, and maintain knowledge across sessions. The package offers memory tools that agents can invoke during conversations to record and search information, plus a background memory manager that automatically consolidates and updates agent knowledge. It works with LangGraph's InMemoryStore for development or production-grade stores for persistence. Agents can decide what to remember without special commands—they simply use the provided tools during normal interaction. Use it for: - Build chatbots that remember user preferences and adapt responses across multiple conversations without explicit commands. - Create agents that extract and consolidate key facts from long conversations to maintain consistent context. - Implement background memory consolidation to automatically refine agent knowledge and improve future interactions. - Develop multi-turn agents that search past interactions to answer questions about previous user statements or preferences. - Persist agent memories across server restarts using LangGraph's storage backends for production deployments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. LangMem provides memory management tools for LangGraph agents, enabling them to store, search, and recall information from conversations to maintain context and adapt behavior across sessions. Yes, if you are building LangGraph agents and need persistent memory across conversations. The low install friction and permissive MIT license make adoption straightforward. However, the aging maintenance status (291 days since last release) warrants checking that its dependencies remain compatible with your langchain and langgraph versions before committing to production use. ## Install pip install langmem uv add langmem poetry add langmem ## Installing langmem Before you install: Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 291 days ago—but the package carries eight runtime dependencies, so updates to upstream libraries could affect stability. License in practice: MIT License permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install -U langmem from langmem import create_manage_memory_tool, create_search_memory_tool from langgraph.prebuilt import create_react_agent from langgraph.store.memory import InMemoryStore store = InMemoryStore(index={"dims": 1536, "embed": "openai:text-embedding-3-small"}) agent = create_react_agent( "anthropic:claude-3-5-sonnet-latest", tools=[create_manage_memory_tool(namespace=("memories",)), create_search_memory_tool(namespace=("memories",))], store=store, ) agent.invoke({"messages": [{"role": "user", "content": "Remember that I prefer dark mode."}]}) Requires Python >=3.10 and an API key for an LLM provider (e.g., ANTHROPIC_API_KEY environment variable). Verify before relying: - Whether the package is actively maintained or in long-term support mode despite the aging status - Performance characteristics when managing large conversation histories or high-frequency memory operations - Compatibility guarantees with specific versions of langchain, langgraph, and langsmith ## Package facts - License: MIT License Copyright (c) 2025 LangChain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 725.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags agent memory management, conversation context persistence, langgraph memory tools, long-term agent memory, agent knowledge extraction, memory search and retrieval, agent learning from interactions, agent-memory, langgraph-integration, conversation-context [View on SkillFed](https://skillfed.io/packages/langmem) · [View on PyPI](https://pypi.org/project/langmem/)