Technology · Agentic → Memory · Open Source · wiki:deep

LangMem

LangMem helps agents learn and adapt from interactions over time. It extracts important information from conversations, supports prompt refinement, and maintains long-term memory via functional primitives (any storage) plus native integration with LangGraph’s Long-term Memory Store (default on LangGraph Platform).

Core pieces: a storage-agnostic memory API; hot-path tools (create_manage_memory_tool, create_search_memory_tool) agents call during chat; and a background memory manager that extracts, consolidates, and updates knowledge. Install: pip install -U langmem (MIT).

Why it matters here

An agentic OS that forgets preferences and prior case context forces humans to re-type truth. LangMem is the LangGraph-native memory layer: agents record/search in-session, and background jobs consolidate — without inventing a second memory product. Prefer it when the runtime is already LangGraph; prefer Mem0/Zep/Letta when you need a standalone memory service or graph timeline.

Memory here is assistant state, not the company ledger.

How it works

  1. Attach a LangGraph BaseStore (dev: InMemoryStore; prod: Postgres/similar).
  2. Give the agent manage/search memory tools (hot path) and/or enable background memory manager.
  3. Conversations trigger store/search; embeddings index memories for retrieval.
  4. Persist across restarts only if the store is durable — in-memory is lost on process exit.

Related: langgraph · mem0 · zep · topics/31-memory-architecture

Flow

Scroll inside the canvas to pan

When to reach for it

  • Use when: agents run on LangGraph and need hot-path + background long-term memory.
  • Skip when: you need a multi-tenant hosted memory SaaS first (mem0 / Zep Cloud), MemGPT-style OS agents (letta), or only short-term thread state.
  • Prefer instead: Mem0 for drop-in memory API across frameworks; Graphiti/Zep for temporal knowledge graphs.

Limits

  • Store durability: InMemoryStore is for demos — production needs DB-backed store.
  • LLM dependency: extraction/tools need a provider key; quality tracks the model.
  • LangGraph gravity: primitives work elsewhere, but native path assumes LangGraph store semantics.
  • Not system of record: preferences ≠ declared company configuration or authority.

Linked from

What we checked

Claims below are backed by science sources on disk.

Product / LangGraph memory tooling

langchain-ai/langmem · MODERATE

LangMem helps agents learn and adapt from their interactions over time.

Contrast vs Letta

OS-style memory contrast · MODERATE

To enable using context beyond limited context windows, we propose virtual context management, a technique drawing inspiration from hierarchical memory systems in traditional operating systems which provide the illusion of an extended virtual memory via paging between physical memory and disk.

Contrast vs Mem0

Mem0 contrast · MODERATE

We introduce Mem0, a scalable memory-centric architecture that addresses this issue by dynamically extracting, consolidating, and retrieving salient information from ongoing conversations.

In this research stack

Features and peers linked from the catalog map — not a second product surface.

Features it supports

Same cell

Stack

Document management

No DM vendor crosswalk edges yet.

Source

Primary repo github.com/langchain-ai/langmem · Open Source

technologies/langmem/README.md

Research inventory

9 tags · 11 out · 12 in · 3 artifacts · 1 gaps · 32 corpus docs

Catalog tags

landscape.layer
Agentic
landscape.subcategory
Memory
license_tag
Open Source
maps.dm
absent
maps.features
8
one_liner
Agentic
review.depth
science
slug
langmem
title
LangMem

Artifacts

  • dm_map · absent
  • features_map · present · technologies/langmem/features.md
  • readme · present · technologies/langmem/README.md

Out · alternative_to

Out · maps_to

In · alternative_to

In · in_stack

In · maps_to

Corpus tags

category
Agentic → Memory
dedication
open-source
feature
learning-adaptation
memory-state-persistence
os-company-model-memory
r2-10-sleep-improvement
r2-31-memory-architecture
r2-35-context-engineering
r2-36-importance-consolidation
wt-data-context
kind
map_edge
tech_features
tech_quote
tech_readme
tech_science_source
tech_section
needs_deepen
false
quality
ok
section
Evidence
Features map
GitHub map
How it works
Limits & failure modes
Links
Scientific notes
What it is
When to use / skip
Why it matters here
slug
langmem
source_id
langmem-github
letta-contrast
mem0-contrast
technology
langmem

Corpus documents (32)

map_edge · 8

  • langmem → learning-adaptation
  • langmem → memory-state-persistence
  • langmem → os-company-model-memory
  • langmem → r2-10-sleep-improvement
  • langmem → r2-31-memory-architecture
  • langmem → r2-35-context-engineering
  • langmem → r2-36-importance-consolidation
  • langmem → wt-data-context

tech_features · 1

  • LangMem · features

tech_quote · 9

  • LangMem · langmem-github
  • LangMem · langmem-github
  • LangMem · langmem-github
  • LangMem · letta-contrast
  • LangMem · letta-contrast
  • LangMem · letta-contrast
  • LangMem · mem0-contrast
  • LangMem · mem0-contrast
  • … +1 more

tech_readme · 1

  • LangMem

tech_science_source · 3

  • LangMem · langmem-github
  • LangMem · letta-contrast
  • LangMem · mem0-contrast

tech_section · 10

  • LangMem · Evidence
  • LangMem · Features map
  • LangMem · GitHub map
  • LangMem · How it works
  • LangMem · Limits & failure modes
  • LangMem · Links
  • LangMem · Scientific notes
  • LangMem · What it is
  • … +2 more