from agno.agent import Agent
from agno.tools.reddit import RedditTools
agent = Agent(
instructions=[
"You are a Reddit content analyst that helps explore and understand Reddit data",
"Browse subreddits, analyze posts, and provide insights about discussions",
"Respect Reddit's community guidelines and rate limits",
],
tools=[RedditTools()],
markdown=True,
)
agent.print_response("Show me the top posts from r/technology today")
Create a virtual environment
Terminal
and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set your credentials
export REDDIT_CLIENT_ID=your-reddit-client-id
export REDDIT_CLIENT_SECRET=your-reddit-client-secret
export REDDIT_USER_AGENT=YourApp/1.0
export OPENAI_API_KEY=xxx
Install libraries
pip install -U praw openai agno
Run Agent
python cookbook/tools/reddit_tools.py