Maximem Synap's Agent Memory Now Available for LangChain

Agent FrameworksAI Agent MemoryMaximem TeamMay 20, 20267 min read
Maximem Synap's Agent Memory Now Available for LangChain
On this page
  1. Where LangChain Excels
  2. How LangChain Memory Works Today
  3. What Synap Adds
  4. What Synap Adds to LangChain
  5. What Production Teams Gain
  6. How to Get Started
  7. Setup
  8. Memory Is Infrastructure
  9. Related Posts
  10. Frequently Asked Questions

Maximem Synap's Agent Memory Now Available for LangChain

Maximem Team

May 20, 2026

LangChain has 100,000-plus GitHub stars and the deepest integration ecosystem of any agent framework. If you are building an agent that chains LLM calls or orchestrates multi-step reasoning, LangChain is where you start.

Today, Maximem Synap extends LangChain with persistent per-user memory. Native memory stores conversation state within a process. Synap makes that state survive restarts, resolve entities across sessions, and retrieve relevant context without manual wiring.

Where LangChain Excels

LangChain taught developers how to build agents. Composable chains and tool routing. Prompt templating and output parsing. Vector store integrations and output guardrails. If your agent needs to call APIs or reason across multiple steps, LangChain handles the logic and orchestration well.

The challenge is what happens when your user comes back tomorrow.


How LangChain Memory Works Today

LangChain has shipped four classic memory classes. All store data within a single process lifetime, and since LangChain 1.0 they live in the langchain-classic package and are deprecated; our LangChain conversational memory guide covers the current checkpointer-based approach.

ConversationBufferMemory stores every message in a list, then dumps the entire list into your prompt. A scratchpad that grows forever. After twenty turns, your context window fills with noise. The agent cannot see your actual instructions. On restart, the scratchpad clears. Every session starts fresh.

ConversationBufferWindowMemory keeps only the last K messages and discards everything older. The window slides. Yesterday's conversation is already gone. You are not solving memory. You are

accelerating forgetting.

ConversationSummaryMemory compresses history into summaries. Send a paragraph describing what happened instead of every message. But summarization is lossy. In the ACE paper from Stanford, SambaNova and UC Berkeley, an agent's context collapsed in a single rewrite on the AppWorld benchmark from 18,282 tokens at 66.7% accuracy to 122 tokens at 57.1%, below the 63.7% it scored with no adapted context at all. You trade recall for tokens.

VectorStoreRetrieverMemory stores messages in a vector database and retrieves by semantic similarity. Better than the first three, but still limited to similarity search. It has no concept of entities. No temporal awareness. It cannot resolve that "John from Acme" and "[email protected]" are the same person.

Cross-session persistence, entity resolution, compaction, and per-user scoping across restarts fall outside what these four classes were designed to handle. Those are infrastructure problems.


What Synap Adds

Synap is agentic context management. It does not replace LangChain's memory. It extends it with a persistence layer.

We ship three components that plug into LangChain's native interfaces:

SynapCallbackHandler implements BaseCallbackHandler. Attach it to any chain. It captures every turn in the background and ingests it into Synap asynchronously. No code changes to your chain logic. No latency added to your execution. The chain keeps working. The agent starts remembering.

SynapChatMessageHistory implements BaseChatMessageHistory. Use it as your memory backend. Per-user, per-conversation scoping. State survives restarts. Prior messages replay on the next session without manual setup.

SynapRetriever implements BaseRetriever. Fetch user-scoped memories as standard LangChain Document objects. Two modes: fast, built for a live conversation, and accurate, which breaks a compound question into parts and follows relationships between entities at a higher latency.

The integration is a native package. Drop it in, replace the memory backend, and your chain picks up persistent memory without a rewrite.


We built this because agents kept stalling in production. Not from bad chain logic. From missing context that lived in a different session last Tuesday. On our open eval harness, with gpt-5-mini as both answer model and judge, Synap scores 92% on LongMemEval (500 questions) and 93.2% on LoCoMo (1,540 questions); in-conversation reads come from a cache Synap pre-fetches into your own process at an asserted P75 under 15ms, and a cold retrieval targets P95 450ms.

For why context management is infrastructure and not a feature, read What Is Agentic Context Management? For build-versus-buy numbers, see The Real Cost of DIY Agent Memory. For a step-by-step, version-checked walkthrough on LangChain 1.x (checkpointers, stores and both Synap recipes), see How to Add Conversational Memory to a LangChain App.


 

What Synap Adds to LangChain


PERSISTENCE

LangChain Native: In-process only. State clears on restart.

With Synap: Per-user memory survives across sessions and restarts.


ENTITY RESOLUTION

LangChain Native: Raw identifiers. No linking across sessions.

With Synap: "John" and "[email protected]" resolve to one canonical entity across every session.


COMPACTION

LangChain Native: Manual summarization. Lossy.

With Synap: Automatic and configurable. Accuracy-preserving compaction that does not drop critical facts.


RETRIEVAL LATENCY

LangChain Native: Depends on vector store setup.

With Synap: in-conversation reads at an asserted P75 under 15ms from an in-process cache; cold retrieval targets P95 450ms.


LONG-TERM RECALL

LangChain Native: Not benchmarked for cross-session recall.

With Synap: 92% on LongMemEval and 93.2% on LoCoMo (open harness, gpt-5-mini as answer model and judge).


FAILURE HANDLING

LangChain Native: Retrieval failures crash the chain or return noise.

With Synap: Empty result and a logged error. Your chain keeps running.


USER SCOPING

LangChain Native: Session-scoped only.

With Synap: Built-in user_id, conversation_id, customer_id scoping out of the box.


 

