How to Build Multi-Agent Collaboration on AWS Bedrock: A Financial Assistant Tutorial
๐ฐ Discover How AWS Bedrock Allows Multiple AI Agents to Collaborate Effectively, Highlighted by a Financial Assistant Example
๐ Introduction
Why Multi-Agent AI is the Future?
At AWS re:Invent 2024, AWS introduced Multi-Agent Collaboration for Bedrock, enabling developers to build AI systems where multiple agents work together to tackle complex tasks. Instead of relying on a single AI model, specialized agents can now interact, delegate tasks, and optimize workflows dynamically. Read the announcement here.
Traditional AI models often struggle with multi-step workflows, requiring manual orchestration to delegate tasks. With Multi-Agent Collaboration, AI-powered workflows become more scalable, efficient, and adaptive, allowing specialized AI agents to seamlessly collaborate for better decision-making and automation.
๐ Whatโs in This Blog?
In this blog, we will explore:
1๏ธโฃ What is AWS Bedrock & Multi-Agent Collaboration?
2๏ธโฃ Why Multi-Agent AI is More Effective Than Single-Agent AI?
3๏ธโฃ A Practical Example: Building a Multi-Agent Financial Assistant
4๏ธโฃ Step-by-Step Guide to Creating Agents in AWS Bedrock
5๏ธโฃ Architecture & Technical Details
To showcase Multi-Agent Collaboration, weโll build an AI-powered financial assistant with three specialized agents:
๐จโ๐ผ Supervisor Agent โ Orchestrates workflows, delegates tasks, and consolidates responses.
๐ณ Expense Analyzer โ Fetches user transactions from DynamoDB and categorizes spending.
๐ Budget Optimizer โ Retrieves budgeting strategies from a Knowledge Base and suggests plans.
๐ฐ Investment Advisor โ Uses market insights from a Knowledge Base to provide investment recommendations.
By the end of this blog, you'll know how to build and deploy multi-agent AI systems using AWS Bedrock.
๐ What is AWS Bedrock?
AWS Bedrock is a fully managed service for developers to build and scale AI applications using Foundation Models (FMs) without managing infrastructure.
๐ก Key Features of AWS Bedrock
โ
Access to top Foundation Models (Claude, Nova, Titan, Llama, etc.).
โ
No infrastructure management โ No need for GPU provisioning.
โ
Multi-Agent Collaboration โ Agents can dynamically interact to complete tasks.
โ
Seamless AWS integration โ Works with Lambda, DynamoDB, S3, and more.
A core feature is Multi-Agent Collaboration, enabling AI agents to:
โ
Collaborate on complex tasks in real-time.
โ
Use a Supervisor Agent for task delegation and orchestration.
โ
Access external APIs and databases for real-time information retrieval.
๐ Why Multi-Agent AI?
Traditional AI models handle one task at a time, but real-world problems require multiple specialized AI agents working together.
๐ก Key Benefits of Multi-Agent AI
โ
Scalability โ Easily expand capabilities by adding/removing agents.
โ
Efficiency โ Specialized agents optimize workflow execution.
โ
Resilience โ If one agent fails, others can adapt and recover.
โ
Modularity โ Each agent can evolve independently.
These advantages make Multi-Agent Collaboration ideal for complex AI workflows, from finance and business automation to healthcare and customer support.
๐ Multi-Agent Collaboration in AWS Bedrock
AWS Bedrock natively supports multi-agent workflows, allowing agents to:
1๏ธโฃ Work together to solve complex tasks.
2๏ธโฃ Communicate via a Supervisor Agent that delegates work.
3๏ธโฃ Access external APIs (Lambda, DynamoDB, etc.) for real-time data.
๐ Step-by-Step: Creating Multi-Agent Collaboration in AWS Bedrock
Note: This blog does not include all screenshots to keep it concise. For a detailed step-by-step guide with images, please refer to the attached PDF.
๐ Download Full Step-by-Step Guide (PDF) ๐ฅ
โ Go to AWS Bedrock Console โ Agents โ Create Agent
Below are the all 4 Agents after creation.
1๏ธโฃStep 1: Create Sub-Agents - 3 individual Agent
โ Expense Analyzer โ Fetches transactions from DynamoDB using AWS Lambda.
โก๏ธExpense Analyzer Agent details
This is the Instructions for the Expense Analyzer Agent
You are an expense tracking assistant.
- Fetch user transactions from DynamoDB using the provided user name.
- If the user provides their name (e.g., "I am Sam") , use it directly as the user ID don't ask for user ID explicitly.
- If no name is provided, ask for clarification before proceeding.
- Categorize expenses into essential and non-essential spending from data.
- Provide a structured response with transaction details.
- Ensure responses are easy to read and summarize spending trends.
Model used : Amazon Nova Micro
โก๏ธThis is mapped to action group which uses the Lambda which fetches Data from DynamoDB
โ Budget Optimizer โ Retrieves budgeting strategies from Bedrock Knowledge Base.
โก๏ธBudget Optimizer Agent details
This is the Instructions for the Budget Optimizer Agent
You are a financial budget optimization expert.
- Retrieve budgeting frameworks from the Knowledge Base.
- Apply financial rules such as 50/30/20 allocation for expenses.
- Suggest areas where users can cut costs.
- Provide estimated savings based on income and expenses.
Model used : Amazon Nova Micro
โก๏ธThis is mapped to the Knowledge base which is created in Bedrock
โ Investment Advisor โ Uses financial data in Knowledge Base for investment planning.
โก๏ธInvestment Advisor agent details
This is the Instructions for the Investment Advisor agent
You are an AI-powered investment advisor.
- Retrieve investment strategies from the Knowledge Base.
- Recommend asset allocation based on risk profile.
- Suggest stocks, bonds, mutual funds, or fixed deposits.
- Provide estimated ROI based on historical market trends.
โก๏ธThis is mapped to a Knoweledge base (Data source)
2๏ธโฃStep 2: Create the Supervisor Agent
โ Supervisor Agent โ The orchestrator that delegates tasks and consolidates responses. Details below,
This is the Instructions for the Investment Advisor agent
You are a financial assistant managing budgets and investments.
- Use the provided user name to retrieve transaction history.
- Invoke the Expense Analyzer to analyze past spending trends.
- Invoke the Budget Optimizer to suggest budget recommendations based on spending patterns.
- Invoke the Investment Advisor to provide investment strategies using estimated savings.
- If the user does not specify their savings, estimate it based on income and expense patterns.
- Assume a moderate risk profile if no risk preference is provided.
- Consolidate responses into a structured financial plan.
Model used : Amazon Nova Micro
โ Enable Multi-Agent Collaboration
โ Set up agent Collaborator
An agent in the multi-agent collaboration that orchestrates and returns a final response.
3๏ธโฃStep 3: Prepare & Test all the Agents individually
4๏ธโฃ Deploy and Test
Run test queries to validate agent interactions.
๐ About Data : Understanding the Datasets Used by Sub-Agents
Each sub-agent in this Multi-Agent Collaboration project relies on different datasets to function effectively:
โ Expense Analyzer (DynamoDB Transactions Data) โ Fetches user transactions from DynamoDB, including details like amount, category, date, merchant, and payment method.
โ Budget Optimizer (Knowledge Base PDFs) โ Retrieves budgeting strategies from an Amazon S3-based Knowledge Base, containing guides on budgeting models like the 50/30/20 Rule.
โ Investment Advisor (Knowledge Base PDFs) โ Uses investment research, risk profiles, and asset allocation strategies stored in Amazon S3 to provide investment recommendations.
By integrating DynamoDB for transactional data and S3-based Knowledge Bases for financial insights, AWS Bedrock agents can deliver accurate budgeting and investment strategies, making AI-driven financial decision-making seamless.
S3 Bucket data :
DyanmoDB data :
๐ Example Queries & Expected Results
๐ Trying these queries in AWS Bedrock Console:
Query 1: Expense Analysis Only
๐ Question: I am Sam. Analyze my spending, show top 5.
Since the query only asks for top 5 expenses, Uses only Expense Analyzer to fetch and categorize transactions.
Query 2: Full Financial Insights (All Three Agents)
๐ Question: I am Sam. Show my top 5 expenses, analyze my spending, and suggest a budget. Also, recommend investments based on my savings.
This query engages all three agents:
โ
Expense Analyzer โ Fetches spending data.
โ
Budget Optimizer โ Suggests budget recommendations.
โ
Investment Advisor โ Provides investment strategies based on savings.
๐ Multi-Agent Collaboration Trace: This scenario demonstrates how AWS Bedrock enables agents to communicate efficiently, delegating tasks and consolidating insights into a structured financial response.
Query 3: Expense & Budget Optimization (Without Investment Advice)
**๐ Question:**I am John. Show my top 5 expenses, analyze my spending, and suggest a budget.
This query engages only two agents:
โ
Expense Analyzer โ Retrieves and categorizes expenses.
โ
Budget Optimizer โ Uses financial best practices to suggest budget allocations.
Since investment recommendations are not requested, the Investment Advisor Agent is not invoked, showing how Bedrock dynamically optimizes agent interactions based on user intent.
๐ก Why These Queries Matter?
Showcases how AWS Bedrock dynamically selects relevant agents based on query complexity.
Highlights multi-agent orchestration in real-world financial scenarios.
Provides clear trace insights into agent collaboration efficiency.
๐Key Takeaways
๐ก Learnings from This Project
โ
Multi-Agent Collaboration in AWS Bedrock improves scalability, efficiency, and automation by dynamically distributing tasks across specialized agents.
โ
A Supervisor Agent streamlines complex workflows by managing Expense Analyzer, Budget Optimizer, and Investment Advisor interactions.
โ
DynamoDB and S3-based Knowledge Bases provide structured, real-time financial data for accurate recommendations.
โ
AWS Lambda and API Gateway enable seamless integration, allowing agents to be accessed via external APIs.
โ
Testing and trace analysis help fine-tune agent collaboration, ensuring optimal task delegation.
This project highlights how Multi-Agent AI can automate financial decision-making while maintaining flexibility and adaptability. ๐
๐ Conclusion
AWS Bedrockโs Multi-Agent Collaboration streamlines complex workflows by enabling specialized agents to work together efficiently. This project demonstrated how AI agents can automate financial decision-making, integrating Bedrock, Lambda, and S3 into a scalable AI system.
๐ก Start exploring AWS Bedrockโs Multi-Agent AI today! ๐
๐ Letโs Connect!
๐ GitHub Repo: https://github.com/SridharSampath/multi-agent-collaboration.git
๐ LinkedIn: Connect with me
๐ References: (Include AWS Blogs, YouTube Videos, etc.)
๐น AWS Blog: Multi-Agent Orchestration with AWS Bedrock & Open Source Frameworks
๐ https://aws.amazon.com/blogs/machine-learning/design-multi-agent-orchestration-with-reasoning-using-amazon-bedrock-and-open-source-frameworks/
๐นAWS Announcement: Multi-Agent Collaboration for AWS Bedrock
๐ https://aws.amazon.com/blogs/aws/introducing-multi-agent-collaboration-capability-for-amazon-bedrock/
๐น YouTube: Multi-Agent AI for Scalable Generative AI
๐ https://www.youtube.com/watch?v=7pvEYLW1yZw&t=3151s
๐น YouTube: AWS Bedrock Multi-Agent Demo
๐ https://www.youtube.com/watch?v=tMqTy1HR974&t=67s
๐ฌ Let me know your thoughts in the comments! ๐