Website Tools
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.
WebsiteTools enable an Agent to read a website's contents, or to add them to a knowledge base when one is provided.
Prerequisites
The following example requires the beautifulsoup4 library.
uv pip install -U agno beautifulsoup4 openaiExample
The following agent will read the contents of a website.
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)read_url uses WebsiteReader with its default max_depth=3 and max_links=10, so results can include linked pages as well as the starting URL.
For insertion, configure a regular Knowledge instance with an appropriate vector store and embedder. Managed-page Knowledge uses sync_pages and rejects the insert operation used by this toolkit.
Toolkit Params
| 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. |
Toolkit Functions
| Function | Description |
|---|---|
add_website_to_knowledge | Adds a website's content to the knowledge base. Registered only when knowledge is provided. Accepts a valid HTTP or HTTPS URL. |
read_url | Reads a URL and returns the contents. Registered when no knowledge is provided. |