Introducing web search with Amazon Bedrock AgentCore

Machine Learning


AI agents are changing the way organizations find and act on information, but they have one structural limitation. That means the AI ​​agent’s knowledge is frozen during training. If you ask an agent that relies only on training data about today’s stock price, sports scores, or the release that shipped an hour ago, they won’t be able to respond.

web search Amazon Bedrock AgentCore, now generally available, addresses that gap. This fully managed Model Context Protocol (MCP) compatible web search feature allows agents to retrieve information from the web without any infrastructure overhead. It is available as a managed target or connector to the AgentCore gateway. agent detects it by default tools/list Start it by calling it like any other MCP tool. There are no search APIs to provision, no sending credentials to manage, and no results parsing glue to maintain.

Behind this single connector is a dedicated web index spanning tens of billions of documents managed by Amazon. Amazon continually updates its index to reflect new content within minutes. The privacy model ensures that your queries never leave AWS. Search can combine knowledge graph extraction with semantic snippet extraction tailored to the model context.

In this post, we explain what makes Amazon Bedrock AgentCore web search different, why it matters, and how to connect web search with a few lines of code.

Figure 1: The application connects to the AgentCore gateway (AWS Identity and Access Management (IAM) or JSON Web Token (JWT) inbound authentication) and routes queries to the AWS service account’s web search tool through a managed connector. Query traffic stays within AWS.

Anchoring agents to the web is revising old knowledge, but it’s also where many teams get stuck. Building it yourself means:

  • Source third-party search APIs and manage keys, quotas, and rate limits.
  • Parse inconsistent result formats across providers.
  • Reasoning about where customer queries are sent and how that data is retained or reused.
  • By building snippet extraction logic, your model retrieves relevant passages rather than raw HTML.
  • Maintains freshness, coverage and quality for a long time.

Each of these is a project in itself. Amazon Bedrock AgentCore’s web search addresses them all.

Dedicated web index

Many “Add web search to agents” solutions are wrappers for third-party search engines. Amazon Web Search Bedrock AgentCore is powered by a web index spanning tens of billions of documents operated directly by Amazon. Its scale is important for reporting. For example, long-tail questions about niche libraries or obscure product specifications can be answered more effectively if the index is broad, rather than limited to the most popular pages.

Continuously updated

Amazon continually updates its index to reflect new content within minutes. For agents responding to questions about price changes or recently announced announcements, the extent of recency can be the difference between a well-founded response and a confidently incorrect response. When an agent searches for “what happened today,” the results reflect what actually happened today.

Knowledge graph of trusted facts

Amazon Bedrock AgentCore web search includes a built-in knowledge graph that grounds entities and their relationships. For factual questions (such as who holds a role or when something was founded), the knowledge graph provides reliable answers, rather than having the model infer it from extracted page text. This reduces subtle factual deviations that creep in when agents piece together responses from only fragments.

The tool performs extraction of semantically related snippets, rather than passing a raw HTML dump or the entire page to the model and hoping it finds the relevant parts. Retrieves passages from each web page related to the query and returns them in a format optimized for the model’s context window. This model recognizes the important parts and reduces tokens spent on boilerplate and navigation chrome. This helps improve the accuracy of cited answers.

Private by design

For many companies, the question that slows web search deployment is not “will it work?” The question is, “Where do my users’ queries go and what happens to them?” Amazon Bedrock AgentCore’s web search is built to make it easy to answer these questions.

Queries never leave AWS

When an agent issues a search, the query is processed entirely within the AWS infrastructure. Customer queries are never sent to a third-party search engine or leave AWS. The gateway authenticates against AWS-owned connectors and routes requests internally, so the data path remains end-to-end within AWS. For teams with concerns about data residency or third-party egress, this will remove entire categories of reviews.

walkthrough

To start using the Web Search Tool, create an AgentCore gateway (if you don’t want to use an existing one), add a Web Search Tool target, and call it from your agent using MCP.

Prerequisites

