Documentation Index
Fetch the complete documentation index at: https://docs-v1.agno.com/llms.txt
Use this file to discover all available pages before exploring further.
Agno supports using Redis as a storage backend for Teams using the RedisStorage class.
Usage
Run Redis
Install docker desktop and run Redis on port 6379 using:
docker run --name my-redis -p 6379:6379 -d redis
redis_storage_for_team.py
"""
Run: `pip install openai duckduckgo-search newspaper4k lxml_html_clean agno redis` to install the dependencies
"""
from typing import List
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.storage.redis import RedisStorage
from agno.team import Team
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.hackernews import HackerNewsTools
from pydantic import BaseModel
# 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,
)
class Article(BaseModel):
title: str
summary: str
reference_links: List[str]
hn_researcher = Agent(
name="HackerNews Researcher",
model=OpenAIChat("gpt-4o"),
role="Gets top stories from hackernews.",
tools=[HackerNewsTools()],
)
web_searcher = Agent(
name="Web Searcher",
model=OpenAIChat("gpt-4o"),
role="Searches the web for information on a topic",
tools=[DuckDuckGoTools()],
add_datetime_to_instructions=True,
)
hn_team = Team(
name="HackerNews Team",
mode="coordinate",
model=OpenAIChat("gpt-4o"),
members=[hn_researcher, web_searcher],
storage=storage,
instructions=[
"First, search hackernews for what the user is asking about.",
"Then, ask the web searcher to search for each story to get more information.",
"Finally, provide a thoughtful and engaging summary.",
],
response_model=Article,
show_tool_calls=True,
markdown=True,
debug_mode=True,
show_members_responses=True,
)
hn_team.print_response("Write an article about the top 2 stories on hackernews")
Params
| 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" |
Developer Resources