AI Tools
Tutorial10 minMay 12, 2026By AIGCDevUpdated: May 13, 2026

How to Build a Web Search Agent with Strands and Exa (2026)

Quick Answer

If you need an AI agent that can search the live web without turning every run into a messy browser scrape, Strands + Exa is one of the cleanest practical setups to copy right now.

The useful part is not the news headline itself. It is the workflow shape behind AWS's May 11, 2026 post: let Strands handle the agent loop, let Exa handle web search and page extraction, and keep your task narrow enough that you can still review the output.

As of 2026-05-13, this setup is a good fit for research briefs, fact-checking, market scans, and competitor monitoring. It is a poor fit for tasks that require guaranteed source completeness, heavy spreadsheet logic, or zero-cost usage at scale, because Exa is still a paid API and live web search is naturally noisy.

What Changed On 2026-05-11

AWS published an official post on 2026-05-11 showing how to connect Exa search tools to the Strands Agents SDK. That matters because it turns a vague promise into a copyable pattern.

The pattern is simple:

  • Strands runs the agent loop.
  • Exa provides semantic search and content extraction.
  • The model decides when to search, when to fetch full pages, and when to stop.

That is more useful than a generic "agents can browse the web" claim because it gives internal AI workflows a visible division of labor.

When This Stack Makes Sense

Use Strands + Exa when most of these are true:

  • you need current web information, not just uploaded files
  • you want the agent to cite or at least surface real URLs
  • your task can be framed as research, validation, or structured summarization
  • you can review the final output before it triggers a business action
  • you want better search inputs than generic snippet-heavy search APIs

Skip it for now when your real need is something else:

  • you need exact financial, legal, or compliance completeness
  • you need deterministic, identical output every run
  • you do not want another paid dependency
  • your team has not yet defined what a good answer looks like
  • your workflow would be better served by a normal RAG system over your own documents

What Each Piece Actually Does

Piece Job Why it matters
Strands Agents Runs the agent loop and tool calling You write less workflow glue and let the model decide when to use tools
Exa exa_search Finds relevant sources with semantic search and filters Better starting point than raw search snippets for agent workflows
Exa exa_get_contents Pulls page text from URLs the agent found Lets the agent work with actual page content instead of titles alone
Your system prompt Defines scope, source preferences, and output format This is where most quality gains still come from

One important detail from Exa's official search API docs: the search API supports multiple search types, including auto, fast, instant, neural, deep-lite, deep, and deep-reasoning, plus filters like category and domain. That means you do not need one search strategy for every task.

What You Need Before You Start

Before you wire anything together, confirm these basics.

Item What to verify Why it matters
Python Python 3.10 or later Both AWS's post and the Strands SDK setup expect it
Model provider Bedrock, OpenAI, Anthropic, Gemini, or another supported provider Strands is model-agnostic, but you still need one real model backend
Bedrock access, if you use the AWS path AWS credentials, model access, and a supported region The starter script will fail before search if Bedrock cannot call the selected model
Exa API key A working key from the Exa dashboard The search tools will not run without it
Packages strands-agents and strands-agents-tools The Exa integration lives in the tools package
Narrow task One research question with clear success criteria A broad prompt makes the agent expensive and sloppy fast

The Fastest Safe Setup

Step 1: Install the packages

Create a clean environment and install the two packages AWS uses in its example.

python3 -m venv .venv
source .venv/bin/activate
pip install strands-agents strands-agents-tools

Step 2: Set your Exa API key

Exa's official docs and the AWS tutorial both use the EXA_API_KEY environment variable.

export EXA_API_KEY="your_exa_api_key_here"

If your team uses a secrets manager or CI runner, put the key there instead of hard-coding it into scripts.

Step 3: Start with one bounded research task

Do not begin with "research anything about AI."

Start with a task that has a visible finish line. Good examples:

  • compare three competitors' latest product announcements
  • find the newest official docs for one API change
  • summarize recent vendor moves in a narrow category
  • collect source-backed notes for a product brief

Bad first task:

  • monitor the entire market and tell me what matters

That kind of prompt usually burns tokens, over-searches, and still gives you a vague answer.

Step 4: Register the Exa tools

The minimum setup from the official examples is short.

from strands import Agent
from strands_tools.exa import exa_search, exa_get_contents

agent = Agent(tools=[exa_search, exa_get_contents])

This works because Strands reads the tool signatures and decides when each tool should be called during the loop.

Step 5: Use a prompt that limits scope

A usable first prompt should define source preference, time window, and output structure.

You are a research assistant for product and strategy work.

Task:
- Find official or primary sources about recent changes in AI coding agents.
- Prefer official company blogs, docs, release notes, and GitHub repositories.
- Focus on changes published in the last 14 days.
- Avoid duplicate reporting of the same announcement.

Return format:
1. Key updates
2. Why each update matters
3. Source list with URLs
4. Open questions or gaps

That prompt is already much better than a generic "search the web and summarize trends" request.

A Copyable Starter Script

AWS's post shows a Bedrock-based example, and Strands' official repo says Bedrock is the default provider if you already have AWS credentials. The script below stays close to that path while keeping the task practical.

Before you run it, confirm that your AWS profile can call the selected Bedrock model in the selected region. If your account has not enabled that model, swap model_id and region_name before debugging the Exa tools.

from strands import Agent
from strands.models.bedrock import BedrockModel
from strands_tools.exa import exa_search, exa_get_contents

model = BedrockModel(
    model_id="us.anthropic.claude-sonnet-4-6",
    region_name="us-west-2",
    max_tokens=8000,
)

