Building an AI-Powered Assistant for Investment Research with Multi-Agent Collaboration in Amazon Bedrock
Financial analysts constantly juggle various data formats—from structured time-series pricing info to unstructured texts like SEC filings, and even audio or video from earnings calls. Each data type demands specialized tools and approaches, leading to workflow inefficiencies. Add tight time constraints, and delayed insights can result in missed opportunities or overlooked risks, impacting financial outcomes.
AI assistants can boost efficiency by automating routine data collection and surfacing key insights, letting analysts focus on higher-value tasks. However, a single AI agent often struggles with the complexity and variety of tasks involved in investment research. Multi-agent collaboration offers a solution: specialized AI subagents handle distinct tasks, coordinated by a supervisor agent that decomposes complex queries, delegates work, and synthesizes results—much like a real-world research team.
Why Multi-Agent Collaboration Matters
- Distributed problem-solving and expertise: Each subagent focuses on a specific area, improving accuracy and depth.
- Scalability: New agents and capabilities can be added without rebuilding the system.
- Transparency: The reasoning process of each agent is trackable and verifiable.
Amazon Bedrock Agents leverages foundation models, APIs, and data to break down requests and complete tasks efficiently. Its multi-agent collaboration feature allows building, deploying, and managing multiple AI agents working together on complex workflows that require specialized skills.
Key Components of the Investment Research Assistant
The solution includes a supervisor agent and three subagents:
- Quantitative Analysis Agent: Uses stock-query and portfolio-optimization tools to analyze historical stock data and optimize portfolio allocations based on user inputs.
- News Agent: Retrieves financial data such as earnings reports and filings from a knowledge base or the web. It analyzes company financials, performance drivers, and management commentary.
- Smart Summarizer Agent: Synthesizes outputs from other agents, summarizing long texts into concise investment insights without custom action groups.
How Multi-Agent Collaboration Works
- The user submits a high-level investment research query.
- The supervisor agent breaks it into subtasks and coordinates the subagents, invoking them in parallel or sequence:
- News agent retrieves financial reports or data.
- Quantitative analysis agent processes stock data.
- Smart summarizer condenses lengthy documents.
- The supervisor consolidates outputs with the original query context.
- The combined information is fed to a large language model (LLM) that generates the final investment insights.
This design leverages the strengths of each specialized agent to cover all facets of investment research, while the supervisor ensures smooth orchestration.
Technical Architecture Overview
The architecture uses these main components:
- Amazon Bedrock Data Automation (BDA): Processes unstructured multimodal content like documents, images, audio, and video, serving as a parser for building knowledge bases used in Retrieval Augmented Generation (RAG) workflows.
- Subagents: Built with specialized Lambda tools for specific tasks such as fetching historical stock data or portfolio optimization.
- Supervisor Agent: Coordinates subagents, manages collaboration, and synthesizes results using foundation models.
Example of invoking a BDA job asynchronously with Python:
bda_response = bda_runtime_client.invoke_data_automation_async(
inputConfiguration={"s3Uri": s3_uri_input},
outputConfiguration={"s3Uri": s3_uri_output},
)
Sample code to create a quantitative analysis subagent:
quantitative_analysis_agent = Agent.create(
name="quantitative_analysis_agent",
role="Financial Data Collector",
goal="Retrieve real-time and historic stock prices as well as optimize portfolios.",
instructions="""Specialist in financial data extraction and portfolio optimization.""",
tools=[{...}], # Lambda tools for stock data and portfolio optimization
llm=LLM,
)
Creating the supervisor agent that manages subagents:
investment_research_assistant = SupervisorAgent.create(
"investment_research_assistant",
role="Investment Research Assistant",
goal="Coordinate specialized agents to provide structured stock investment analysis.",
collaboration_type="SUPERVISOR",
instructions="""You oversee multiple specialized agents to create comprehensive investment insights.""",
collaborator_agents=[...], # Definitions for news_agent, quantitative_analysis_agent, smart_summarizer_agent
collaborator_objects=[news_agent, quantitative_analysis_agent, smart_summarizer_agent],
llm=LLM,
)
Invoking the supervisor agent with a user query:
request = "What's AMZN stock price doing over the last week and relate that to recent news"
result = investment_research_assistant.invoke(request, enable_trace=True, trace_level="core")
print(result)
Prerequisites and Setup
To deploy this solution, ensure your execution role has permissions for Amazon Bedrock, AWS Lambda, Amazon OpenSearch Serverless, Amazon S3, and AWS IAM. Deploy AWS CloudFormation stacks for web_search and stock_data. For detailed setup, consult the README in the investment_research_agent GitHub repository.
Further Exploration
The GitHub repository provides a full end-to-end solution, including:
- Supervisor and subagent setup
- Action groups and tools
- Handling unstructured data like earnings reports and call audio
- Processing structured stock time-series data
The appendix includes examples of financial analyst queries, subagent usage, and final responses from the assistant, illustrating practical applications.
Cleanup Instructions
To avoid charges after testing, delete all agents, knowledge bases, and related OpenSearch Serverless instances. Remove the web_search and stock_data CloudFormation stacks. A notebook in the GitHub repo offers cleanup guidance.
Conclusion
This multi-agent investment research assistant showcases how AI can enhance financial analysis by dividing complex workflows among specialized agents coordinated by a supervisor. This approach handles diverse data types and multistep tasks more effectively than single-agent systems.
The architecture suits various financial applications, including equity research, portfolio management, risk assessment, and compliance. Leveraging Amazon Bedrock foundation models, Amazon S3, OpenSearch Serverless, and Lambda functions, the serverless design offers scalability and grounded insights via knowledge base integration.
Explore building your own multi-agent investment assistant by accessing the solution code and implementation details on GitHub. Customize subagents and action groups to fit your research needs and securely integrate your data with Amazon Bedrock Knowledge Bases.
Related Resources
- AI Tools for Finance — A curated list of AI applications tailored for financial professionals.
- Prompt Engineering Courses — Improve your ability to craft effective AI prompts for better results.
Appendix: Sample Analyst Queries and AI Responses
- Analyze Amazon’s financial health based on the 2024 10-K report:
- Subagents involved: news_agent, smart_summarizer_agent
- Process: Retrieve 10-K data, summarize key financial ratios, and calculate metrics
- Response: Highlights strong financial health with solid assets, cash position, profitability, and efficient operations.
- Identify main drivers of AWS revenue growth in Q1 2023:
- Subagents involved: news_agent, smart_summarizer_agent
- Process: Retrieve earnings report, synthesize growth factors
- Response: Growth driven by cloud adoption with $21.4B net sales, 16% YoY growth, tempered by customer spending optimization.
- Outline Amazon’s priorities and risks for 2024:
- Subagents involved: news_agent, smart_summarizer_agent
- Process: Retrieve strategic and risk info from knowledge base and web search
- Response: Focus on expanding retail segments, healthcare initiatives, satellite connectivity; risks include AI capex, regulatory scrutiny, tariffs, and competition.
- Optimize a portfolio with tickers AAA, BBB, and CCC:
- Subagent involved: quantitative_analysis_agent
- Process: Fetch historical stock data and run portfolio optimization
- Response: Recommended allocation optimizing risk-adjusted returns (e.g., AAA: 61.04%, BBB: 32.54%, CCC: 6.42%).
Your membership also unlocks: