Loading repository data…
Loading repository data…
gsaini / repository
The Financial Research Analyst Agent is a hierarchical multi-agent system that provides comprehensive stock analysis by coordinating 11 specialized AI agents, 20+ analysis tools, a RAG knowledge pipeline, and a multi-provider data layer — all accessible through a Streamlit web app, REST API, and CLI.
An AI-powered autonomous agent that automates financial data analysis and generates investment insights using LangChain, Python, and multi-agent orchestration.
Features • Architecture • Installation • Usage • API Reference • Contributing
The Financial Research Analyst Agent is an end-to-end AI solution designed to automate financial data analysis and insight generation. Built with LangChain and Python, this agent leverages multiple specialized sub-agents to:
| Attribute | Description |
|---|---|
| Objective | Leverage AI agent capabilities to automate data analysis and insight generation, enhancing the speed and quality of investment decision-making |
| Domain | Finance, Investment Analysis, Automation |
| Skills | AI Agents, Data Analysis, Investment Decision-Making, LangChain, Python |
| Complexity | Advanced |
| Duration | 4-6 weeks implementation |
Traditional financial research is:
This AI agent system addresses these challenges by:
| Feature | Description |
|---|---|
| 🤖 Multi-Agent Architecture | Specialized agents for different analysis tasks |
| 📊 Real-time Data Analysis | Live market data processing and analysis |
| 📈 Technical Analysis | Automated chart pattern and indicator analysis |
| 📰 News Sentiment Analysis | AI-powered sentiment scoring (FinBERT/VADER), trends & volume tracking |
| 🎯 Thematic Investing Analysis | Group stocks by investment themes (AI, EV, Green Energy, etc.) |
| 👥 Peer Group Comparison | Compare stocks against industry peers with real-time metrics |
| 🚀 Market Disruption Analysis | Identify disruptors and companies at risk of disruption |
| 📅 Quarterly Earnings Analysis | Track EPS surprises, beat/miss patterns, and earnings quality |
| 📉 Performance Tracking | Multi-horizon returns, benchmark comparison & drawdown analysis |
| 📅 Event-Driven Performance | Post-earnings price reactions, ±5 day windows, and surprise correlation |
| 🔄 Backtesting Engine | Simulate trading strategies against historical data with trade logs |
| 🔍 Key Observations | Cross-dimensional insights, confluences, anomalies & ranked signals |
| 👤 Insider & Institutional | Track insider transactions, institutional holdings & smart money score |
| 📊 Options Flow Analysis | Put/Call ratios, implied volatility skew, max pain & unusual activity |
| 📑 Report Generation | PDF & Excel reports with executive summary, deep dive templates |
| 🧠 RAG Document Intelligence | Ingest & query SEC filings (10-K, 10-Q, 8-K) and earnings transcripts |
| 🔄 ReAct Multi-Step Reasoning | Agents think step-by-step with few-shot examples and confidence scoring |
| 🗃️ Multi-Provider Data | YFinance + FMP + Alpha Vantage with automatic fallback & validation |
| # | Agent | Key Capabilities |
|---|---|---|
| 1 | Data Collector | Multi-provider data gathering (YFinance, FMP, Alpha Vantage) with auto-fallback |
| 2 | Technical Analyst | RSI, MACD, Bollinger, patterns + ML price forecasting + anomaly/regime detection |
| 3 | Fundamental Analyst | Valuation, DCF (3-scenario), peer comparison, SEC filings via RAG, macro context |
| 4 | Sentiment Analyst | News + Reddit social sentiment, analyst ratings, earnings transcript tone |
| 5 | Risk Analyst | VaR/CVaR, Monte Carlo (10K paths), beta, drawdown, rate environment context |
| 6 | Thematic Analyst | Investment themes (AI, EV, Green Energy), momentum & health scoring |
| 7 | Disruption Analyst | R&D intensity, disruption scoring, disruptor vs at-risk classification |
| 8 | Earnings Analyst | EPS surprises, beat/miss patterns, earnings quality scoring |
| 9 | Performance Analyst | Multi-horizon returns, benchmark comparison, Sharpe/Sortino/Beta |
| 10 | Report Generator | PDF & Excel reports, executive summaries, multi-agent insight aggregation |
| 11 | Orchestrator | Cross-agent conflict detection, RAG document ingestion, confidence scoring |
┌──────────────────────────────────────────────────────────────────────────────────┐
│ FINANCIAL RESEARCH ANALYST AGENT │
├──────────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
│ │ ORCHESTRATOR AGENT │ │
│ │ • Task Planning & Decomposition • Agent Coordination • Aggregation │ │
│ └────────────────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────┬───────────┼───────────┬───────────────┐ │
│ │ │ │ │ │ │
│ ┌────────▼───────┐ ┌─────▼─────┐ ┌───▼───┐ ┌────▼────┐ ┌────────▼───────┐ │
│ │ DATA COLLECTOR │ │ TECHNICAL │ │ FUNDA │ │ SENTI- │ │ RISK │ │
│ │ AGENT │ │ ANALYST │ │ MENTAL│ │ MENT │ │ ANALYST AGENT │ │
│ │ │ │ AGENT │ │ AGENT │ │ AGENT │ │ │ │
│ │ • YFinance │ │ • RSI │ │ • P/E │ │ • News │ │ • VaR/CVaR │ │
│ │ • FMP │ │ • MACD │ │ • EPS │ │ • Analyst│ │ • Volatility │ │
│ │ • Alpha Vantage│ │ • SMA/EMA │ │ • ROE │ │ • Trans.│ │ • Beta/Sharpe │
| 💡 LLM-Powered Insights | Cross-dimensional synthesis with contradiction detection & historical context |
| 🌍 Macro Economic Data | FRED API: Fed funds, CPI, GDP, unemployment, treasury yields |
| 💬 Social Media Sentiment | Reddit (WSB, r/stocks, r/investing) sentiment + composite scoring |
| 💰 DCF Valuation Model | WACC/CAPM, 3-scenario DCF, 5x5 sensitivity matrix, margin of safety |
| 🤖 ML Price Forecasting | GradientBoosting 30/60/90-day targets with confidence intervals |
| 🔎 Anomaly Detection | Z-score volume/price anomalies, gap events, regime change detection |
| 📐 Portfolio Optimization | Markowitz mean-variance, efficient frontier, risk-parity allocation |
| 📊 Benchmark Comparison | Alpha, beta, tracking error, information ratio, return attribution |
| 🎲 Monte Carlo Simulation | 10K-path GBM for VaR/CVaR, target price probability, portfolio risk |
| 🧬 Factor Modeling | Fama-French style decomposition (market, size, value, momentum, quality) |
| 🏷️ Brinson Attribution | Allocation, selection & interaction effects at sector level |
| 🧮 Tax-Loss Harvesting | Identify harvestable losses, replacement securities, wash sale warnings |
| 🧪 Strategy Optimization | Genetic algorithm parameter tuning with overfitting detection |
| 🔗 Supply Chain Analysis | Map suppliers, customers, competitors with correlation risk scoring |
| 🔔 Real-Time Alerts | Price/volume/RSI/52-week alerts with WebSocket push notifications |
| 📬 Scheduled Reports | Daily/weekly/monthly digests with SMTP email or disk delivery |
| 🌓 Dark/Light Theme | Toggle between Bloomberg-dark and light color modes |
| 📱 Mobile-Responsive UI | Responsive breakpoints at 768px and 480px |
| 🔒 API Security | API key auth, rate limiting, input sanitization (SQL/XSS/injection) |
| 💾 Persistence Layer | SQLAlchemy ORM: watchlists, portfolios, analysis history |
| 🌐 API Integration | REST API + WebSocket for external system integration |
| 📖 Interactive API Docs | Swagger UI & ReDoc with OpenAPI 3.0 specification |
| 📱 Web Dashboard | 13-page interactive visualization dashboard |