Documentation Index
Fetch the complete documentation index at: https://agno-v2-shaloo-ai-support-link.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
WebSearchTools is a versatile toolkit that enables an Agent to search the web using multiple search backends. It uses the DDGS meta-search library which supports backends like Google, Bing, DuckDuckGo, Brave, Yandex, Yahoo, and more.
This is the recommended toolkit for general web search functionality. For DuckDuckGo-specific usage, see DuckDuckGoTools.
Prerequisites
The following example requires the ddgs library. To install it, run the following command:
Example
from agno.agent import Agent
from agno.tools.websearch import WebSearchTools
# Basic usage with auto backend selection
agent = Agent(tools=[WebSearchTools()])
agent.print_response("What's happening in France?", markdown=True)
# Use a specific backend (e.g., google, bing, brave, yandex)
agent_google = Agent(
tools=[WebSearchTools(backend="google")]
)
agent_google.print_response("Latest AI news", markdown=True)
| Parameter | Type | Default | Description |
|---|
enable_search | bool | True | Enable web search function. |
enable_news | bool | True | Enable news search function. |
backend | str | "auto" | The backend to use for searching. Options: "auto", "duckduckgo", "google", "bing", "brave", "yandex", "yahoo", etc. |
modifier | Optional[str] | None | A modifier to be prepended to search queries. |
fixed_max_results | Optional[int] | None | A fixed number of maximum results. |
proxy | Optional[str] | None | Proxy to be used for requests. |
timeout | Optional[int] | 10 | The maximum number of seconds to wait for a response. |
verify_ssl | bool | True | Whether to verify SSL certificates. |
| Function | Description |
|---|
web_search | Search the web for a query. Parameters include query (str) for the search query and max_results (int, default=5) for maximum results. Returns JSON formatted search results. |
search_news | Get the latest news from the web. Parameters include query (str) for the search query and max_results (int, default=5) for maximum results. Returns JSON formatted news results. |
Supported Backends
The backend parameter supports the following options:
| Backend | Description |
|---|
auto | Automatically selects an available backend |
duckduckgo | DuckDuckGo search engine |
google | Google search engine |
bing | Microsoft Bing search engine |
brave | Brave Search |
yandex | Yandex search engine |
yahoo | Yahoo search engine |
Developer Resources