Unlocking Web-Enabled AI Agents: Integrating Exa with Strands Agents SDK
Co-authored by Ishan Goswami and Nitya Sridhar from Exa
In this comprehensive guide, explore how the Exa integration enhances the Strands Agents SDK, making it easier for developers to build AI agents equipped with effective web search and retrieval capabilities. Learn about the tools offered and their practical applications for research and competitive intelligence.
Bridging the Gap: Integrating Exa with Strands Agents to Empower AI Workflows
Co-written by Ishan Goswami and Nitya Sridhar from Exa
In the rapidly evolving landscape of artificial intelligence, access to current and reliable information is paramount—especially for web search-enabled AI agents developed for research, fact-checking, or competitive intelligence. While general-purpose search APIs provide a wealth of data, they often present HTML-heavy pages and short snippets tailored for human consumption rather than structured data suitable for AI workflows. For developers, this creates an unnecessary hurdle, necessitating the building of additional layers, custom crawlers, parsers, and ranking logic.
Enter Exa’s Integration with the Strands Agents SDK. This integration delivers an AI-native search and retrieval layer that seamlessly fits into the developer’s toolkit. By providing clean, structured content formatted for direct consumption in LLM (Large Language Model) context windows, developers can attain the rich web knowledge their agents require without the cumbersome post-processing. Coupled with the Strands Agents SDK’s model-driven architecture, the integration ensures that AI agents can access real-time web data effortlessly.
Strands Agents: Rethinking AI Workflows
The Strands Agents SDK, an open-source framework from AWS, revolutionizes the way AI agents are built through its model-driven approach. Instead of creating rigid, hardcoded workflows, developers provide a model along with a system prompt and a collection of tools. The model itself takes charge of decision-making, determining which tools to utilize and in what sequence.
At the heart of the SDK is the agent loop. With each iteration, the model receives the complete conversation history, encompassing prior tool calls and their outcomes. If additional information is required, the model can request a tool, prompting Strands Agents to execute it and feed the results back. This iterative process empowers agents to tackle complex, multi-step tasks that far surpass the capabilities of a single LLM call.
The SDK provides over 40 pre-built tools, ranging from file I/O to web search, AWS APIs, and even memory management. Furthermore, the Model Context Protocol (MCP) ensures that tools exposed by MCP servers can be easily integrated into an agent’s workflow with minimal additional configuration.
Introducing Exa: The AI-Native Search Engine
Exa stands out as a web-scale search engine explicitly designed for LLMs and AI agents. Unlike traditional search engines that rely on mere keyword matching, Exa interprets the meaning of queries to deliver semantically relevant content. A query like “startups building climate solutions” would yield actual results even if those pages do not use the exact keywords.
Results are returned as clean, structured content, devoid of advertisements or SEO noise, ensuring that LLMs can ingest and process the data effortlessly.
Integration Overview: Exa and Strands Agents
The integration is available via the strands-agents-tools package, empowering AI agents with two key functionalities:
-
exа_search: Execute semantic searches across various categories, including news, research papers, and repositories.
-
exa_get_contents: Fetch the full content from designated URLs identified during searches.
These tools optimize for AI consumption, providing structured data that can be directly reasoned over by agents.
Searching with exa_search
The exa_search tool offers nuanced search capabilities that surpass basic query strings. With four search modes—Instant, Fast, Auto, and Deep—agents can choose how to engage with web content.
For example:
- Instant (~200ms): Ideal for real-time situations like autocompletion or live suggestions.
- Deep (~3-6s): Conducts parallel searches across variations of the query, perfect for exhaustive research.
In addition to these modes, agents can also filter searches for specific categories like news, academic papers, or financial reports, drastically refining their results.
Content Extraction with exa_get_contents
Once relevant URLs are acquired, the exa_get_contents tool retrieves comprehensive content. With built-in caching for previously crawled pages, the tool can rapidly serve content or opt for live crawling to ensure the latest information is accessible.
Setting Up the Integration
Integrating Exa with Strands Agents is straightforward, requiring a few key prerequisites and setup steps:
-
API Key: Secure your Exa API key and set it in your environment.
export EXA_API_KEY="your_exa_api_key_here" -
Import Tools:
from strands import Agent from strands_tools.exa import exa_search, exa_get_contents agent = Agent(tools=[exa_search, exa_get_contents]) -
Invoke the Agent:
response = agent("Search for the latest trends in AI and summarize key developments.")
With these steps, agents can begin leveraging Exa’s capabilities effectively across various search scenarios.
Real-World Application: Building a Deep Research Agent
Imagine deploying a deep research assistant powered by Exa. This agent could perform targeted searches across varied source types, extract critical content from the most promising results, and synthesize a structured research brief—all within a single invocation.
The Multi-Step Workflow
- Initial Search: Conduct a broad understanding search using the auto mode.
- News Search: Narrow down specific news sources from a recent timeframe.
- Research Papers: Focus on academic content, extracting key findings.
- GitHub Projects: Explore open-source implementations.
- Deep Dive: Extract full content from the most relevant results.
- Synthesis: Compile a structured brief with insights, developments, and sources.
Conclusion: Elevating AI Agents
The combination of Strands Agents SDK and Exa enables developers to create sophisticated AI agents grounded in real-time web information. Exa’s semantic search capabilities, along with the structured outputs and simple integration, facilitate efficient AI workflows.
This integration is not just limited to research—it spans competitive intelligence, technical support, and myriad domains requiring instant access to reliable information.
Get started today by obtaining your Exa API key and exploring the exponential possibilities in AI agent development!
About the Authors
Ishan Goswami: Founding DevRel Engineer at Exa, Ishan specializes in building integrations and demo applications that simplify Exa for developers.
Nitya Sridhar: Head of Marketing at Exa, Nitya focuses on product launches, technical storytelling, and community engagement.
This blog post serves as a comprehensive overview for developers looking to optimize their AI agent workflows using Exa and Strands Agents. For additional inquiries or guidance, feel free to explore the Amazon Bedrock documentation or connect with the developers at Exa!