Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-pandas-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@voltagent/redis": minor
---

feat: add @voltagent/redis memory storage adapter
1 change: 1 addition & 0 deletions docs/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Core packages, AI provider integrations, and utilities:
- **libsql** - LibSQL database integration
- **logger** - Universal logger implementation
- **postgres** - PostgreSQL database integration
- **redis** - Redis memory storage integration
- **sdk** - JavaScript/TypeScript SDK for VoltAgent API
- **server-core** - Core server handlers, schemas, and business logic
- **server-hono** - Hono-based server implementation with API routes
Expand Down
47 changes: 47 additions & 0 deletions packages/redis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# @voltagent/redis

Redis memory storage adapter for [VoltAgent](https://voltagent.dev) agents. Stores conversations, messages, working memory, and workflow state in Redis for low-latency retrieval.

## Installation

```bash
npm install @voltagent/redis
```

## Usage

```ts
import { Agent, Memory } from "@voltagent/core";
import { RedisMemoryAdapter } from "@voltagent/redis";

const memory = new Memory({
storage: new RedisMemoryAdapter({
// Connection string or ioredis options object
connection: process.env.REDIS_URL || "redis://localhost:6379",
// Optional: prefix for all Redis keys (default: "voltagent")
keyPrefix: "voltagent",
}),
});

const agent = new Agent({
name: "Assistant",
model: "openai/gpt-4o-mini",
memory,
});
```

## Options

| Option | Type | Description |
| ------------ | ------------------ | -------------------------------------------------- |
| `connection` | `string \| object` | Redis connection string or ioredis options object |
| `keyPrefix` | `string` | Prefix for all Redis keys (default: `"voltagent"`) |
| `debug` | `boolean` | Enable debug logging (default: `false`) |

## Persistence

Redis is an in-memory store. If you need durability, configure RDB snapshots and/or AOF on your Redis instance, or use a managed Redis provider. See the [documentation](https://voltagent.dev/docs/agents/memory/redis/) for data modeling details and persistence guidance.

## License

MIT
55 changes: 55 additions & 0 deletions packages/redis/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@voltagent/redis",
"description": "VoltAgent Redis - Redis Memory provider integration for VoltAgent",
"version": "0.1.0",
"dependencies": {
"@voltagent/internal": "^1.0.2",
"ioredis": "^5.6.1"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.2.4",
"@voltagent/core": "^2.4.4",
"ai": "^6.0.0"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"files": [
"dist"
],
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"peerDependencies": {
"@voltagent/core": "^2.0.0",
"ai": "^6.0.0"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/VoltAgent/voltagent.git",
"directory": "packages/redis"
},
"scripts": {
"attw": "attw --pack",
"build": "tsup",
"dev": "tsup --watch",
"lint": "biome check .",
"lint:fix": "biome check . --write",
"publint": "publint --strict",
"test": "vitest",
"test:coverage": "vitest run --coverage"
},
"types": "dist/index.d.ts"
}
10 changes: 10 additions & 0 deletions packages/redis/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Redis Storage Adapter for VoltAgent
*
* Provides low-latency storage for conversations and messages
* using Redis with Memory V2 architecture
*/

// Export Memory Adapter
export { RedisMemoryAdapter } from "./memory-adapter";
export type { RedisMemoryOptions } from "./memory-adapter";
Loading