---
title: "LangChain memory in 2026: what replaced it"
description: "LangChain deprecated its memory classes in favor of LangGraph persistence. What changed, what each option stores, and how to add temporal memory via API."
canonical: https://past.dev/integrations/langchain
last-updated: 2026-08-31
---
# Memory for LangChain agents

Source: https://past.dev/integrations/langchain

LangChain's classic memory classes, ConversationBufferMemory and its relatives, are deprecated: the framework moved persistence to LangGraph, and long-term memory to stores and the LangMem SDK. Those layers persist conversation state and extracted memories. What none of them model is time: which fact is current, what superseded what, and what was true on a date. This page maps the 2026 options and shows the API pattern for adding temporal, evidence-backed memory to any LangChain agent.

## LangChain memory options in 2026

| Layer | What it stores | Scope |
| --- | --- | --- |
| LangGraph checkpointers | Full graph state per thread | One thread; resume and replay |
| LangGraph store | Key-value and vector memories | Cross-thread, per namespace |
| LangMem SDK | Extracted memories over the store | Cross-thread, app-managed |
| past.dev via tool | Facts with dates, sources, supersession and status values | Cross-user, cross-app, temporal |

The deprecation is documented in LangChain's own guides: legacy memory classes were removed in the 1.0 line, with [long-term memory](https://docs.langchain.com/oss/python/langchain/long-term-memory) now described in terms of LangGraph persistence and stores, plus the [LangMem SDK](https://langchain-ai.github.io/langmem/). If a migration brought you here, the practical translation: buffer memory became checkpointed thread state, and everything long-term became your choice of store.

## What the native layers do not model

- **Currency.** Writing two budget values creates two store entries. Similarity scores do not identify which value is current.
- **Original time.** Store records use write time unless the application adds event-time fields. Backfilled history therefore needs explicit timestamp handling.
- **Identity.** Namespaces do not automatically join an email signature to a chat handle for the same customer.
- **Evidence status.** Empty retrieval returns an empty list. Application logic must distinguish insufficient evidence from a retrieval miss.

## The pattern: memory as a tool

```python
import os, requests
from langchain_core.tools import tool

BASE = "https://api.past.dev/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['PAST_API_KEY']}"}

@tool
def recall_memory(question: str) -> str:
    """Look up the team's history: decisions, owners, dates, changes."""
    r = requests.post(f"{BASE}/recall", headers=HEADERS,
                      json={"query": question}).json()
    return str(r)  # status + ranked, dated evidence for the model to cite

@tool
def store_memory(text: str, happened_at: str) -> str:
    """Save a durable fact with the time it actually happened (ISO 8601)."""
    r = requests.post(f"{BASE}/ingest", headers=HEADERS,
                      json={"content": text, "timestamp": happened_at}).json()
    return r.get("sourceId", "stored")
```

Bind both tools to the agent. Use the LangGraph checkpointer for thread state and past.dev for durable, timestamped facts.

Applications can route on `status`. `Supported` means the evidence establishes the answer. `Conflicted` returns evidence from credible sources that disagree. `NoKnownSupport` means the stored evidence does not establish an answer. `UnknownBecauseDegraded` means retrieval could not complete and should be treated as an unknown result.

## When to use which

- Resuming and replaying a conversation: checkpointer. That is its job and it is good at it.
- Small per-user preferences in one app: the LangGraph store is the lightest path.
- Facts that change, histories that backfill, answers that need dates and sources, memory shared beyond one app: the API pattern above.

Start at the [quickstart](/docs/memory-api/quickstart); the [benchmarks](/benchmarks) document how recall is measured, and [what is agent memory](/what-is-agent-memory) covers the concepts behind the division.

## Frequently asked questions

### I migrated off ConversationBufferMemory. Do I need anything else?

If your agent only needs to resume conversations, no: checkpointers cover it. You need a memory layer when answers depend on facts that change over time, arrive from multiple sources, or must carry dates and evidence.

### Does this work with LangGraph too?

Yes. The same tools can run in LangGraph nodes. The LangGraph guide explains how to combine checkpointers, stores, and the past.dev API.

## Related

- [Memory for LangGraph](https://past.dev/integrations/langgraph)
- [past.dev and LangMem](https://past.dev/compare/langmem)
- [Memory for n8n](https://past.dev/integrations/n8n)
- [What is agent memory?](https://past.dev/what-is-agent-memory)
- [Quickstart](https://past.dev/docs/memory-api/quickstart)