Web search

Real-time information retrieval from web sources.

The web search tool gives agents access to real-time web information, including current events, recent developments, and external references.

Create a web search tool

from seekrai import SeekrFlow
from seekrai.types import CreateWebSearch

client = SeekrFlow()

web_search_tool = client.tools.create(
    CreateWebSearch(
        name="my_web_search",
        description="Search the web for current information, news, recent developments, and real-time data."
    )
)
print(f"Tool created: {web_search_tool.id}")

Parameters

ParameterRequiredDescription
nameYesA unique name for the tool.
descriptionYesDescription that helps the agent understand when to use this tool.

Link to an agent

from seekrai.types import CreateAgentRequest

agent = client.agents.create(
    CreateAgentRequest(
        name="WebSearchBot",
        instructions="You are an expert assistant with access to real-time web information. Use the web search tool for current events, recent developments, or information not in your training data.",
        model_id="meta-llama/Llama-3.3-70B-Instruct",
        tool_ids=[web_search_tool.id]
    )
)
print(f"Agent ID: {agent.id}")
print(f"Agent status: {agent.status}")

Best practices

Tool description

A good description clearly states when the tool should be used, what type of content it should retrieve, and what scenarios it should avoid.

Effective description:

"Use this tool to search for real-time product pricing and availability on external e-commerce websites. Only invoke this tool when the user explicitly asks for current prices, stock information, or product comparisons that are not already covered in internal documents. Avoid using this tool for general product information, technical specifications, or reviews — use the file search tool instead if available."

Ineffective description:

"Use this when the user asks a question that you think would benefit from web search."