Prerequisites
The following example requires thebeautifulsoup4 library.
Example
The following agent will read the contents of a website.cookbook/91_tools/website_tools.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
WebsiteTools exposes a read_url function to read a website’s contents, or an add_website_to_knowledge function when a Knowledge instance is passed in.
beautifulsoup4 library.
uv pip install -U beautifulsoup4 openai
from agno.agent import Agent
from agno.tools.website import WebsiteTools
agent = Agent(tools=[WebsiteTools()])
agent.print_response("Search web page: 'https://docs.agno.com/introduction'", markdown=True)
| Parameter | Type | Default | Description |
|---|---|---|---|
knowledge | Optional[Knowledge] | None | The knowledge base to add website contents to. When provided, add_website_to_knowledge is registered instead of read_url. |
| Function | Description |
|---|---|
add_website_to_knowledge | Adds a website’s content to the knowledge base. Registered only when knowledge is provided. The website must start with https:// and be a valid website. |
read_url | Reads a URL and returns the contents. Registered when no knowledge is provided. |
Was this page helpful?