Grounded AI answers with Web Search Tool and Amazon Bedrock

Amazon API Gateway → AWS Lambda → Web Search Tool → Amazon Bedrock

Ground AI responses in live web data using the Web Search Tool on Amazon Bedrock AgentCore Gateway for model-agnostic cited answers

A user sends a question to the Amazon API Gateway REST API endpoint.
The AWS Lambda function searches the live web via the Web Search Tool on Amazon Bedrock AgentCore Gateway using the MCP protocol with SigV4 authentication.
Web search results (titles, URLs, snippets) are formatted as context and sent to Amazon Bedrock (Claude) for inference.
Amazon Bedrock synthesizes a grounded answer with numbered citation references, returned to the user with source URLs.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-lambda-websearch-bedrock/typescript/cdk

Deploy

<code>npx cdk deploy</code>


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

npx cdk destroy

Created by:

Nithin Chandran R

Nithin Chandran R

Technical Account Manager at AWS

Follow on LinkedIn