Web Tools

Give your agents access to the internet. Search the web, fetch a webpage, or crawl an entire website. One tool handles everything — just pass a search query or a URL.

Three options

web_tools

DuckDuckGo — free, no API key needed. Works out of the box.

google_search

Google Custom Search API — requires GOOGLE_API_KEY and GOOGLE_SEARCH_ENGINE_ID in .env.

bing_search

Bing Search API — requires BING_API_KEY in .env.

Web search (free)

No API key needed. Uses DuckDuckGo under the hood.

search.py
from veska import Agent

agent = Agent(
    name="researcher",
    system_prompt="You research topics using the web. Use the web_search tool.",
    model="claude-sonnet-4-6",
    tools=["web_tools"],
)

result = agent.run("What are the latest trends in AI agents?")
print(result.output)

Fetch a page

Pass a URL instead of a search query. The agent fetches the page and reads the content.

fetch.py
agent = Agent(
    name="reader",
    system_prompt="You read webpages and summarize them. Use the web_search tool with the URL.",
    model="claude-sonnet-4-6",
    tools=["web_tools"],
)

result = agent.run("Read https://veska.in and tell me what this framework does")
print(result.output)

Crawl an entire website

The agent can crawl a website by following internal links. It reads each page and brings back the content. Limited to 10 pages by default.

crawl.py
agent = Agent(
    name="analyst",
    system_prompt="""You analyze websites thoroughly.
Use the web_search tool with crawl=true to read all pages on a site.
Then give a detailed report.""",
    model="claude-sonnet-4-6",
    tools=["web_tools"],
)

result = agent.run("Crawl https://veska.in and give me a full report on the framework")
print(result.output)

Google Search

Use Google instead of DuckDuckGo. Add your API keys to .env:

.env
GOOGLE_API_KEY=your-google-api-key
GOOGLE_SEARCH_ENGINE_ID=your-search-engine-id
google.py
from veska import Agent

agent = Agent(
    name="researcher",
    system_prompt="You research topics using Google. Use the google_search tool.",
    model="claude-sonnet-4-6",
    tools=["google_search"],
)

result = agent.run("Best Python frameworks for AI agents 2025")
print(result.output)

Bing Search

Use Bing instead. Add your API key to .env:

.env
BING_API_KEY=your-bing-api-key
bing.py
from veska import Agent

agent = Agent(
    name="researcher",
    system_prompt="You research topics using Bing. Use the bing_search tool.",
    model="claude-sonnet-4-6",
    tools=["bing_search"],
)

result = agent.run("Compare AI agent frameworks")
print(result.output)

Tool parameters

All three tools accept the same parameters:

python
web_search(
    query: str,        # Search query or URL
    crawl: bool,       # If true + URL, crawl the entire site (default: false)
    max_pages: int,    # Max pages to crawl (default: 10)
)

How it works

Search query

Searches the web and returns top 5 results with title, URL, and snippet.

URL

Fetches the page, strips scripts/nav/footer, and returns clean readable text.

URL + crawl=true

Starts at the URL, follows all internal links on the same domain, fetches each page (up to max_pages), and returns all content.