agentskit.js
Memory

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.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page