Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
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
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="agno_test", # Prefix for Redis keys to namespace the sessions host="localhost", # Redis host address port=6379, # Redis port number ) # Create agent with Redis storage agent = Agent( storage=storage, tools=[DuckDuckGoTools()], add_history_to_messages=True, ) agent.print_response("How many people live in Canada?") agent.print_response("What is their national anthem called?") # Verify storage contents print("\nVerifying storage contents...") all_sessions = storage.get_all_sessions() print(f"Total sessions in Redis: {len(all_sessions)}") if all_sessions: print("\nSession details:") session = all_sessions[0] print(f"Session ID: {session.session_id}") print(f"Messages count: {len(session.memory['messages'])}")
prefix
str
host
"localhost"
port
int
6379
db
0
password
Optional[str]
None
mode
Optional[Literal["agent", "team", "workflow"]]
"agent"
Was this page helpful?