How to Use the Web Search Tool in Agent Studio for Real-Time Responses

What Is the Web Search Tool in Agent Studio?

The Web Search Tool is a feature available within the AI Agent Node that enables your AI agent to fetch real-time information from the internet. It allows the agent to supplement its internal knowledge sources—such as a Knowledge Base—with external, up-to-date data, making it ideal for responding to queries that require current or publicly available information.

When to Use the Web Search Tool

Use this tool when your agent needs to answer questions that fall outside the scope of your Knowledge Base or require real-time data. Common use cases include queries about current events, market trends, product details, or any information that changes frequently and isn’t stored internally.

How the Web Search Tool Works

When a user submits a query, the agent interprets the request, formulates a search query, and uses the Web Search Tool to retrieve relevant results from the internet. The agent then synthesizes this information to generate a timely and accurate response.

Key Benefits of the Web Search Tool

  • Provides access to real-time web information
  • Expands the agent’s knowledge beyond internal data sources
  • Enables handling of dynamic or unfamiliar queries
  • Reduces reliance on preconfigured Knowledge Bases

Core Elements of the Web Search Tool

Query

The query defines what the agent searches for when the tool is triggered. It should typically be dynamic, based on user input, to ensure relevance. Hardcoded queries are less flexible and may return inconsistent results.

Instructions

Instructions guide the agent on when and how to use the Web Search Tool. For example, you might instruct the agent to use web search only when internal data is unavailable or when real-time information is explicitly needed. Clear instructions help maintain response quality and prevent unnecessary searches.

Variables

Variables allow the query to adapt based on user input during conversations. By using runtime variables—such as the user’s original question—you ensure the search is context-aware and responsive. Without variables, the tool would perform the same search repeatedly, limiting its usefulness.

To maximize effectiveness, configure the query using runtime variables. When a user asks a question, their input is stored as a variable, which is then used as the search query. This dynamic approach ensures the agent retrieves results tailored to each user’s specific request.

Example: If a user asks, “Find Nike running shoes,” the agent captures this input as a variable and uses it to perform a web search, returning relevant, real-time results.

How to Configure the Web Search Tool

Step 1: Add the Tool

Open the AI Agent Node, click Add a Tool, and select Search the Web from the list of available tools.

Step 2: Configure the Tool

Add Instructions: Define clear instructions for when the agent should use the tool. For instance, you might specify that it should only search the web if the Knowledge Base doesn’t contain the answer.

Define Query: Specify the search query. Use the variable picker (shown as {}) to insert runtime variables, making the query dynamic and user-driven.

Use Variables: Incorporate variables to ensure the search adapts to each user’s input, enhancing responsiveness and accuracy.