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).

In a virtual environment, install the direct Exa backend and model SDK:

uv pip install -U "agno[exa]" openai
export OPENAI_API_KEY="your-openai-api-key"
export EXA_API_KEY="your-exa-api-key"

Save as web_context.py and run python web_context.py:

web_context.py
import asyncio

from agno.agent import Agent
from agno.context.web import WebContextProvider, ExaBackend
from agno.models.openai import OpenAIResponses

async def main():
    web = WebContextProvider(
        backend=ExaBackend(), model=OpenAIResponses(id="gpt-5.4-mini")
    )
    try:
        await web.asetup()
        agent = Agent(
            model=OpenAIResponses(id="gpt-5.4"),
            tools=web.get_tools(),
            instructions=web.instructions(),
        )
        await agent.aprint_response("What are the latest developments in AI agents?")
    finally:
        await web.aclose()

if __name__ == "__main__":
    asyncio.run(main())

WebContextProvider is read-only. There is no update_web tool.

Installation

Install the optional dependency for the selected backend. The example’s main and sub-agent models also require openai and OPENAI_API_KEY. Backend configuration fragments below replace web inside the same async runner.

BackendInstall command
ExaBackenduv pip install "agno[exa]"
ParallelBackenduv pip install "agno[parallel]"
ExaMCPBackend or ParallelMCPBackenduv pip install "agno[mcp]"

Backends

Search and fetch through Exa’s SDK.

from agno.context.web import WebContextProvider, ExaBackend

web = WebContextProvider(backend=ExaBackend())

Requires EXA_API_KEY environment variable.

Configuration

ParameterTypeDefaultDescription
backendContextBackendrequiredSearch backend (ExaBackend, ExaMCPBackend, ParallelBackend, ParallelMCPBackend).
idstr"web"Tool becomes query_<id>.
modelModelNoneModel for the sub-agent.
modeContextModedefaultSee Mode.

Tools Exposed

ToolDescription
query_webSearch the web, fetch pages, synthesize answers with citations.

Lifecycle

MCP backends (ExaMCPBackend, ParallelMCPBackend) require setup and teardown for the server connection. Reuse the complete runner above with your selected backend. Direct SDK backends have no persistent MCP session; their lifecycle methods are no-ops.

MCP setup is best-effort and logs connection failures. These web backends’ status() and astatus() describe configuration, not live connectivity, so ok=True is not proof of a successful connection. Handle failed tool calls and keep aclose() in finally. The optional EXA_API_KEY/PARALLEL_API_KEY and each MCP backend’s configuration determine its authenticated endpoint and provider limits.

Example queries

QueryWhat 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