RedisStorage class.
Usage
Run Redis
Install docker desktop and run Redis on port 6379 using:redis_storage_for_agent.py
Params
Developer Resources
- View Cookbook
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
RedisStorage class.
docker run --name my-redis -p 6379:6379 -d redis
from agno.agent import Agent
from agno.storage.redis import RedisStorage
from agno.tools.duckduckgo import DuckDuckGoTools
# Initialize Redis storage with default local connection
storage = RedisStorage(
# Prefix for Redis keys to namespace the sessions
prefix="agno_test",
# Redis host address
host="localhost",
# Redis port number
port=6379,
)
# Create agent with Redis storage
agent = Agent(
storage=storage,
)
| Parameter | Type | Description | Default |
|---|---|---|---|
prefix | str | Prefix for Redis keys to namespace the sessions | Required |
host | str | Redis host address | "localhost" |
port | int | Redis port number | 6379 |
db | int | Redis database number | 0 |
password | Optional[str] | Redis password if authentication is required | None |
mode | Optional[Literal["agent", "team", "workflow"]] | Storage mode | "agent" |
Was this page helpful?