To follow the setup instructions in this post, you will need:

  • An AWS account with permissions to create an IAM role and Amazon Bedrock AgentCore resources.
  • You have the AWS Command Line Interface (AWS CLI) v2 installed and configured, or you have access to the AWS Management Console.
  • Python 3.10 or later (for SDK and Strands samples).
  • of boto3 Updated the SDK to the latest version.
  • Amazon Bedrock AgentCore Gateway. You can target web search tools to an existing gateway or create a new gateway. For instructions on creating a gateway, see Creating an Amazon Bedrock AgentCore Gateway in the developer guide.

Note: Following these steps creates AWS resources that incur charges. Amazon Bedrock AgentCore Gateway and Web Search calls are billable. See the Pricing section below for more information. Be sure to clean up your resources when you’re finished to avoid ongoing charges.

setting

To add web search to your agent, connect a web search tool target to your gateway: connectorId: "web-search". The gateway takes snapshots of tool schemas, provisions integrations, and handles schema management, parameter governance, endpoint resolution, and service authentication.

import boto3

gateway_client = boto3.client("bedrock-agentcore-control", region_name="us-east-1")

# Add the Web Search Tool as a target on an existing Gateway
gateway_client.create_gateway_target(
    gatewayIdentifier=gateway_id,  # your existing or newly created Gateway ID
    name="web-search-tool",
    targetConfiguration={
        "mcp": {
            "connector": {
                "source": {"connectorId": "web-search"},
                "configurations": [{"name": "WebSearch", "parameterValues": {}}],
            }
        }
    },
    credentialProviderConfigurations=[
        {"credentialProviderType": "GATEWAY_IAM_ROLE"}
    ],
)

Verify that you added the target by calling describe_gateway_target or list_gateway_targets Then verify that the web search tool appears in the response.

Outbound roles and permissions

Please note the aforementioned credentialProviderConfigurations. This is the whole story of outbound authentication. Instead of provisioning API keys or managing search credentials, the gateway uses its own IAM service role to authenticate to the web search backend.

This role requires a trust policy (to be scoped to the account and region so AgentCore can assume it) and a permissions policy that includes two actions:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "InvokeGateway",
      "Effect": "Allow",
      "Action": "bedrock-agentcore:InvokeGateway",
      "Resource": "arn:aws:bedrock-agentcore:us-east-1::gateway/"
    },
    {
      "Sid": "InvokeWebSearch",
      "Effect": "Allow",
      "Action": "bedrock-agentcore:InvokeWebSearch",
      "Resource": "arn:aws:bedrock-agentcore:us-east-1:aws:tool/web-search.v1"
    }
  ]
}

of InvokeWebSearch Resource ARN is owned by AWS (account = aws). Authorization is enforced on every call to that ARN, so bedrock-agentcore:InvokeWebSearch This allows the gateway to invoke web searches on your behalf.

There are some boundaries you should keep clear.

  • This role is only for outbound authentication (gateway to reach the web search backend). Inbound authentication (who can call the gateway) is typically handled separately using OAuth or a JWT authorizer such as Amazon Cognito.
  • not included in role bedrock:InvokeModel. Model access belongs to any identity running the agent, not the Gateway Service role.

Calls from MCP compatible frameworks

Web searches are exposed through MCP, so MCP-compatible frameworks such as Strands, LangChain, LangGraph, CrewAI, or your own frameworks can discover and invoke web searches. agent makes a call tools/listfind WebSearchTooland automatically uses it whenever the latest information is needed.

from datetime import date
from strands import Agent
from strands.models.bedrock import BedrockModel
from strands.tools.mcp import MCPClient
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client

gateway_url = "https://gateway-.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"

mcp_client = MCPClient(lambda: aws_iam_streamablehttp_client(
    endpoint=gateway_url,
    aws_region="us-east-1",
    aws_service="bedrock-agentcore",
))

model = BedrockModel(model_id="us.anthropic.claude-sonnet-4-6")

