-
Notifications
You must be signed in to change notification settings - Fork 304
Open
Labels
Milestone
Description
Summary
Add Redis as a storage backend for the Response API to enable fast, distributed conversation storage.
Background
PR #802 introduced Response API support with a pluggable storage interface. Currently, only the in-memory store is implemented. Redis would provide:
- Persistence: Survive router restarts with RDB/AOF
- Distribution: Share state across multiple router instances
- Native TTL: Built-in expiration for conversation cleanup
- High performance: Sub-millisecond read/write latency
Implementation Tasks
- Implement
RedisStoreinpkg/responsestore/redis_store.go - Design Redis key schema for responses and conversations
- Implement CRUD operations with Redis commands
- Add connection pooling and cluster support
- Leverage Redis TTL for automatic expiration
- Add configuration options in
RedisStoreConfig - Add unit tests for Redis store
- Add integration tests with Redis
- Update documentation
Configuration Example
response_api:
enabled: true
store_backend: "redis"
ttl_seconds: 86400
redis:
address: "localhost:6379"
password: ""
db: 0
key_prefix: "sr:response:"Key Schema Design
sr:response:{response_id} -> JSON blob of StoredResponse
sr:conversation:{conv_id} -> JSON blob of StoredConversation
sr:chain:{response_id} -> List of response IDs in chain
Related
- Parent PR: [Feat][Memory] Add OpenAI Response API support #802
- Interface defined in:
pkg/responsestore/interface.go
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog