Skip to main content

Code

cookbook/tools/parallel_tools.py
from agno.agent import Agent
from agno.tools.parallel import ParallelTools

agent = Agent(
    tools=[
        ParallelTools(
            enable_search=True,
            enable_extract=True,
            max_results=5,
            max_chars_per_result=8000,
        )
    ],
    markdown=True,
)

# Should use parallel_search
agent.print_response(
    "Search for the latest information on 'AI agents and autonomous systems' and summarize the key findings"
)

# Should use parallel_extract
agent.print_response(
    "Extract information about the product features from https://parallel.ai and https://docs.parallel.ai"
)

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 API key

export PARALLEL_API_KEY=xxx
export OPENAI_API_KEY=xxx
3

Install libraries

pip install -U parallel-web openai agno
4

Run Agent

python cookbook/tools/parallel_tools.py