agent = Agent(
    model=model,
    tools=[exa_search, exa_get_contents],
    system_prompt="""
You are a research agent.
Prefer official sources, product docs, release notes, and GitHub repos.
Use web search only when needed.
When multiple articles repeat the same announcement, keep the primary source.
End with a concise brief and a source list.
""",
)

question = "Find the most important official updates in AI coding agents from the last 14 days and summarize what changed for technical teams."

response = agent(question)
print(response)

You can swap Bedrock for another Strands-supported model provider if that matches your stack better. The important part is not Bedrock itself. The important part is that search and page retrieval stay as separate tools instead of being hidden inside one opaque prompt.

Which Exa Search Mode Should You Pick

This choice affects both cost and output quality. Exa's current docs expose more modes than the simplified AWS example, so keep the first deployment conservative.

Mode Best for Tradeoff
instant voice or live suggestion flows lowest latency, weakest depth
fast repeated agent tool calls inside one workflow good speed, less coverage than deeper search
auto most first deployments lets Exa choose the search path, so inspect returned cost and source quality
neural normal semantic retrieval where you want sources more than synthesis less depth than the deep modes
deep-lite lightweight synthesis over harder questions more latency and cost than simple retrieval
deep harder research or competitive scans slower and usually more expensive than neural
deep-reasoning highest-stakes research where missed context is expensive deepest option, so reserve it for reviewed workflows

If you do not know which one to use, start with auto. Move to deep or deep-reasoning only when the missed-source risk is more expensive than the added latency and API cost. For production cost controls, log Exa's returned cost fields instead of guessing from the mode name alone.

A Good First Use Case: Competitor Update Briefs

This is where the stack becomes genuinely useful.

Imagine a weekly workflow for a product team that needs to track AI coding tools. Your agent can:

  1. search recent official announcements
  2. fetch the most relevant pages
  3. remove duplicate reporting
  4. return a short brief with URLs and open questions

A prompt that works better than a freeform research prompt:

You are preparing a weekly competitor brief.

Focus:
- AI coding agents
- official product announcements only when possible
- changes published in the last 7 days

For each item, return:
- company or product name
- what changed
- who should care
- one practical implication for a dev tools team
- source URL

Do not include rumors, fundraising news, or commentary unless it changes product availability.

Why this use case works:

  • the time window is clear
  • the source preference is clear
  • duplicate reporting is common, so Exa's retrieval step helps
  • the output can be reviewed before anyone acts on it

How To Keep The Agent From Getting Sloppy

A web-enabled agent is only useful if it stays constrained.

Use these guardrails from day one:

  • prefer official domains in the prompt
  • set a real time window such as 7, 14, or 30 days
  • ask for URLs in the output every time
  • ask the model to separate facts from open questions
  • keep the final format short enough that you will actually review it

A simple acceptance checklist helps too:

  • did the answer include primary URLs?
  • did it collapse duplicate coverage?
  • did it pull current pages instead of old explainers?
  • did it make any unsupported claims that need manual review?

Where This Stack Still Fails

This is the part many news-driven posts skip.

Live search is still noisy

Even a better search layer can return mixed-quality pages, stale commentary, or pages that mention your topic without being the real source.

Cost grows with curiosity

The more often the agent searches, fetches, and re-checks pages, the more tokens and API cost you burn. A lazy prompt can turn one small brief into a long chain of tool calls.

Search is not a compliance record

A source-backed answer is better than an uncited answer. It is still not a legal, finance, or audit-grade process.

Full-page extraction does not equal full understanding

exa_get_contents gives the model more context, but the model can still misread a page, over-compress nuance, or miss what changed versus an earlier version.

When To Use Something Else

Strands + Exa is not the best answer for every research workflow.

Need Better starting point Why
Answers only from your own documents RAG over your internal corpus Live web search adds unnecessary noise
Human-facing research chat with manual browsing Perplexity or a normal browser workflow Less setup, easier for non-developers
Deep spreadsheet-heavy analysis Python notebook plus manual sources The agent loop is not the hard part
High-volume monitoring at low cost Feed processing plus rules Always-on agent search gets expensive fast

FAQ

Do I need Amazon Bedrock to use Strands with Exa?

No. Bedrock is the path AWS highlighted in its example, and the Strands SDK defaults to Bedrock in some quickstarts, but Strands' official repo documents support for multiple model providers including OpenAI, Anthropic, Gemini, and others.

Is Exa replacing the model?

No. Exa is the search and retrieval layer. You still need a model provider to reason over the results and write the final answer.

Should I start with deep search mode?

Usually no. Start with auto unless the task clearly needs maximum coverage and can tolerate more latency. Use deep-reasoning only after you have a reviewer, a cost budget, and a reason simple retrieval is missing important sources.

Is this a good setup for autonomous production agents?

It can be, but only for bounded workflows. It is much safer for reviewed research tasks than for agents that take irreversible actions.

Verification Note

Checked on 2026-05-13:

  • AWS's official post for the 2026-05-11 announcement, the two-tool Exa integration shape, the prerequisite list, and the sample Bedrock model path: https://aws.amazon.com/blogs/machine-learning/building-web-search-enabled-agents-with-strands-and-exa/
  • Strands Agents' official site and GitHub repo for Python 3.10+, package names, Bedrock default guidance, and multi-provider support: https://strandsagents.com/ and https://github.com/strands-agents/sdk-python
  • Exa's official API docs for the search endpoint, supported search types (auto, fast, instant, neural, deep-lite, deep, deep-reasoning), categories, returned cost fields, and API key usage: https://exa.ai/docs/reference/search
ai-agentsai-searchai-codingcloudamazon