> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Web

> Search and fetch content from the web.

Search and fetch content from the web. The provider exposes one tool: `query_web`. You choose the backend (Exa, Parallel, or MCP).

```python theme={null}
from agno.agent import Agent
from agno.context.web import WebContextProvider, ExaBackend

web = WebContextProvider(backend=ExaBackend())

agent = Agent(
    model=...,
    tools=web.get_tools(),
)

await agent.aprint_response("What are the latest developments in AI agents?")
```

> [!NOTE]
>
> WebContextProvider is **read-only**. There is no `update_web` tool.

## Installation

Install the optional dependency for the selected backend.

| Backend | Install command |
| - | - |
| `ExaBackend` | `uv pip install "agno[exa]"` |
| `ParallelBackend` | `uv pip install "agno[parallel]"` |
| `ExaMCPBackend` or `ParallelMCPBackend` | `uv pip install "agno[mcp]"` |

## Backends

**Exa**

Neural search engine. Best for semantic queries.

```python theme={null}
from agno.context.web import WebContextProvider, ExaBackend

web = WebContextProvider(backend=ExaBackend())
```

Requires `EXA_API_KEY` environment variable.

**Exa MCP**

Exa via MCP protocol.

```python theme={null}
from agno.context.web import WebContextProvider, ExaMCPBackend

web = WebContextProvider(backend=ExaMCPBackend())
```

Requires lifecycle setup with `await web.asetup()`.

**Parallel**

Web search and extraction via Parallel's API.

```python theme={null}
from agno.context.web import WebContextProvider, ParallelBackend

web = WebContextProvider(backend=ParallelBackend())
```

Requires `PARALLEL_API_KEY` environment variable.

**Parallel MCP**

Parallel via MCP protocol.

```python theme={null}
from agno.context.web import WebContextProvider, ParallelMCPBackend

web = WebContextProvider(backend=ParallelMCPBackend())
```

Requires lifecycle setup with `await web.asetup()`.

## Configuration

| Parameter | Type | Default | Description |
| - | - | - | - |
| `backend` | `ContextBackend` | required | Search backend (ExaBackend, ExaMCPBackend, ParallelBackend, ParallelMCPBackend). |
| `id` | `str` | `"web"` | Tool becomes `query_<id>`. |
| `model` | `Model` | `None` | Model for the sub-agent. |
| `mode` | `ContextMode` | `default` | See [Mode](https://agno-v2.mintlify.site/context-providers/overview.md#mode). |

## Tools Exposed

| Tool | Description |
| - | - |
| `query_web` | Search the web, fetch pages, synthesize answers with citations. |

## Lifecycle

MCP backends (`ExaMCPBackend`, `ParallelMCPBackend`) require setup and teardown for the server connection. The SDK backends need neither:

```python theme={null}
web = WebContextProvider(backend=ExaMCPBackend())

await web.asetup()
try:
    agent = Agent(model=..., tools=web.get_tools())
    await agent.arun("Search for...")
finally:
    await web.aclose()
```

## Example queries

| Query | What happens |
| - | - |
| "What is the current state of WebGPU support?" | Searches, fetches recent articles, synthesizes |
| "Find documentation on Python 3.12 new features" | Searches docs, returns summary with links |
| "Research competitors to Stripe Atlas" | Multi-source search and synthesis |

## Resources

> **[Exa Tools Reference](https://agno-v2.mintlify.site/tools/toolkits/search/exa.md)**
>
> ExaTools methods

> **[Cookbook Example](https://github.com/agno-agi/agno/blob/main/cookbook/12_context/01_web_exa.py)**
>
> Working example


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.