Redis-based storage adapter for distributed caching.Documentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
Constructor
RedisStorageConfig
| Option | Type | Default | Description |
|---|---|---|---|
client | RedisClient | required | Redis client instance |
namespace | string | 'default' | Namespace for isolation |
ttl | number | 86400 | TTL in seconds (24 hours) |
keyPrefix | string | 'vectoriadb' | Redis key prefix |
RedisClient Interface
Example
Key Structure
Redis key format:{keyPrefix}:{namespace}
Example: vectoriadb:my-index
Methods
| Method | Description |
|---|---|
initialize() | Test Redis connection |
load() | Load embeddings from Redis |
save(data) | Save embeddings with TTL |
hasValidCache(metadata) | Check if valid cache exists |
clear() | Delete Redis key |
close() | No-op (client lifecycle is external) |
Security
The adapter includes command injection protection:- Namespace is sanitized to remove control characters
- Key prefix is sanitized similarly
Related
FileStorageAdapter
File storage
MemoryStorageAdapter
Memory storage
Storage Guide
Redis adapter guide