@mnemosyne-eurydice/vercel-ai
v0.2.0
Published
Vercel AI SDK adapter for the Mnemosyne memory substrate. Wraps streamText and generateText with automatic memory injection (retrieval-augmented prompts) and post-response memory extraction. Container-scoped, latency-budgeted, transparent to the caller.
Downloads
557
Maintainers
Readme
mnemosyne-vercel-ai
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.
Vercel AI SDK adapter for the Mnemosyne memory substrate. Wraps streamText and generateText with automatic memory injection (retrieval-augmented system prompts) and post-response memory extraction. Container-scoped, latency-budgeted, transparent to the caller.
Install
npm install @mnemosyne-eurydice/vercel-ai aiQuick start
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
import { MnemosyneVercelAdapter } from "@mnemosyne-eurydice/vercel-ai";
const mn = new MnemosyneVercelAdapter({
apiKey: process.env.MNEMOSYNE_API_KEY,
containerTag: "alice",
});
const { text } = await generateText({
model: openai("gpt-4"),
system: await mn.injectIntoSystemPrompt("what's my favorite editor?", "You are a helpful assistant."),
prompt: "what's my favorite editor?",
});
await mn.saveTurn("what's my favorite editor?", text);Security
ai is an optional peer dependency. The 3.x line of ai is affected by GHSA-rwvc-j5jr-mgvh (filetype whitelist bypass in experimental_generateImage and similar entry points). The fix landed in [email protected]. Install ai at >=5.0.52 to pick up the patched version:
npm install ai@^5.0.52A backport of the 5.0.52 fix to the 3.x line is proposed in upstream PR https://github.com/vercel/ai/pull/16154; track that PR if you need a 3.x patch before migrating to 5.x.
License
MIT © Geass Labs