What Production Teams Gain


Cross-session continuity. Your user chats on Monday, returns on Wednesday. SynapChatMessageHistory replays prior context. SynapRetriever surfaces relevant facts from last week. The agent treats every session as one continuous conversation. Native memory treats every session as a fresh start.


Accuracy that ships. Synap scores 92% on LongMemEval and 93.2% on LoCoMo, benchmarks that measure whether agents recall facts across long, multi-turn conversations spanning multiple sessions, reproduced on our open harness with gpt-5-mini as answer model and judge.


Token efficiency. Synap's Agentic Compaction keeps the working context bounded: it triggers at 3,000 tokens, 10 messages or 5 minutes idle, compresses toward a 1,500-token target while keeping the last three conversation pairs verbatim, and returns a validation score and a preserved-facts count on every pass. Re-sending the full history grows token cost quadratically with conversation length; validated compaction keeps it close to linear. At scale, that is the difference between profit and burn.


Latency that does not block. In-conversation reads come from a cache Synap pre-fetches into your own process, at an asserted P75 under 15ms; a cold retrieval targets P95 450ms. Both degrade without crashing. A failure returns empty results and a log line, not a broken chain.


Entity resolution. "John from Acme," "[email protected]," and "user_4829" resolve to one person across every session. Synap handles this at the memory layer so your chain nodes do not have to.


Production resilience. The callback handler captures turns in the background without adding latency. The retriever returns empty results on failure instead of crashing. The message history replays prior messages per session. All three components implement standard LangChain interfaces. No wrappers. No adapters.


  

How to Get Started

Setup

Install the package alongside LangChain and your model provider:

pip install maximem-synap-langchain langchain langchain-openai

Configure your API key. Generate one from the Synap Dashboard.

.env

SYNAP_API_KEY=synap_your_key_here
OPENAI_API_KEY=your-openai-api-key

Then initialize the SDK once at application startup:

from maximem_synap import MaximemSynapSDK

sdk = MaximemSynapSDK() # picks up SYNAP_API_KEY from env await sdk.initialize()

See SDK Initialization for the full lifecycle and configuration options.

​

Basic integration The smallest useful integration is a chain withautomatic memoryviaSynapCallbackHandler. Every turn is ingested without changing your chain logic:

import uuid
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from synap_langchain import SynapCallbackHandler

llm = ChatOpenAI(model="gpt-4o")

prompt = ChatPromptTemplate.from_messages([ ("system", "You are a helpful assistant with long-term memory."), ("human", "{question}"), ])

chain = prompt | llm

handler = SynapCallbackHandler( sdk=sdk, conversation_id=str(uuid.uuid4()), # must be a valid UUID user_id="alice", customer_id="acme", # optional; required for B2B instances )

response = await chain.ainvoke( {"question": "Remind me what we agreed on for the Q2 roadmap."}, config={"callbacks": [handler]}, )

The handler observes the chain via LangChain’s callback system, captures the user/assistant pair, and ingests it into Synap asynchronously.Ingestion failures are logged atERRORlevel and never propagate to your chain, so your application keeps running even if Synap is unreachable.This is the smallest viable setup. To make the modelawareof memory at inference time, combine the callback withSynapChatMessageHistoryand/orSynapRetrieverbelow.


  

Memory Is Infrastructure

LangChain gave the world a standard for building agents. Real value. The memory layer it ships handles in-session state well. Making that state persist across sessions, resolve entities, and retrieveintelligently is a different problem.

The teams that ship production agents discover this around month three. They either build memory infrastructure themselves, or they plug in a system built for the problem.
This is why memory is infrastructure, not a feature.
Start building LangChain agents that remember across sessions: https://synap.maximem.ai

Synap pricing is usage-based. You pay for memory operations: storage, retrieval, compaction. No per-seat or per-framework surcharge. Starter plan: $19/month at launch pricing (list $49). Every new account gets about $10 in free credits to test before committing. See full pricing at https://synap.maximem.ai/pricing.



  - What Is Agentic Context Management?

  - The Real Cost of DIY Agent Memory

  - How to Add Conversational Memory to a LangChain App (2026 Guide)

  - Skills Are the New Microservices


 

Frequently Asked Questions


Does LangChain have built-in memory?

  • Yes, in two generations. The four classic memory classes are process-local and now deprecated in langchain-classic; LangChain 1.x uses a checkpointer for thread memory and a store for cross-conversation memory. Neither resolves entities or decides what is worth remembering.

How is Synap different from VectorStoreRetrieverMemory?

  • VectorStoreRetrieverMemory is similarity search over vectors. Synap adds entity linking, temporal awareness, automatic compaction, and a graph layer for relationship queries. Same interface. Different depth.


What is the latency overhead?

  • In-conversation reads come from a cache pre-fetched into your process, at an asserted P75 under 15ms; a cold retrieval targets P95 450ms. Callback ingestion runs in the background and adds no latency to your chain.


Can I use this in production today?

  • Yes. The package implements BaseCallbackHandler, BaseChatMessageHistory, and BaseRetriever. Read failures return empty results. Write failures raise SynapIntegrationError so your agent knows

  persistence missed.


How does pricing work?

  • Usage-based. Storage, retrieval, and compaction are metered separately. No per-seat or per-framework fee. Starter plan is $19/month at launch pricing (list $49), and new accounts get about $10 in free credits. See

  https://synap.maximem.ai/pricing.


From the team at Maximem

Stop rebuilding agent memory from scratch

Maximem Synap is the context management layer we built after hitting every problem in this post ourselves. Persistent recall across sessions, entity resolution and conscious forgetting, in Python, TypeScript and REST.

Related posts