Skip to content

← All guides

Archive memory guide

This integration guide is preserved for existing users. Memory is now a supporting primitive under Novyx change control, not the main product path.

How to Add Persistent Memory to LangChain Agents

LangChain agents are powerful, but they forget everything between sessions. Here's how to give them persistent, searchable memory in one line of code.

The Problem

Out of the box, LangChain's ConversationBufferMemory lives in process memory. That means:

  • Memory is lost every time the process restarts
  • Users have to repeat context in every new session
  • No way to search past conversations semantically
  • No audit trail or rollback if the agent learns something wrong

The Solution: Novyx

novyx-langchain is a drop-in replacement for LangChain's memory classes. Swap one import, and your agent gets persistent memory that survives restarts, supports semantic search, and includes a full audit trail.

Quick Start

Install the integration package:

bash
pip install novyx-langchain

Add persistent memory to your chain:

python
from novyx_langchain import NovyxMemory
from langchain.chains import ConversationChain
from langchain_openai import ChatOpenAI

# One line to add persistent memory
memory = NovyxMemory(api_key="YOUR_API_KEY", session_id="user-123")

chain = ConversationChain(llm=ChatOpenAI(), memory=memory)

# Your agent now remembers across sessions
response = chain.invoke({"input": "I prefer dark mode"})

# Next session — agent still knows
response = chain.invoke({"input": "What are my preferences?"})
      # "You prefer dark mode"

What You Get

Persistent Memory

Conversation history survives process restarts, deploys, and server crashes. Pick up right where you left off.

Semantic Search

Recall relevant memories by meaning, not just keywords. Your agent finds what matters.

Point-in-Time Rollback

Made a mistake? Roll back memory to any previous state. Undo bad learning instantly.

Audit Trail

Every memory write is cryptographically signed (SHA-256 + RSA). Full traceability for compliance.

How It Works

1

Install & configure

Install novyx-langchain and pass your API key. No infrastructure to manage.

2

Replace the memory class

Swap ConversationBufferMemory for NovyxMemory. The rest of your LangChain code stays the same.

3

Memories sync automatically

Every conversation turn is stored, indexed, and made searchable. Query history from any session.

Frequently Asked Questions

How do I add persistent memory to a LangChain agent?

Install novyx-langchain with pip, then replace ConversationBufferMemory with NovyxMemory. Your agent's memory persists across sessions, survives restarts, and supports semantic search and rollback.

Does LangChain have built-in persistent memory?

No. LangChain's default memory backends (ConversationBufferMemory, ConversationSummaryMemory) live in process memory and are lost on restart. Novyx provides persistent, searchable memory as a drop-in replacement.

Can I use Novyx with LangGraph?

Yes. novyx-langchain includes a LangGraph checkpointer for stateful workflow persistence. Your graph state survives process restarts and can be rolled back to any checkpoint.

Is Novyx memory searchable in LangChain?

Yes. NovyxMemory uses semantic vector search — your agent can recall relevant past context by meaning, not just keyword matching. Results include relevance scores.

See all framework integrations on the Integrations page, or read the full Python SDK docs.

Next protected action

Name the production action your agents cannot perform yet

Start with a 25-minute readiness call for one blocked workflow.

Book a readiness call

Name the production action your coding agents are not allowed to perform yet.

Email us at:

sales@novyxlabs.com

Include the agent tool, blocked production action, decision deadline, and the budget owner who should join. We will reply with fit and scheduling options for a 25-minute call.