agentskit.js
Data layerMemory

redisChatMemory

Redis-backed chat memory for multi-instance + serverless.

import { redisChatMemory } from '@agentskit/memory'
import { createClient } from 'redis'

const client = createClient({ url: process.env.REDIS_URL })
await client.connect()

const memory = redisChatMemory({ client, keyPrefix: 'ak:chat:' })

Options

OptionTypeDefault
clientRedisClientAdapterrequired
keyPrefixstringak:chat:
ttlSecondsnumberunset

Storage layout

Each session = one Redis list. Messages pushed as JSON strings. Optional TTL per key.

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page