AWS Machine Learning Blog 前天 22:38
Build dynamic web research agents with the Strands Agents SDK and Tavily
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

文章介绍了Strands Agents SDK如何通过模型驱动的范式简化AI代理开发,将复杂逻辑内嵌于大型语言模型(LLM)中,从而降低开发门槛并提高灵活性。通过与Tavily的API集成,该框架能够构建强大的研究代理,高效地收集、处理和合成实时网络信息,同时满足企业级安全和合规标准。这种结合为客户成功代理、内部员工助手和销售代理等多种应用场景提供了基础,尤其在研究领域,能够实现自主、高保真的网络调查,加速创新并协助合规监控。

💡 **模型驱动的代理开发**: Strands Agents SDK采用模型驱动的开发方式,将复杂逻辑从硬编码中转移到LLM本身,显著减少了开发工作量,并允许通过升级模型来提升代理能力,提高了代理的灵活性和可维护性。

🌐 **Tavily提供实时网络智能**: Tavily作为一个API优先的网络智能层,为LLM代理提供实时搜索、高保真内容提取和结构化网络爬取能力。其API具有SOC 2 Type II合规性、零数据保留策略,并与Amazon Bedrock及私有LLM无缝集成,确保了企业级安全和隐私。

🛠️ **集成化工具与LLM的协同**: Strands Agents SDK通过Models、Tools和Prompts三大组件,支持与多种LLM提供商集成,并允许代理与外部系统交互。Tavily的Search、Extract和Crawl等API可作为独立的工具集成到Strands Agents中,使代理能够高效地执行复杂的网络研究任务。

🚀 **赋能企业级AI应用**: Strands Agents与Tavily的结合,为企业打造了高度安全、可扩展且功能强大的AI研究代理。这些代理能够自主收集互联网信息,为客户支持、内部知识管理、市场分析和合规监控等提供实时洞察,加速业务创新和决策过程。

“Tavily is now available on AWS Marketplace and integrates natively with Amazon Bedrock AgentCore Gateway. This makes it even faster for developers and enterprises to embed real-time web intelligence into secure, AWS-powered agents.”

As enterprises accelerate their AI adoption, the demand for agent frameworks that can autonomously gather, process, and synthesize information has increased. Traditional approaches to building AI agents often require extensive orchestration code, explicit state management, and rigid architectures that are difficult to maintain and scale.

Strands Agents simplifies agent development by addressing these challenges. It introduces a model-centric paradigm that shifts the complexity from hard-coded logic into the large language model (LLM) itself. This dramatically reduces development overhead while increasing agent flexibility—for example, minimizing the need to write explicit logic for each input or output type. By embedding logic directly into the model, agents can be significantly improved simply by swapping in more advanced models as they are released.

In this post, we introduce how to combine Strands Agents with Tavily’s purpose-built web intelligence API, to create powerful research agents that excel at complex information gathering tasks while maintaining the security and compliance standards required for enterprise deployment.

Strands Agents SDK: Model-centric agent framework

The Strands Agents SDK is an open source framework that revolutionizes AI agent development by embracing a model-driven approach. It offers a code-first, lightweight yet powerful framework for building agentic workflows. Instead of requiring complex orchestration code, the Strands Agents SDK helps developers create sophisticated agents through three primary components:

Strands Agents offers an advanced and rich feature set. With the Strands Agents SDK, developers can build intelligent agents with minimal code while maintaining enterprise-grade capabilities:

Strands Agents abstracts away the complexity of building, orchestrating, and deploying intelligent agents, providing a natural language-based interaction and control coupled with dynamic output generation. The result is a more intuitive and powerful development experience.

Tavily: Secure, modular web intelligence for AI agents

Tavily is an API-first web intelligence layer designed specifically for LLM agents, powering real-time search, high-fidelity content extraction, and structured web crawling. Built for developers building AI-based systems, Tavily is engineered for precision, speed, and modularity. It offers a seamless integration experience for agent frameworks like Strands Agents.Tavily’s API is an enterprise-grade infrastructure layer trusted by leading AI companies. It combines robust capabilities with production-grade operational guarantees, such as:

Each endpoint is exposed as a standalone tool, meaning they can be quickly wrapped into your agent framework’s tool schema (such as OpenAI’s tool-calling, LangChain, Strands, or ReAct-based implementations).

Combining Strands Agents with the Tavily web infrastructure

By combining the flexibility of the Strands Agents SDK with Tavily’s real-time web intelligence capabilities, developers can build dynamic, LLM-powered agents that interact intelligently with the internet. These agents can reason over open-ended queries, make decisions based on natural language prompts, and autonomously gather, process, and deliver insights from the web.This integration can be appropriate for a wide range of agent-based applications. For example:

Each use case benefits from the same foundation: a developer-friendly agent framework, composable web intelligence tools, and the decision-making power of LLMs.To demonstrate how this comes together in practice, we explore a focused implementation: a research agent designed for autonomous, high-fidelity web investigation.

Research agent example

Many research agent implementations require extensive development efforts and rely on deterministic logic or workflows with constrained inputs and outputs. Alternatively, Strands enables developers to build highly dynamic agents through natural language. Strands agents use prompt engineering to dynamically generate varied output types and accept diverse natural language inputs seamlessly.Combining Tavily with Strands unlocks a new class of agents purpose-built for deep, dynamic research. Unlike hardcoded research pipelines, this pairing helps developers accomplish the following:

