Code

cookbook/tools/reddit_tools.py
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")

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2

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
3

Install libraries

pip install -U praw openai agno
4

Run Agent

python cookbook/tools/reddit_tools.py