Websearch
Websearch tool
Enable your AI agent to retrieve real-time information from the internet during execution — accessing up-to-date external data instead of relying solely on pre-trained knowledge.
What is the Web Search tool?
The Web Search tool is an agent tool that enables an AI agent to retrieve real-time information from the internet during execution. Agents can access current external data such as news, market trends, company information, and technical updates instead of relying solely on pre-trained knowledge.
The tool performs the search, retrieves relevant results, and the LLM processes them to extract useful information. The output is returned as a ToolMessage, and the agent continues execution using the retrieved data.
Key capabilities
Real-time retrieval
News, market trends, company profiles, and technical updates
Structured output
Source links, citations, and extracted content
Full observability
All activity visible in logs — query, sources, results
Prerequisites
What you'll need before using the Web Search tool.
Configuration
When adding the Web Search tool to an agent, three fields must be configured. Each one shapes how the agent identifies, invokes, and uses the tool during execution.
Note
All three fields are required. The Instructions field in particular has the most direct impact on output quality — always provide clear, specific guidance on how the tool should behave.
When to use
Use the Web Search tool when your agent needs dynamic or external data that goes beyond its pre-trained knowledge.
Good fits
Not the right tool
Step-by-step guide
Activity logs
The activity logs provide full visibility into every Web Search tool execution. Each log entry includes:
Example use cases
Common scenarios where the Web Search tool adds real value inside an AI Agent workflow.
Example instruction
A ready-to-use instruction you can paste into the Instructions field when configuring the Web Search tool for a Company Research use case. Adapt it for your own needs.
Things to know
Best practices and limitations to keep in mind when using the Web Search tool.
Best practices
Limitations
Model selection matters
The quality and accuracy of web search results are directly influenced by the model processing them. Always use a supported model — GPT-4o or Claude 3 and above — for the best results.
Get started
Ready to build smarter agents?
Add Web Search to your agent and give it access to real-time, source-backed information.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article