AWS re:Invent 2025 - Building Agentic AI: Amazon Nova Act and Strands Agents in Practice (DEV327)
Learn how to build AI agents applications from ground up with AWS
Introduction
Session introduction on the emergence of Agentic AI as a pivotal topic in the current AI landscape
Aimed at forward-thinking developers looking beyond basic understanding to real-world applications and innovations
Future Trends of Agentic AI
Overview of the evolution of generative AI, highlighting a progression from low agency (rule-based, high human oversight) to high agency (independent operation, strategic decision-making)
Acknowledgment of the current stage of Agentic AI development, emphasizing the need for advanced technologies, governance, trust, and organizational readiness for higher agency
Prediction by Sequoia Capital
Sequoia Capital's keynote address on AI in 2025 envisions a future where AI systems evolve beyond tool-like attributes to become autonomously operating intelligent agents.
These agents will possess capabilities for reasoning, planning, collaboration, and high autonomous operation.
Vision for the 2030s Economy
- Sequoia Capital predicts that the economy in the 2030s, particularly in Asia, will function like a global neural network composed of numerous AI agent operations forming an interconnected network.
Potential Personal Success
- Designing an AI agent that gains widespread adoption, especially globally, could lead to significant personal financial success, potentially allowing one to become extremely wealthy.
Importance of the Prediction
- This forecast is crucial for guiding developers and understanding what needs to be achieved in the future of AI development.
Emergence of One-Person Unicorns
Sequoia Capital predicts the rise of "one-person unicorns," companies created and operated by a single individual with a valuation of $1 billion USD.
This trend will lead to a shift in labor structures and the emergence of new organizational models where a single person can run an entire startup.
Need for a Stochastic Mindset
The world of AI agents requires developers to adopt a new way of thinking, moving away from traditional expectations of accuracy and towards a more stochastic mindset.
This involves adjusting how developers connect with and utilize large language models and AI technologies.
Preparation for the New Era of Agentic AI
Success in the era of agentic AI requires not only technical preparation but also mental and organizational adjustments.
Developers must be ready for changes in organizational structures and mental frameworks to thrive in this new era.
Foundational Infrastructure for Agentic AI in 2025
Communication protocols like MCP and A2A are being developed to enable interoperability among AI agents and their tools.
AWS is actively participating in the standards committees for MCP and A2A, contributing decades of experience in distributed systems to enhance these future protocols.
AWS Agentic AI Portfolio
Composed of a comprehensive architecture with services organized into three layers:
Infrastructure
AI and agent developer software
Application layers
Focus on AI and agent development software and services, including SDKs for agents like Amazon Nova Act and Street Agents.
Practical Agentic AI Application: Local Weather Information
- Demonstration of a practical AI agent scenario: developing a local weather information application using the MCP protocol, Amazon Nova Act, and the Hong Kong Observatory website.
Local Weather Information Agent
AI agent built with Amazon Bedrock powered by Emerald and equipped with a specific website URL (Hong Kong Observatory).
Users can interact with the agent using natural language (English, Spanish, or Chinese) to inquire about the current weather in Hong Kong.
The agent autonomously locates the information on the specified website and saves a screenshot for verification, demonstrating its capability to function like a human web scraping engineer.
Impact on Web Scraping Engineers
- The era of agentic AI has arrived, potentially impacting traditional web scraping roles. Developers may need to prepare for this transition using AWS services like Nova Act.
Implementation Details of the AI Agent
Nova Act forecast functions that guide it on which web pages to capture and what actions to perform.
Natural language is used to assign tasks like reading and extracting the 9-day weather forecast information from the Hong Kong Observatory website.
Ambitions of Developers
Many developers aim to build their own agentic AI applications from scratch and maintain complete source code level control.
Open-source strands agents can help achieve this goal, allowing developers to control every line of their code.
Challenges in Building Custom Agents
- Developers need connectors that enable agents to interact with diverse enterprise systems.
Components Required for Customized AI Agent Systems
Tools and MCP (Message Control Protocol) are essential for enabling agents to execute workflows such as booking hotels, updating information, or triggering processes.
Memory: Agents require both short-term and long-term memory. Short-term memory maintains context within a session, while long-term memory allows agents to learn and improve over time.
Brain (Large Language Models): LLMs can be extended to more complex frameworks using techniques like ReACT (Reasoning, Acting, and Communicating Together), reflection, and Chain of Thought, enabling the model to plan, reflect, and reason step by step.
Persona: Each agent has a persona, a set of rules or instructions that define its identity and behavior, differentiating it from other types of agents (e.g., HR agent vs. DevOps agent).
Observability and Guardrails: Customizing AI agents to provide observability and guardrails ensures they remain safe, debatable, and aligned with goals.
Challenges in Building Functional AI Agents
- Building a truly functional AI agent requires substantial work, with potentially 80-90% of the effort being unrelated to unique business logic and processes.
AWS Solution: strands Agents
- Strands Agents: An AWS-contributed open-source SDK that enables developers to build AI agents with minimal code. It simplifies development by leveraging state-of-the-art large language models for planning, Chain of Thought.
Demo: Creating Mathematical Animations with strands Agents
- Mathematical visualizations using the Manim library, combined with Strands Agents and Python libraries.
Core Implementation Code:
Imports the Agent class from the Strands module and the MCPClient class for establishing essential components to utilize the agent and MCP within the framework.
Sets up a connection to a Manim MCP server using send_input and output as a transport mechanism.
Establishes a connection for interaction with the Manim MCP server, retrieves available tools, and initializes the agent with these tools.
Uses the agent to process a natural language prompt requesting a mathematical animation, specifically visualizing a cubic function graph from X equals -3 to X equals 3.
Mathematical Visualization with Strands Agents SDK
In Visual Studio, two terminal windows are used:
The left window runs the MCP (Message Control Protocol) server, connecting to the Manim MCP server via STDIO transport.
The right window runs the MCP client program, launching the video generation chat interface.
Users can input natural language commands through the interface, such as creating a scene that draws a cubic function over a specified range in 9 seconds.
The agent processes the natural language request, demonstrating adaptive problem-solving capabilities by creating a simplified version to complete the task if issues arise.
Benefits of Multi-Agent Collaboration
Specialization: Specialized agents work in specific domains, increasing precision and providing more accurate answers. Combining these agents can achieve superior outcomes.
Scalability: The system can add or remove agents without impacting the whole system, making it scalable.
Maintainability: Smaller agents are easier to control, monitor, debug, and test compared to larger, monolithic codebases.
Cost Efficiency: Multi-agent systems allow for choosing the right model for specific tasks, optimizing for smartness, speed, and cost efficiency.
Analogy: Single Agent vs. Multi-Agent System
Single Agent: Like a specialized skill working solo.
Multi-Agent System: Like a well-coordinated team where different roles (analysts, quants, traders, risk managers, IT) work together to achieve superior performance.
Condition for Success: Collaboration
- For multi-agent systems to succeed, agents must work together effectively.
Multi-Agent Collaboration Patterns
Agents as Tools: One agent can use another agent as a tool.
Graph Workflow: Agents can be connected in a graph-like structure to perform complex tasks.
Orchestrator Agents: An orchestrator agent receives user requirements, understands the intent, and calls specialized agents to perform specific tasks.
Example: Travel Planning
Orchestrator Agent: Receives the user's travel requirements (e.g., traveling to Las Vegas).
Research Agent: Searches for attractions and activities (e.g., antelope canyon).
Product Recommendation Agent: Provides recommendations based on the research agent's output.
Agent Workflow: The output of one agent becomes the input for the next, creating a seamless workflow.
Real-Life Example: Quantitative Hedge Fund
Quantitative methodology is crucial for quant researchers to quickly verify trading ideas and find the right trading strategy faster.
Example: Using a moving average crossover strategy, researchers can input stock details (e.g., Amazon), backtest window, and receive metrics like profit/loss and Sharpe ratio.
The system provides buy and sell conditions, backtest results, and suggestions for improving the trading strategy, including risk assessments and alerts.
Moving average crossover strategy
- moving average (MA) crossover strategy uses two MAs (a fast/short-term and a slow/long-term) on a chart to generate buy/sell signals: a buy signal occurs when the fast MA crosses above the slow MA (bullish trend), and a sell signal happens when the fast MA crosses below the slow MA (bearish trend).
How It Works
Set up: Plot two moving averages on your price chart (e.g., Simple Moving Average (SMA) or Exponential Moving Average (EMA)) with different time periods.
Buy Signal (Bullish): When the shorter-period MA crosses up through the longer-period MA.
Sell Signal (Bearish): When the shorter-period MA crosses down through the longer-period MA.
Common MA Combinations
Short-Term: 9-period EMA/SMA.
Medium-Term: 21-period EMA/SMA.
Long-Term: 50-day, 100-day, or 200-day MA (often used for major trends).
Key Crossover Patterns
Golden Cross: A bullish signal where a 50-day MA crosses above a 200-day MA, suggesting a strong uptrend.
Death Cross: A bearish signal where a 50-day MA crosses below a 200-day MA, signaling a potential downtrend.
Limitations & Refinements
Lagging Indicator: MAs are based on past prices, so crossovers often happen after a price move has already begun, leading to late entries/exits.
Choppy Markets: The strategy generates many false signals (whipsaws) in sideways or consolidating markets.
Architecture Diagram
The orchestration agent (quant research agent) calls different tools and sub-agents.
Tools: Market data tool and backtest tool.
Sub-agents: Strategy generation agent and result summary agent.
Bedrock Core Agent Gateway
- Provides a secure way for developers to build tools for agents by encapsulating APIs, Lambda functions, or existing services into MCP-compatible tools.
Steps
Using a Lambda function to store historical market data in an S3 table and defining it as the target of the gateway.
Create a gateway using the agent called gateway create MCP gateway command.
Define the Lambda function as the target of the gateway.
Authenticate using Cognito for secure access.
Define input and output parameters for the tool (e.g., get market data ).
Agent Gateway to build tools
- Host the strategy generation agent using Agent RAM and make it a tool for the quant research agent.
Integrating Gateway as a Tool
After creating the gateway, it can be made into a tool for the current research agent.
Steps:
Specify arguments and return types.
Use Cognito for authentication.
Call the gateway using HTTP clients to retrieve historical market data for backtesting.
Defining and Deploying Strategy Generation Agent
The strategy generation agent is deployed, which provides a secure and fast way to host agents.
Steps:
Define the agent using the strengths import agent.
Specify instructions for generating trading strategy code using a backtrader framework.
Deploy the agent to the runtime.
Specify entry points and run the agent on port 8080.
Use agent call config to specify files and dependencies.
Use agent call launch to start the runtime agent
Use agent get status check its status
Making Agents as Tools
After defining the tools (market data tool) and strategy generation agent, make the agent a tool.
Steps:
generate trading strategies.
Specify arguments (e.g., buy and sell conditions).
Invoke the agent.
Orchestrator Agent (Quant Research Agent)
The orchestrator agent coordinates the tools and agents.
Steps:
Import agents.
Define the system prompt for the quant research agent to get historical market data, generate the strategy, run the backtest, and analyze results.
Use the "agent as a tool" pattern to integrate the four tools:
market data,
generate strategy,
run backtest,
create result summaries.
If something goes wrong, the quant research agent will relearn result.
Kiro CLI
- Use the Kiro CLI to run commands, which is useful for debugging as it allows quick verification of outputs.
Running the Quant Agent with Kiro CLI
The Kiro CLI is used to run the quant agent, utilizing the tool execute patch and a JSON file specifying a 10-day period simple moving average crossover 30-day simple moving average strategy.
The agent generates the trading strategy in approximately 6 seconds.
The agent then fetches market data from the gateway via an HTTP request.
Around 200 data points are retrieved for the backtest.
The backtest is run using the backtrader framework.
The output includes the initial value, profit, total return, and recommendations for improving the trading strategy.
The backtest results are saved in the agent called memory and fetched from there in the final step.
Swarm Pattern
Unlike the "agents as tools" pattern, the swarm pattern involves agents communicating and collaborating dynamically without a single orchestrator.
The swarm maintains a shared context accessible to all agents, including information about other agents, inputs, outputs, and historical interactions.
The Swarm class is imported, and the four agents are defined with maximum handoffs and repetitive handoff detection to prevent infinite loops.
"Repetitive handoff" refers to the frequent, unnecessary transfer of a task or responsibility between different individuals, teams, systems, or network access points.
Example:
Writing a blog using four agents:
Research agent: Conducts research.
Creative agent: Creates content.
Critical agent: Challenges the created content.
Summarizer agent: Summarizes the final results.
Key Components of the Swarm Pattern
Shared Context: All agents have access to a shared context.
Dynamic Collaboration: Agents communicate and collaborate without a central orchestrator.
Handoff Limits: Maximum interactions and repetitive handoff detection are set to prevent infinite loops.
Unique Agent Involvement: Ensures that at least three unique agents are involved in the last handoff to maintain diversity and prevent repetitive interactions.
Swarm Pattern in Action
Task: Create a blog post explaining agentic AI and a summary for a social media post.
Workflow:
Research Agent: Gather necessary information and facts.
Creative Agent: Creates an engaging blog post.
Summarizer Agent: Generates a social media summary.
Iterative Process: The Summarizer Agent requests more details from the Creative Agent to create an effective summary.
Final Output: The Summarizer Agent successfully creates both the blog post and the social media summary after 5 interactions.
Swarm as a Tool
The Swarm pattern can be used as a tool within a larger framework.
Example: Importing a swarm tool to analyze or perform tasks using a group of agents.
Graph Pattern
- Defines agent relationships as a graph network where each agent is a node, and edges define the relationship and information flow.
Key Advantages:
Predictability: Clearly defined communication paths between agents.
Control: Full control over information flow.
Demonstration
- Define agents first to establish their roles and interactions within the graph.
Example: Agentic Fund Manager
Defining how the Portfolio Architect Agent will construct the portfolio.
Defining how the Fund Manager Agent will manage the fund based on the constructed portfolio.
Portfolio Architect Agent: Constructs the portfolio to fulfill customer requirements. Manages the fund based on the portfolio constructed by the Portfolio Architect Agent.
Defining Nodes and Edges in the Graph Pattern
- In the graph, nodes are defined to trigger specific actions or deploy agents.
Example:
- Defining portfolio nodes that will call agents.
Steps:
Define the state graph and input the state graph.
Add nodes for financial, portfolio, and risk.
Define edges from financial to portfolio, portfolio to risk, with risk as the end node.
Workflow Pattern
A workflow is a well-defined sequence or pattern of tasks.
Example: Defining a sequence of research agents, analysis agents, and report agents.
Steps:
Import workflow tools.
Define tasks and their dependencies (e.g., report generation depends on trend analysis).
Set priorities to determine the order of execution for parallel sub-agents.
Workflow Pattern Use Case
- Ideal for complex and repeatable processes that need to be encapsulated in a single, reliable tool.
Example:
- Automated data pipelines involving data extraction, transformation (ETL), and loading into a data warehouse.
Sample Use Cases for Multi-Agent Collaboration Patterns
Agents as Tools:
- Customer service chatbot: Orchestrated agents call technical account managers, bidding agents, and summarize agents to provide output to customers.
Swarm Pattern:
- Multidisciplinary incident response: Agents interact locally to produce complex emergent behavior without centralized control. Example: Networking issue passes to network agents, then to database agents if necessary.
Graph Pattern:
- Data validation with error path: Define a graph where agents determine if there are errors, then pass to data validation without error or data agent with error path.
Workflow Pattern:
- Clearly defined sequence of tasks with dependencies and priorities to maintain controlled information flow and execution order.
Top comments (0)