system_prompt = (
    f"You are a helpful assistant. Today's date is {date.today().isoformat()}. "
    "Use the available tools when you need current information."
)

with mcp_client:
    tools = mcp_client.list_tools_sync()  # WebSearch tool discovered from the Gateway
    agent = Agent(model=model, tools=tools, system_prompt=system_prompt)

    result = agent("What are the latest AI breakthroughs announced this week?")
    print(result)

The agent determines that it needs the latest information, WebSearchTool Ask questions using appropriate queries and create well-founded answers that cite sources. No tool-specific code is required.

response format

Results are returned in standard MCP. tools/call envelope. The tool returns a single value. content type of block text This contains a serialized JSON document containing the results. Parsing that inner text gives us id plus results Array of observations:

{
  "publishedDate": "04:43AM, Wednesday, June 17 2026, PDT",
  "text": "The 2026 NBA Finals was the championship...",
  "title": "2026 NBA Finals",
  "url": "https://en.wikipedia.org/wiki/2026_NBA_Finals"
}

Each web index monitor (always returned) includes: title, url, publishedDateand text. Knowledge graph observations (optional for entity queries) contain null title and url Additionally, add structured key/value facts. text field.

If you need to anchor agents to your own enterprise data, Amazon Bedrock Knowledge Bases and Amazon Bedrock Maneded Knowledge Bases are the right tools. They ingest, index, and retrieve content owned by users. Web search tools complement that. This allows you to deploy agents on the public web for ever-changing questions whose answers reside outside your organization. Many production agents use both knowledge bases to find out “what’s in the documents” and web searches to find out “what’s true in the world right now.”

Pricing

A pay-as-you-go model lets you run a web search agent for $7 per 1,000 queries, or less than a cent per question.

Clean up resources

If you follow the instructions to create a resource, you can delete it to avoid ongoing charges.

  1. Delete gateway target: call delete_gateway_target with you gatewayIdentifier and targetId.
  2. If the gateway was created specifically for this walkthrough, delete it as follows: delete_gateway.

There is no permanent infrastructure on the AWS side other than these resources. Once deleted, you will no longer be charged.

conclusion

Amazon Bedrock AgentCore Web Search Tool provides agents with up-to-date web knowledge through a single search tool. connectorId. There’s no search API to provision or result parsing to maintain. Its simplicity is rooted in a web index that AWS builds itself (tens of billions of documents, updated within minutes), a privacy model where queries never leave AWS, and search that can combine knowledge graphs with semantic snippet extraction tailored to the context of the model. As a result, agents answer timely questions accurately, cite sources, and keep data in the right place.

Amazon operates a complete search stack, which improves the freshness, coverage, relevance, and quality of snippets that are automatically sent to agents through the same managed connector. No version upgrades or migrations are required on your part.

You can access the Web Search Tools connector now. us-east-1 (Eastern US (N. Virginia)).

See your web search tool documentation to get started.


About the author

Veda Raman

Veda Raman

Veda Raman is a GenAI and Machine Learning Principal Specialist Solutions Architect based in Maryland. She has extensive experience designing and building AgenticAI applications and helps customers apply best practices when building cost-effective and robust AgenticAI applications.

Kalyan Garimela

Kalyan Garimela

Kalyan Garimella is a Principal Product Manager at Amazon AGI with over 15 years of expertise in building enterprise and consumer applications. He led the development and launch of Amazon Bedrock AgentCore’s web search capabilities, addressing a core limitation of modern AI agents: the lack of access to real-time factual information beyond training data, which leads to outdated responses and hallucinations. Kalyan’s work enables agents to capture live web data to ground their inferences, directly increasing the reliability and accuracy of enterprise AI agents at scale. During his six years at Amazon, he led efforts across AWS, Amazon Music, and AGI. He also previously held leadership roles at Deloitte, driving the digital transformation of enterprises through large-scale smart IoT initiatives. Kalyan lives in the Bay Area with his family.



Source link