The Investment Advisor Multi-Agent System is a sophisticated, production-ready AI-powered investment advisory platform that leverages multiple specialized agents orchestrated through LangGraph to provide comprehensive stock analysis and investment recommendations. The system integrates GROQ for large language model (LLM) inference, Yahoo Finance for financial data retrieval, DuckDuckGo for news aggregation, and a modular agent architecture for scalable, intelligent investment decision support. The platform supports both a modern Streamlit web interface and a comprehensive command-line interface (CLI), enabling flexible, secure, and extensible investment analysis workflows.
The complexity of modern financial markets and the need for data-driven investment decisions has created a demand for intelligent systems that can analyze vast amounts of financial data, news, and market information. The Investment Advisor Multi-Agent System addresses this by combining specialized AI agents with advanced LLM capabilities, providing both individual investors and financial professionals with powerful tools for comprehensive stock analysis, risk assessment, and investment recommendations.
The Investment Advisor system is organized into five main architectural layers:
Figure 1: High-level system architecture showing all major components and their relationships
The system employs a multi-agent architecture where each agent specializes in specific aspects of investment analysis:
The system uses LangGraph to orchestrate agent interactions through a directed graph workflow:
Figure 2: LangGraph workflow orchestration showing agent interaction sequence and data flow
The workflow follows this pattern:
News Agent → Data Agent → Analyst Agent → Financial Expert Agent
↓ ↓ ↓ ↓
News Data → Financial → Analysis → Recommendation
Figure 3: Data flow sequence showing the end-to-end process from document ingestion to query response
Agents communicate through structured data exchange:
.env
file.env
is git-ignored; .env.example
is provided for onboardingconfig/settings.py
.env
file overridesFigure 4: Extensibility diagram showing pluggable components and configuration-driven architecture
analyze
, status
, help
Figure 5: Deployment architecture showing various hosting and scaling options
python main.py analyze AAPL 🚀 Starting investment analysis for AAPL... 🚀 Starting investment analysis for AAPL... 🔍 Initializing multi-agent system... ⚡ Executing analysis workflow... ✅ Analysis completed successfully! ⏱️ Execution time: 11.30 seconds 📁 Generated output files: 📄 Analysis: outputs\analysis\AAPL_Analysis_20250901_141905.md 📄 Recommendation: outputs\recommendations\AAPL_Recommendation_20250901_141905.md
The system generates comprehensive analysis and recommendation reports. Below are sample outputs from a recent AAPL (Apple Inc.) analysis:
# Investment Analysis Report: AAPL Generated on: 2025-09-01 14:19:05 ## Company Information - **Company Name**: Apple Inc. - **Sector**: Technology - **Industry**: Consumer Electronics - **Country**: United States ## Current Market Data - **Current Price**: $232.14 - **Market Cap**: $3,445,050,310,656 - **Volume**: 39,418,437 ## News and Market Sentiment - **Market Sentiment**: Positive - **Key Developments**: - Apple Inc. ( AAPL ) Stock Price, News , Quote & History - Yahoo Finance - Apple Stock Chart — NASDAQ: AAPL Stock Price — TradingView - AAPL Stock Price | Apple Inc. Stock Quote... | MarketWatch ## Financial Analysis - **Financial Health**: Moderate - Limited data available - **Growth Trends**: Stable - Insufficient data for trend analysis - **Key Metrics**: - Financial Analysis Report: Apple Inc. (AAPL)** - Company Information:** - Name: Apple Inc. - Sector: Technology - Industry: Consumer Electronics ## Comprehensive Analysis ### Key Insights - Comprehensive Investment Analysis: Apple Inc. (AAPL)** - Executive Summary** - Company Overview** - Business Model and Market Position** - Sector and Industry Context** ### Full Analysis (LLM) **Comprehensive Investment Analysis: Apple Inc. (AAPL)** **Executive Summary** Apple Inc. (AAPL) is a multinational technology company that designs, manufactures, and markets consumer electronics, computer software, and online services. Our analysis suggests that AAPL is a stable and moderately growing company with a strong market position in the consumer electronics sector. The company's innovative products, such as iPhones, Macs, iPads, and Apple Watches, have contributed to its success. However, limited financial data and insufficient growth trend analysis indicate a need for caution. Overall, we assess AAPL as a moderately attractive investment opportunity with a stable growth outlook. **Company Overview** **Business Model and Market Position** Apple Inc. operates in the consumer electronics sector, with a strong market position in the global smartphone market. The company's business model is centered around designing, manufacturing, and marketing innovative products that provide a seamless user experience. Apple's ecosystem, which includes the App Store, Apple Music, and iCloud, has contributed to its success and customer loyalty. **Sector and Industry Context** The consumer electronics sector is highly competitive, with major players such as Samsung, Huawei, and Google. However, Apple's strong brand recognition, innovative products, and ecosystem have enabled it to maintain a market share of around 20% in the global smartphone market. **Financial Analysis** **Key Financial Metrics and Trends** | Metric | 2022 | 2023 (Est.) | | --- | --- | --- | | Revenue | $365.7B | $384.5B | | Net Income | $94.7B | $103.5B | | Gross Margin | 38.3% | 39.5% | | Operating Margin | 24.4% | 25.5% | AAPL's revenue and net income have grown steadily over the past few years, driven by the success of its iPhone and services segments. However, the company's gross margin and operating margin have declined slightly due to increased competition and rising costs. **Financial Health Assessment** AAPL's financial health is moderate, with a debt-to-equity ratio of 0.73 and a current ratio of 1.35. The company's cash and cash equivalents balance has increased to $193.6B, providing a cushion against potential downturns. **Growth Prospects and Challenges** AAPL's growth prospects are stable, driven by the continued demand for its innovative products and services. However, the company faces challenges from increasing competition, rising costs, and regulatory pressures. **News and Market Sentiment** **Recent Developments and Their Impact** AAPL's stock price has been positively impacted by recent developments, including the launch of its new iPhone 14 series and the expansion of its services segment. Market sentiment is positive, with a sentiment score of 0.75 on Yahoo Finance. **Market Sentiment Analysis** AAPL's market sentiment is driven by its strong brand recognition, innovative products, and ecosystem. However, the company's stock price is also sensitive to changes in the global smartphone market and regulatory pressures. **Key Catalysts to Watch** 1. Launch of new iPhone series 2. Expansion of services segment 3. Regulatory developments **Risk Assessment** **Primary Risk Factors** 1. Increasing competition from Samsung, Huawei, and Google 2. Regulatory pressures from governments and regulatory bodies 3. Rising costs and supply chain disruptions **Market and Company-Specific Risks** 1. Economic downturns and recessions 2. Changes in consumer behavior and preferences 3. Intellectual property disputes and lawsuits **Risk Mitigation Factors** 1. Diversification of revenue streams through services segment 2. Strong brand recognition and customer loyalty 3. Continuous innovation and product development **Investment Thesis** **Bull Case Arguments** 1. Continued demand for AAPL's innovative products and services 2. Expansion of services segment and revenue diversification 3. Strong brand recognition and customer loyalty **Bear Case Arguments** 1. Increasing competition from Samsung, Huawei, and Google 2. Regulatory pressures and potential disruptions 3. Rising costs and supply chain disruptions **Neutral Considerations** 1. Limited financial data and insufficient growth trend analysis 2. Moderate financial health and debt-to-equity ratio **Conclusion** AAPL is a moderately attractive investment opportunity with a stable growth outlook. The company's strong brand recognition, innovative products, and ecosystem have contributed to its success. However, increasing competition, regulatory pressures, and rising costs pose risks to the company's growth prospects. We recommend a cautious approach, with a focus on monitoring key catalysts and risk factors. **Key Factors Driving the Recommendation** 1. Strong brand recognition and customer loyalty 2. Diversification of revenue streams through services segment 3. Continuous innovation and product development **Rating** We assign a rating of 3.5 out of 5, indicating a moderately attractive investment opportunity with a stable growth outlook. **Recommendation** We recommend a buy rating for AAPL, with a target price of $180. However, investors should be aware of the risks and challenges facing the company and monitor key catalysts and risk factors closely. ## News Analysis (LLM) **AAPL (Apple Inc.) Analysis** **Company Overview Summary:** Apple Inc. (AAPL) is a multinational technology company that designs, manufactures, and markets consumer electronics, computer software, and online services. The company is known for its innovative products such as iPhones, Macs, iPads, and Apple Watches. Apple's mission is to bring the best user experience to its customers through its innovative products and services. **Key News Highlights and Their Potential Impact:** 1. **Daiwa Capital's Rating:** Daiwa Capital has assigned a rating of 76/100 with a direction score of "Outperform" to AAPL. This suggests that the analyst expects the stock to perform well in the near future. 2. **Recent Stock Price Movement:** The recent stock price movement is not explicitly mentioned in the provided information. However, it is essential to monitor the stock's price action to understand its current market sentiment. **Market Sentiment Indicators:** 1. **Rating:** Daiwa Capital's rating of 76/100 with a direction score of "Outperform" indicates a positive market sentiment towards AAPL. 2. **Market Predictions:** TradingView provides live market predictions for AAPL, which can be used to gauge market sentiment. **Important Developments to Watch:** 1. **Product Launches:** Apple is known for its innovative product launches, which can significantly impact its stock price. Investors should keep an eye on upcoming product launches and their potential impact on the company's financial performance. 2. **Earnings Reports:** Apple's quarterly earnings reports can provide valuable insights into the company's financial performance and future prospects. Investors should monitor the company's earnings reports to understand its growth trajectory. 3. **Industry Trends:** The technology industry is rapidly evolving, and Apple must adapt to these changes to maintain its market share. Investors should monitor industry trends and their potential impact on AAPL's stock price. **Additional Recommendations:** 1. **Monitor Financial Performance:** Investors should closely monitor Apple's financial performance, including its revenue growth, profit margins, and cash flow. 2. **Stay Informed about Regulatory Developments:** Apple operates in a highly regulated industry, and changes in regulations can impact its business. Investors should stay informed about regulatory developments that may affect AAPL's stock price. 3. **Diversify Your Portfolio:** As with any investment, it is essential to diversify your portfolio to minimize risk. Investors should consider investing in a mix of stocks, bonds, and other assets to achieve their investment goals. ## Financial Analysis (LLM) **Financial Analysis Report: Apple Inc. (AAPL)** **Company Information:** - Name: Apple Inc. - Sector: Technology - Industry: Consumer Electronics **Current Market Data:** - Current Price: $232.14 - Previous Close: $232.56 - Volume: 39,418,437 **Financial Summary:** - Current Price: $232.14 - Market Cap: $3,445,050,310,656 **1. Key Financial Metrics and Interpretation:** | Metric | Value | Interpretation | | --- | --- | --- | | Revenue Growth Rate (YoY) | 9.1% | Strong revenue growth, indicating increasing demand for Apple's products and services. | | Gross Margin | 38.3% | High gross margin, indicating efficient cost management and pricing strategies. | | Operating Margin | 24.1% | Strong operating margin, indicating effective cost management and operational efficiency. | | Return on Equity (ROE) | 123.1% | High ROE, indicating strong profitability and efficient use of shareholder equity. | | Debt-to-Equity Ratio | 0.07 | Low debt-to-equity ratio, indicating a conservative capital structure and low risk. | **2. Financial Health Assessment:** Based on the key financial metrics, Apple Inc. appears to be in a strong financial position. The company has a high gross margin, operating margin, and ROE, indicating efficient cost management and operational efficiency. The low debt-to-equity ratio suggests a conservative capital structure and low risk. However, the revenue growth rate has slowed down slightly, indicating potential challenges in the future. **3. Growth Trends and Patterns:** | Metric | Value | Trend | | --- | --- | --- | | Revenue Growth Rate (YoY) | 9.1% | Declining slightly from 10.2% in the previous quarter | | Gross Margin | 38.3% | Stable over the past two quarters | | Operating Margin | 24.1% | Increasing slightly from 23.5% in the previous quarter | | Return on Equity (ROE) | 123.1% | Increasing slightly from 119.1% in the previous quarter | The revenue growth rate has slowed down slightly, indicating potential challenges in the future. However, the gross margin and operating margin have remained stable, and the ROE has increased slightly, indicating strong profitability and efficient use of shareholder equity. **4. Risk Factors and Concerns:** - **Competition:** Apple faces intense competition in the consumer electronics market, which may impact revenue growth and market share. - **Supply Chain Disruptions:** Apple's supply chain is vulnerable to disruptions, which may impact production and revenue. - **Regulatory Risks:** Apple faces regulatory risks related to data privacy and security, which may impact revenue and profitability. **5. Strengths and Opportunities:** - **Strong Brand:** Apple has a strong brand reputation, which drives customer loyalty and demand for its products and services. - **Innovative Products:** Apple continues to innovate and launch new products and services, which may drive revenue growth and market share. - **Growing Services Segment:** Apple's services segment, including Apple Music and Apple TV+, is growing rapidly, which may drive revenue growth and profitability. **Data Quality Issues:** - The revenue growth rate has slowed down slightly, indicating potential challenges in the future. - The gross margin and operating margin have remained stable, but may be impacted by changes in the competitive landscape or regulatory risks. **Recommendations:** - Continue to monitor Apple's revenue growth rate and gross margin for signs of improvement or decline. - Assess the impact of regulatory risks on Apple's revenue and profitability. - Evaluate the growth potential of Apple's services segment and its impact on revenue growth and profitability.
# Investment Recommendation: AAPL Generated on: 2025-09-01 14:19:05 ## Investment Recommendation **RECOMMENDATION**: BUY **Current Price**: $232.14 **Confidence Level**: Medium **Target Price**: $245-$255 **Time Horizon**: Medium-term (6-12 months) ## Key Factors - Positive News Sentiment**: The company's recent announcements and product launches have generated significant buzz, indicating a strong demand for its products. - Stable Growth Trends**: Although growth trends are stable, Apple's diversified product portfolio and expanding services segment provide a solid foundation for future growth. - Moderate Financial Health**: Apple's financial health is moderate, with a strong balance sheet and a history of generating significant cash flows. - Industry Leadership**: Apple's position as a leader in the consumer electronics industry provides a competitive advantage and a stable revenue stream. - Competition from Emerging Players**: The rise of new players in the consumer electronics industry could potentially disrupt Apple's market share. ## Full Recommendation (LLM) **Investment Recommendation: Apple Inc. (AAPL)** **1. RECOMMENDATION: BUY** **Confidence Level: Medium (60%)** **Target Price Range: $245-$255 (5-10% upside)** **Investment Time Horizon: 6-12 months** **2. Reasoning** Based on our comprehensive analysis, we recommend buying Apple Inc. (AAPL) due to the following key factors: - **Positive News Sentiment**: The company's recent announcements and product launches have generated significant buzz, indicating a strong demand for its products. - **Stable Growth Trends**: Although growth trends are stable, Apple's diversified product portfolio and expanding services segment provide a solid foundation for future growth. - **Moderate Financial Health**: Apple's financial health is moderate, with a strong balance sheet and a history of generating significant cash flows. - **Industry Leadership**: Apple's position as a leader in the consumer electronics industry provides a competitive advantage and a stable revenue stream. **Primary Drivers of the Decision**: Our recommendation is driven by the company's ability to innovate, its strong brand recognition, and its expanding services segment. **How News and Financial Data Align**: The positive news sentiment and stable growth trends align with Apple's financial health and industry leadership, providing a solid foundation for our recommendation. **3. Risk Assessment** **Primary Risks to the Recommendation**: - **Competition from Emerging Players**: The rise of new players in the consumer electronics industry could potentially disrupt Apple's market share. - **Regulatory Risks**: Changes in regulations or trade policies could impact Apple's global supply chain and revenue. - **Economic Downturn**: A global economic downturn could reduce consumer spending on electronics. **Risk Mitigation Strategies**: - **Diversification**: Spread investments across different asset classes and sectors to minimize exposure to any one company or industry. - **Regular Portfolio Reviews**: Monitor the portfolio regularly to adjust positions and mitigate risks. **What Could Change the Recommendation**: - **Significant Decline in Sales**: A significant decline in sales could indicate a shift in consumer preferences or a decline in demand for Apple's products. - **Major Regulatory Changes**: Changes in regulations or trade policies could impact Apple's global supply chain and revenue. **4. Investment Strategy** **Suggested Entry/Exit Points**: - **Entry Point**: Buy AAPL when the stock price falls to $220-$225. - **Exit Point**: Sell AAPL when the stock price reaches $255 or if the company announces a significant decline in sales. **Position Sizing Considerations**: - **Initial Position Size**: 5-10% of the portfolio. - **Risk Management**: Adjust position size based on market conditions and risk tolerance. **Portfolio Fit and Diversification**: - **Sector Allocation**: AAPL is a technology stock, which is a significant sector in the market. Consider diversifying the portfolio across different sectors. - **Asset Allocation**: Consider allocating a portion of the portfolio to other asset classes, such as bonds or real estate, to minimize risk. **5. Monitoring Points** **Key Metrics to Watch**: - **Revenue Growth**: Monitor Apple's revenue growth to ensure it remains stable and increasing. - **Gross Margin**: Monitor Apple's gross margin to ensure it remains healthy and increasing. - **Cash Flow**: Monitor Apple's cash flow to ensure it remains strong and increasing. **Events that Could Impact the Recommendation**: - **Product Launches**: Monitor Apple's product launches to ensure they are well-received by consumers. - **Earnings Reports**: Monitor Apple's earnings reports to ensure they are meeting expectations. - **Regulatory Changes**: Monitor regulatory changes that could impact Apple's global supply chain and revenue. **Review Timeline**: - **Quarterly Reviews**: Review the portfolio quarterly to adjust positions and mitigate risks. - **Annual Reviews**: Review the portfolio annually to rebalance the portfolio and adjust positions. **6. Alternative Scenarios** **Bull Case Outcome**: - **AAPL Stock Price**: $300-$350 (30-50% upside) - **Revenue Growth**: 15-20% YoY - **Gross Margin**: 40-45% **Bear Case Outcome**: - **AAPL Stock Price**: $150-$180 (30-20% decline) - **Revenue Growth**: 0-5% YoY - **Gross Margin**: 30-35% **Base Case Expectations**: - **AAPL Stock Price**: $245-$255 (5-10% upside) - **Revenue Growth**: 5-10% YoY - **Gross Margin**: 35-40% This investment recommendation is based on our comprehensive analysis of Apple Inc. (AAPL). We believe that the company's positive news sentiment, stable growth trends, and moderate financial health provide a solid foundation for our recommendation. However, we also acknowledge the primary risks to the recommendation, including competition from emerging players, regulatory risks, and economic downturn. We recommend buying AAPL with a medium confidence level and a target price range of $245-$255.
Explore the full source code and architecture here. https://github.com/bsoberoi/Investment-Advisor
Baljit Oberoi is a Technical Project/Program Management Consultant with extensive experience delivering solutions in Data, Analytics, and AI. He is an AI enthusiast with a strong interest in exploring how Deep Learning can be applied to predict financial market movements.
For implementation details, see the codebase and README.