@voltagent/voltagent-memory
v1.0.5
Published
VoltAgent managed memory adapter backed by VoltOps
Readme
@voltagent/voltagent-memory
VoltAgent's managed memory adapter, backed by the VoltOps API. ManagedMemoryAdapter stores conversations, messages, working memory, and workflow state without you having to provision or operate a database, and ManagedMemoryVectorAdapter provides managed vector storage for RAG/retriever use cases.
Install
npm install @voltagent/voltagent-memory
# or
yarn add @voltagent/voltagent-memory
# or
pnpm add @voltagent/voltagent-memorySetup
Managed memory requires a VoltOps project. Set your keys as environment variables, or pass a voltOpsClient explicitly:
VOLTAGENT_PUBLIC_KEY=...
VOLTAGENT_SECRET_KEY=...Usage
import { Agent, Memory } from "@voltagent/core";
import { ManagedMemoryAdapter } from "@voltagent/voltagent-memory";
import { openai } from "@ai-sdk/openai";
const memory = new Memory({
storage: new ManagedMemoryAdapter({
databaseName: "my-database",
// or: databaseId: "db_123"
}),
});
const agent = new Agent({
name: "my-agent",
instructions: "A helpful assistant",
model: openai("gpt-4o-mini"),
memory,
});Managed Memory Options
| Option | Type | Default | Description |
| --------------- | --------------- | ------- | --------------------------------------------------------------------- |
| databaseId | string | — | Select a managed database by ID |
| databaseName | string | — | Select a managed database by name (used if databaseId is not set) |
| voltOpsClient | VoltOpsClient | — | Explicit VoltOps client; falls back to the globally registered client |
| debug | boolean | false | Enable debug logging |
Both databaseId and databaseName are optional individually, but at least one must be provided. If neither is given, initialize() throws an error because findTargetDatabase() cannot locate a target database and returns undefined.
Vector Adapter
import { ManagedMemoryVectorAdapter } from "@voltagent/voltagent-memory";
const vectorStore = new ManagedMemoryVectorAdapter({
databaseName: "my-database",
});ManagedMemoryVectorAdapter accepts the same options as ManagedMemoryAdapter above.
Documentation
License
Licensed under the MIT License, Copyright © 2026-present VoltAgent.
