> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Web

> Browse and interact with websites

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

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Web Browsing"
        A[👤 User] --> B[🤖 Agent]
        B --> C[🌐 Web]
        C --> D[📝 Content]
    end

    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

    class B agent
    class A,C,D tool
```

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    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
    ```
  </Step>

  <Step title="With Configuration">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    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
    ```
  </Step>
</Steps>

***

## User Interaction Flow

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Agent
    participant Web
    
    User->>Agent: "Research AI trends"
    Agent->>Web: Search query
    Web-->>Agent: Search results
    Agent->>Web: Read top articles
    Web-->>Agent: Page content
    Agent-->>User: Summary of findings
```

***

## Configuration Levels

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
// 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

| Tool         | Description             |
| ------------ | ----------------------- |
| `web_search` | Search the internet     |
| `read_url`   | Read a specific webpage |
| `browse`     | Navigate and interact   |
| `screenshot` | Capture page images     |

***

## API Reference

<Card title="WebConfig" icon="code" href="/docs/sdk/reference/typescript/classes/WebConfig">
  Web configuration options
</Card>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Limit search results">
    10 results is usually enough - more adds noise.
  </Accordion>

  <Accordion title="Set timeouts">
    Slow pages shouldn't block the agent forever.
  </Accordion>

  <Accordion title="Filter domains">
    Restrict to trusted domains when possible.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="Tools" icon="wrench" href="/docs/js/tools">
    Agent tools
  </Card>

  <Card title="Knowledge" icon="brain" href="/docs/js/knowledge-base">
    Knowledge base
  </Card>
</CardGroup>
