Web

Browse and interact with websites

Agents can browse the web – search, read pages, and extract information.

Diagram

Web Browsing

👤 User

🤖 Agent

🌐 Web

📝 Content

Quick Start

  1. Simple Usage
    typescript
    import { Agent } from 'praisonai';
    
    const agent = new Agent({
      instructions: 'You research topics online',
      tools: ['web_search']
    });
    
    await agent.chat('What are the latest AI developments?');
    // Agent searches and summarizes findings
  2. With Configuration
    typescript
    const agent = new Agent({
      tools: ['web_search', 'read_url']
    });
    
    await agent.chat('Summarize the article at example.com/news');
    // Agent reads and summarizes the page

User Interaction Flow

Diagram
WebAgentUserWebAgentUser“Research AI trends”Search querySearch resultsRead top articlesPage contentSummary of findings

Configuration Levels

typescript
// Level 1: Array - Enable web tools
const agent = new Agent({
  tools: ['web_search']
});

// Level 2: String - Specify provider
const agent = new Agent({
  tools: ['web_search'],
  searchProvider: 'google'  // or 'bing', 'duckduckgo'
});

// Level 3: Dict - Full options
const agent = new Agent({
  web: {
    search: true,
    browse: true,
    maxResults: 10,
    timeout: 30000,
    allowedDomains: ['*.wikipedia.org', '*.github.com']
  }
});

Web Tools

ToolDescription
web_searchSearch the internet
read_urlRead a specific webpage
browseNavigate and interact
screenshotCapture page images

API Reference

WebConfig

Web configuration options


Best Practices

Limit search results

10 results is usually enough – more adds noise.

Set timeouts

Slow pages shouldn’t block the agent forever.

Filter domains

Restrict to trusted domains when possible.


Related