Skip to main content
Agno supports using Redis as a database with the RedisDb class.

Usage

Install the redis and openai packages:

Run Redis

Install Docker Desktop and run Redis on port 6379 using:
redis_for_agent.py

Params

ParameterTypeDefaultDescription
idOptional[str]-The ID of the database instance. UUID by default.
redis_clientOptional[Union[Redis, RedisCluster]]-Redis client instance to use. If not provided a new client will be created from db_url. Required for Redis Cluster connections.
db_urlOptional[str]-Redis connection URL (e.g., "redis://localhost:6379/0" or "rediss://user:pass@host:port/db"). Supports single-node Redis only.
db_prefixstr"agno"Prefix for all Redis keys.
expireOptional[int]-TTL for Redis keys in seconds.
session_tableOptional[str]-Name of the table to store sessions.
memory_tableOptional[str]-Name of the table to store memories.
metrics_tableOptional[str]-Name of the table to store metrics.
eval_tableOptional[str]-Name of the table to store evaluation runs.
knowledge_tableOptional[str]-Name of the table to store knowledge documents.
culture_tableOptional[str]-Name of the table to store cultural knowledge.
traces_tableOptional[str]-Name of the table to store traces.
spans_tableOptional[str]-Name of the table to store spans.