With Strands Agents and Tavily’s capabilities combined, the agents excel in gathering industry intelligence and providing organizations with real-time insights into trends, competitor activities, and emerging opportunities. Agents can conduct comprehensive competitive analysis, scouring vast amounts of online data to identify strengths, weaknesses, and strategic positioning of industry players. In the realm of technical research, these agents can rapidly assimilate and synthesize complex information from multiple sources, which can help accelerate innovation and problem-solving processes. Additionally, such agents prove invaluable for regulatory compliance monitoring by continuously scanning and interpreting evolving legal landscapes to make sure organizations stay ahead of regulatory changes. The flexibility of the Strands Agents SDK allows for customization to specific industry needs—it’s equally effective for tasks ranging from customer service automation to sophisticated data analysis workflows.

Solution overview

To illustrate this combination, we created a deep researcher implementation (see the GitHub repo) that uses the agent loop capability at the core of the Strands Agents SDK to intelligently and autonomously choose from Tavily’s web intelligence capabilities. The following diagram illustrates this workflow.

We configured the Strands Agents SDK to use Anthropic’s Claude 4 Sonnet on Amazon Bedrock. Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies through a unified API. The following diagram illustrates the solution architecture.

This research agent is composed of three primary components:

In the following sections, we discuss the LLM and tools in more detail.

Large language model

The LLM influences the behavior of the agent as well as the quality of the generated response. We decided to use Anthropic’s Claude 4 Sonnet on Amazon Bedrock for its ability to plan and execute complex tasks, but you can use one of the other models supported by Amazon Bedrock or another model provider.

from strands.models import BedrockModelbedrock_model = BedrockModel(    model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",    region_name="us-east-1",)agent = Agent(model=bedrock_model)

Tools

Tools help extend agents’ capabilities and interact with external services such as Tavily. We implemented the following tools to enable our agent to perform deep research over the internet and provide a formatted output:

To define a tool with the Strands Agents SDK, you can simply wrap a Python function with the @tool decorator and provide a Python docstring with the tool description. Let’s explore an example of how we implemented the web_search tool using Tavily’s search endpoint.The search endpoint lets agents discover relevant webpages based on a natural language query. Results include URLs, title, content snippets, semantic scores, or even the full content of matched pages. You can fine-tune searches with parameters such as:

See the following code:

@tooldef web_search(    query: str, time_range: str | None = None, include_domains: str | None = None) -> str:    """Perform a web search. Returns the search results as a string, with the title, url, and content of each result ranked by relevance.    Args:        query (str): The search query to be sent for the web search.        time_range (str | None, optional): Limits results to content published within a specific timeframe.            Valid values: 'd' (day - 24h), 'w' (week - 7d), 'm' (month - 30d), 'y' (year - 365d).            Defaults to None.        include_domains (list[str] | None, optional): A list of domains to restrict search results to.            Only results from these domains will be returned. Defaults to None.    Returns:        formatted_results (str): The web search results    """    client = TavilyClient(api_key=os.getenv("TAVILY_API_KEY"))    formatted_results = format_search_results_for_agent(        client.search(            query=query,            max_results=10,            time_range=time_range,            include_domains=include_domains        )    )    return formatted_results

LLMs rely heavily on the tool definition and description to determine how and when to use them. To improve tool accuracy, consider the following best practices:

Each Tavily endpoint can be exposed to a language model as a distinct tool, giving AI agents flexible, granular access to the web. By combining these tools, agents become dramatically more capable at tasks like research, summarization, competitive intelligence, and decision-making. You can find the other tools implementation in the GitHub repository.

Strategic value proposition

AWS chose Tavily for the following benefits:

Conclusion

The combination of the Strands Agents SDK and Tavily represents a significant advancement in enterprise-grade research agent development. This integration can help organizations build sophisticated, secure, and scalable AI agents while maintaining the highest standards of security and performance. To learn more, refer to the following resources:


About the authors

Akarsha Sehwag is a Generative AI Data Scientist in Amazon Bedrock Agents GTM team. With over six years of expertise in AI/ML product development, she has built Machine learning solutions across diverse customer segments.

Lorenzo Micheli is a Principal Delivery Consultant at AWS Professional Services, focused on helping Global Financial Services and Healthcare organizations navigate their cloud journey. He develops strategic roadmaps for generative AI adoption and cloud-native architectures that drive innovation while ensuring alignment with their business objectives and regulatory requirements.

Dean Sacoransky is a Forward Deployed Engineer at Tavily, specializing in applied AI. He helps enterprises and partners use Tavily’s web infrastructure technology to power and enhance their AI systems.

Lee Tzanani is Head of GTM and Partnerships at Tavily. She leads strategic collaborations with Tavily’s most valuable partners and works with enterprise and Fortune 500 customers to integrate real-time web search into production AI systems. Lee drives Tavily’s go-to-market efforts across the AI landscape, advancing its mission to onboard the next billion AI agents to the web.

Sofia Guzowski leads Partnerships and Community at Tavily, where she works with companies to integrate real-time web data into their AI products. She focuses on strategic collaborations, developer engagement, and bringing Tavily’s APIs to the broader AI landscape.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Strands Agents Tavily AI代理 Amazon Bedrock 网络智能
相关文章