Skip to main content
Web capabilities let agents search the internet and fetch page content to answer questions with up-to-date information.

Quick Start

1

Enable Web

from praisonaiagents import Agent

agent = Agent(
    name="Web Agent",
    instructions="You search the web for information",
    web=True  # Enable web search and fetch
)

agent.start("What are the latest AI news today?")
2

With Configuration

from praisonaiagents import Agent, WebConfig

agent = Agent(
    name="Research Agent",
    instructions="You do thorough web research",
    web=WebConfig(
        search=True,                    # Enable search
        fetch=True,                     # Enable page fetch
        search_provider="duckduckgo",   # Search provider
        max_results=10,                 # Results per search
    )
)

Web Features

Find relevant pages for a query:
agent = Agent(
    instructions="You answer questions using web search",
    web=WebConfig(search=True)
)

agent.start("What is the current price of Bitcoin?")

Page Fetch

Retrieve full content from URLs:
agent = Agent(
    instructions="You analyze web pages",
    web=WebConfig(fetch=True)
)

agent.start("Summarize the content at https://example.com/article")

Configuration Options

from praisonaiagents import WebConfig

config = WebConfig(
    search=True,                    # Enable web search
    fetch=True,                     # Enable page fetch
    search_provider="duckduckgo",   # Search provider
    max_results=5,                  # Max results per search
    search_config={},               # Provider-specific config
    fetch_config={},                # Fetch-specific config
)
OptionTypeDefaultDescription
searchboolTrueEnable web search
fetchboolTrueEnable page fetch
search_providerstr"duckduckgo"Search provider
max_resultsint5Results per search
search_configdict{}Provider config
fetch_configdict{}Fetch config

Search Providers

ProviderAPI KeyBest For
duckduckgo❌ Not neededGeneral use, free
google✅ RequiredComprehensive results
tavily✅ RequiredAI-optimized search
serper✅ RequiredGoogle results API
bing✅ RequiredMicrosoft ecosystem

Using Different Providers

# DuckDuckGo (default, free)
agent = Agent(
    web=WebConfig(search_provider="duckduckgo")
)

# Tavily (AI-optimized)
agent = Agent(
    web=WebConfig(
        search_provider="tavily",
        search_config={"api_key": "your-key"}
    )
)

# Google
agent = Agent(
    web=WebConfig(
        search_provider="google",
        search_config={
            "api_key": "your-key",
            "cx": "your-search-engine-id"
        }
    )
)

How It Works


Use Cases

Research

Find and synthesize information from multiple sources

News

Get current events and latest updates

Fact-Checking

Verify claims with web sources

Monitoring

Track topics and get updates

Combining with Knowledge

Web search complements local knowledge:
agent = Agent(
    instructions="You answer using docs and web",
    knowledge=["docs/"],  # Local documents
    web=True,             # Web search fallback
)

# Agent checks local docs first, then searches web

Best Practices

Free and requires no API key - good for basic search needs.
Tavily is optimized for AI agents with better structured results.
Lower max_results for faster responses when you don’t need many sources.
Use local knowledge for domain-specific info, web for current events.