Add managed long-term memory to LangGraph agents with LangMem
Give LangGraph agents memory management and search tools so they can store, retrieve, and update durable facts across sessions.
npx skills add agentskillexchange/skills --skill add-managed-long-term-memory-to-langgraph-agents-with-langmem
pip install -U langmem, configure the target LLM provider key, create or connect a LangGraph store, then add create_manage_memory_tool and create_search_memory_tool to the agent.Use LangMem when a LangGraph or LangChain agent needs long-term memory as part of the agent loop instead of relying on larger prompts or one-off transcript replay. The operator installs `langmem`, connects a LangGraph store such as Postgres for persistence, adds `create_manage_memory_tool` and `create_search_memory_tool` to the agent, and decides whether memory is handled in the hot path or by a background manager. This stays skill-shaped because the boundary is the memory lifecycle for LangGraph agents: extract durable facts, search them when relevant, consolidate updates, and keep the storage layer explicit.
What this skill actually does
Inputs and prerequisites: Python, langmem, LangGraph or LangChain agent runtime, persistent store such as Postgres for production, LLM provider API key.
Setup notes: Install with `pip install -U langmem`, configure the target LLM provider key, create or connect a LangGraph store, then add `create_manage_memory_tool` and `create_search_memory_tool` to the agent.
Source and verification boundary: use https://langchain-ai.github.io/langmem/ as the canonical reference before running the workflow; keep commands, API calls, CLI usage, and generated outputs reviewable against that upstream source.
Framework fit: publish this as a Custom Agents workflow only when the operator can invoke the documented toolchain directly, rather than treating the upstream project as a generic product listing.