Skip to main content
In this example, we will equip our agent with the DuckDuckGoTools toolkit. Our agent will now be able to use these tools to search the web for information:
1

Create a Python file

touch tools.py
2

Add the following code to your Python file

tools.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(
    model=OpenAIChat(id="gpt-5-mini"),
    tools=[DuckDuckGoTools()],
    markdown=True,
)

agent.print_response("What are the latest news in AI?")

3

Create a virtual environment

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

Install libraries

pip install -U agno openai ddgs
5

Export your OpenAI API key

  export OPENAI_API_KEY="your_openai_api_key_here"
6

Run Agent

python tools.py