@mnemosyne-eurydice/langchain
v0.1.4
Published
LangChain.js BaseChatMemory implementation backed by Mnemosyne. Persistent, searchable, container-scoped chat history with hybrid BM25+vector recall. Replaces LangChain's in-process BufferMemory and ZepMemory. Per-conversation thread tracking, automatic r
Downloads
570
Maintainers
Readme
mnemosyne-langchain
Orpheus lost Eurydice because he looked back. Mnemosyne, titaness of memory, is the one who kept her name. This package family is the instrument of that preservation: adapters, SDKs, and runtimes that let AI agents store, recall, and forget without ever looking at the wrong thing at the wrong time.
LangChain.js BaseChatMemory implementation backed by Mnemosyne. Persistent, container-scoped chat history with hybrid BM25+vector recall. Per-session thread tracking, automatic redaction, TTL support, drop-in replacement for BufferMemory and ZepMemory.
Install
npm install @mnemosyne-eurydice/langchain @langchain/coreQuick start
import { MnemosyneChatHistory, MnemosyneRetriever } from "@mnemosyne-eurydice/langchain";
const history = new MnemosyneChatHistory({
sessionId: "alice-1",
containerTag: "alice",
apiKey: process.env.MNEMOSYNE_API_KEY,
});
await history.addMessage({ type: "human", data: { content: "Hello!", role: "user" } });
await history.addMessage({ type: "ai", data: { content: "Hi there!", role: "assistant" } });
const messages = await history.getMessages();
console.log(messages);
const retriever = new MnemosyneRetriever({ containerTag: "alice", k: 5 });
const docs = await retriever.getRelevantDocuments("what did we discuss?");
for (const d of docs) console.log(d.pageContent);Security
@langchain/core is an optional peer dependency. To stay clear of GHSA-r399-636x-v7f6 (deserialization-injection in @langchain/core 0.2.x), install @langchain/core at >=0.3.80. The 0.3.80 line ships the upstream fix and is API-compatible with 0.2.x.
npm install @langchain/core@^0.3.80License
MIT © Geass Labs
