skillfed

langmem

Prebuilt utilities for memory management and retrieval.

langmem v0.0.30 725.9K downloads/30d#5,219 on PyPI
Permissive 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) AGING released

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 on this page — 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

langmem on PyPI

pip

pip install langmem

uv

uv add langmem

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 8 — langchain-anthropic, langchain-core, langchain-openai, langchain, langgraph-checkpoint, langgraph, langsmith, trustcall
Maintenance aging — 291 days since the last release
First released
Downloads 725,853/month — #5,219 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: langmem-0.0.30-py3-none-any.whl

Tags

agent memory managementconversation context persistencelanggraph memory toolslong-term agent memoryagent knowledge extractionmemory search and retrievalagent learning from interactions
agent-memorylanggraph-integrationconversation-context

More Artificial Intelligence packages

Further reading