An open API service indexing awesome lists of open source software.

https://github.com/gsaini/financial-research-analyst-agent

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.
https://github.com/gsaini/financial-research-analyst-agent

docker fastapi kubernetes langchain numpy ollama pandas postgresql python redis

Last synced: 3 days ago
JSON representation

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.

Awesome Lists containing this project

README

          

# ๐Ÿฆ Financial Research Analyst Agent

![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white)
![LangChain](https://img.shields.io/badge/LangChain-1C3C3C?style=for-the-badge&logo=langchain&logoColor=white)
![Ollama](https://img.shields.io/badge/Ollama-000000?style=for-the-badge&logo=ollama&logoColor=white)
![FastAPI](https://img.shields.io/badge/FastAPI-009688?style=for-the-badge&logo=fastapi&logoColor=white)
![Docker](https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white)
![Kubernetes](https://img.shields.io/badge/Kubernetes-326CE5?style=for-the-badge&logo=kubernetes&logoColor=white)
![PostgreSQL](https://img.shields.io/badge/PostgreSQL-4169E1?style=for-the-badge&logo=postgresql&logoColor=white)
![Redis](https://img.shields.io/badge/Redis-DC382D?style=for-the-badge&logo=redis&logoColor=white)
![Pandas](https://img.shields.io/badge/Pandas-150458?style=for-the-badge&logo=pandas&logoColor=white)
![NumPy](https://img.shields.io/badge/NumPy-013243?style=for-the-badge&logo=numpy&logoColor=white)

**An AI-powered autonomous agent that automates financial data analysis and generates investment insights using LangChain, Python, and multi-agent orchestration.**

[Features](#-features) โ€ข [Architecture](#-architecture) โ€ข [Installation](#-installation) โ€ข [Usage](#-usage) โ€ข [API Reference](#-api-reference) โ€ข [Contributing](#-contributing)

---

## ๐Ÿ“‹ Table of Contents

- [Overview](#-overview)
- [Case Study Details](#-case-study-details)
- [Features](#-features)
- [Architecture](#-architecture)
- [Installation](#-installation)
- [Configuration](#-configuration)
- [Usage](#-usage)
- [Interactive API Documentation](#-interactive-api-documentation)
- [API Reference](#-api-reference)
- [Agent Capabilities](#-agent-capabilities)
- [Sample Analysis](#-sample-analysis)
- [Testing](#-testing)
- [Deployment](#-deployment)
- [Contributing](#-contributing)
- [License](#-license)

---

## ๐ŸŽฏ Overview

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:

- ๐Ÿ“Š **Analyze financial data** from multiple sources
- ๐Ÿ“ˆ **Generate investment insights** with detailed reasoning
- ๐Ÿ” **Perform market research** autonomously
- ๐Ÿ“‘ **Create comprehensive reports** with actionable recommendations
- โšก **Enhance decision-making speed** through automation

---

## ๐Ÿ“š Case Study Details

| 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 |

### Problem Statement

Traditional financial research is:

- **Time-consuming**: Analysts spend 60-80% of time on data gathering
- **Error-prone**: Manual analysis leads to inconsistencies
- **Limited in scope**: Human capacity limits coverage
- **Reactive**: Difficulty in real-time market monitoring

### Solution

This AI agent system addresses these challenges by:

1. **Automating data collection** from multiple financial APIs
2. **Performing real-time analysis** using advanced NLP and ML
3. **Generating actionable insights** with confidence scores
4. **Creating structured reports** for decision-makers

---

## โœจ Features

### Core Capabilities

| 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 |
| ๐Ÿ’ก **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 |

### Agent Types

| # | 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 |

---

## ๐Ÿ— Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 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 โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Auto-fallbackโ”‚ โ”‚ โ€ข ReAct โ”‚ โ”‚ โ€ข RAG โ”‚ โ”‚ โ€ข ReAct โ”‚ โ”‚ โ€ข Drawdown โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ THEMATIC ANALYST AGENT โ”‚ โ”‚ DISRUPTION ANALYST AGENT โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Theme-to-Ticker Mapping โ”‚ โ”‚ โ€ข R&D Intensity Analysis โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Multi-Horizon Performance โ”‚ โ”‚ โ€ข Revenue Growth Acceleration โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Momentum & Health Scoring โ”‚ โ”‚ โ€ข Gross Margin Trajectory โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Correlation & Diversification โ”‚ โ”‚ โ€ข Disruption Score (0-100) โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Sector Overlap Analysis โ”‚ โ”‚ โ€ข Disruptor vs At-Risk Classificationโ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ EARNINGS ANALYST AGENT โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข EPS Actual vs Estimate Tracking โ€ข Quarterly Trend Analysis (QoQ/YoY)โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Beat/Miss Pattern Recognition โ€ข Earnings Quality Scoring (1-10) โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Surprise % Calculation โ€ข Upcoming Earnings Dates โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ PERFORMANCE ANALYST AGENT โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Multi-Horizon Absolute Returns โ€ข Benchmark vs S&P 500/Nasdaq/Sectorโ”‚ โ”‚
โ”‚ โ”‚ โ€ข Sharpe & Sortino Ratios โ€ข Beta & Volatility Analysis โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Rolling 30-Day Returns โ€ข Drawdown & Recovery Analysis โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ SENTIMENT ENGINE โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข FinBERT / VADER Financial Scoring โ€ข Per-Article Confidence Scores โ”‚ โ”‚
โ”‚ โ”‚ โ€ข News Volume & Spike Detection โ€ข Sentiment Trend Analysis โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Topic Extraction โ€ข Source Diversity Assessment โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ RAG DOCUMENT INTELLIGENCE โ”‚ โ”‚ LLM-POWERED INSIGHT ENGINE โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข SEC Filing Ingestion (10-K/Q) โ”‚ โ”‚ โ€ข Cross-Dimensional Synthesis โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Earnings Transcript Search โ”‚ โ”‚ โ€ข Contradiction Detection โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Semantic Chunking & Retrieval โ”‚ โ”‚ โ€ข Historical Context Comparison โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Agent RAG Mixin (optional) โ”‚ โ”‚ โ€ข Watch Items & Catalysts โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ PREDICTIVE MODELS โ”‚ โ”‚ PORTFOLIO ANALYTICS โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข ML Price Forecast (GBM) โ”‚ โ”‚ โ€ข Markowitz Optimization โ”‚ โ”‚
โ”‚ โ”‚ โ€ข DCF Valuation (3 scenarios) โ”‚ โ”‚ โ€ข Monte Carlo Simulation (10K) โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Anomaly Detection (Z-score) โ”‚ โ”‚ โ€ข Fama-French Factor Model โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Strategy Optimizer (GA) โ”‚ โ”‚ โ€ข Brinson Attribution โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ MACRO & ALTERNATIVE DATA โ”‚ โ”‚ AUTOMATION & ALERTS โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข FRED API (rates, CPI, GDP) โ”‚ โ”‚ โ€ข Real-Time Alert Engine (9 types) โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Reddit Sentiment (WSB) โ”‚ โ”‚ โ€ข WebSocket Push Notifications โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Supply Chain Mapping โ”‚ โ”‚ โ€ข Scheduled Report Digests โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Tax-Loss Harvesting โ”‚ โ”‚ โ€ข Email Delivery (SMTP) โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ REPORT GENERATOR AGENT โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ โ€ข PDF / Excel / Markdown / JSON โ€ข Actionable Recommendations โ”‚ โ”‚
โ”‚ โ”‚ โ€ข Executive Summaries โ€ข Multi-Agent Insight Aggregation โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ DATA LAYER โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Vector Store โ”‚ โ”‚ Cache Layer โ”‚ โ”‚ Database โ”‚ โ”‚ Data Valid.โ”‚ โ”‚ Multi- โ”‚ โ”‚
โ”‚ โ”‚ (ChromaDB) โ”‚ โ”‚ (Redis) โ”‚ โ”‚ (PostgreSQL) โ”‚ โ”‚ (Quality) โ”‚ โ”‚ Provider โ”‚ โ”‚
โ”‚ โ”‚ + RAG Embeds โ”‚ โ”‚ โ”‚ โ”‚ + ORM Models โ”‚ โ”‚ + Outliers โ”‚ โ”‚ Fallback โ”‚ โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ + Watchlists โ”‚ โ”‚ + Mkt Hrs โ”‚ โ”‚ + FRED โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Technology Stack

| Component | Technology |
| ------------------- | -------------------------------------------- |
| **AI Framework** | LangChain, LangGraph |
| **LLM** | Ollama (Llama 4, Mistral) / Groq / LM Studio |
| **RAG** | Semantic chunking, ChromaDB, cross-encoder re-ranking |
| **Embeddings** | Sentence Transformers / HuggingFace / Ollama |
| **ML/Forecasting** | scikit-learn (GradientBoosting), NumPy, SciPy |
| **Vector Store** | ChromaDB / Qdrant / Milvus / Weaviate |
| **Data Providers** | YFinance, FMP, Alpha Vantage, FRED, Reddit (auto-fallback) |
| **Backend** | FastAPI + WebSocket, Python 3.14+ |
| **Data Processing** | Pandas, NumPy, SciPy |
| **Visualization** | Plotly, TradingView Lightweight Charts |
| **Frontend** | Streamlit, HTML5, CSS3 (dark/light themes) |
| **Database** | PostgreSQL / SQLite + SQLAlchemy ORM |
| **Caching** | Redis |
| **Reports** | reportlab (PDF), openpyxl (Excel) |
| **Security** | API key auth, rate limiting, input sanitization |

---

## ๐Ÿš€ Installation

### Prerequisites

- Python 3.14 or higher
- pip or conda package manager
- OpenAI API key (or other LLM provider)
- Alpha Vantage API key (optional, for live data)

### Quick Start

```bash
# Clone the repository
git clone https://github.com/gsaini/financial-research-analyst-agent.git
cd financial-research-analyst-agent

# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your API keys

# Run the application
python -m src.main
```

### Docker Installation

```bash
# Build the Docker image
docker build -t financial-analyst-agent .

# Run the container
docker run -p 8000:8000 --env-file .env financial-analyst-agent
```

---

## โš™๏ธ Configuration

### Environment Variables

Create a `.env` file in the root directory:

```env
# LLM Configuration (Open Source by Default)
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama4:latest
LLM_TEMPERATURE=0.1

# Embedding Configuration (Open Source)
EMBEDDING_PROVIDER=sentence-transformers
SENTENCE_TRANSFORMER_MODEL=all-MiniLM-L6-v2

# Financial Data APIs (Yahoo Finance is free, others optional)
DATA_PROVIDER=yfinance # yfinance | fmp | alphavantage
DATA_FALLBACK_PROVIDER=fmp # Auto-fallback if primary fails
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key # Optional
FMP_API_KEY=your_fmp_api_key # Optional (free tier: 250 req/day)
NEWS_API_KEY=your_news_api_key # Optional

# FRED Macroeconomic Data (free key)
FRED_API_KEY=your_fred_api_key # Optional

# Database Configuration
DATABASE_URL=sqlite:///./data/financial_agent.db
REDIS_URL=redis://localhost:6379

# Vector Store (Open Source)
VECTOR_STORE_PROVIDER=chroma
CHROMA_PERSIST_DIR=./data/chroma

# Application Settings
DEBUG=false
LOG_LEVEL=INFO
API_HOST=0.0.0.0
API_PORT=8000

# Security (optional โ€” disabled in dev mode)
# API_KEYS=key1,key2 # Comma-separated API keys
# RATE_LIMIT_REQUESTS=100 # Per-window limit
# RATE_LIMIT_WINDOW_SECONDS=60

# Email Digests (optional)
# SMTP_HOST=smtp.gmail.com
# SMTP_PORT=587
# SMTP_USER=your@email.com
# SMTP_PASSWORD=your_app_password
```

### Agent Configuration

Edit `config/agents.yaml` to customize agent behavior:

```yaml
orchestrator:
max_iterations: 10
timeout_seconds: 300

technical_analyst:
indicators:
- RSI
- MACD
- SMA
- EMA
- Bollinger Bands
lookback_periods: [14, 30, 50, 200]

sentiment_analyst:
sources:
- news
- twitter
- reddit
sentiment_threshold: 0.3
```

---

## ๐Ÿ“– Usage

### Python API

```python
from src.agents import FinancialResearchAgent

# Initialize the agent
agent = FinancialResearchAgent()

# Analyze a single stock
result = agent.analyze("AAPL")
print(result.summary)
print(result.recommendation)
print(result.confidence_score)

# Analyze multiple stocks
portfolio = ["AAPL", "GOOGL", "MSFT", "AMZN"]
portfolio_analysis = agent.analyze_portfolio(portfolio)

# Generate a research report
report = agent.generate_report(
symbols=["AAPL"],
include_technical=True,
include_fundamental=True,
include_sentiment=True,
format="pdf"
)
```

### REST API

```bash
# Analyze a stock
curl -X POST "http://localhost:8000/api/v1/analyze" \
-H "Content-Type: application/json" \
-d '{"symbol": "AAPL", "analysis_type": "comprehensive"}'

# Get technical analysis
curl "http://localhost:8000/api/v1/technical/AAPL"

# Generate report
curl -X POST "http://localhost:8000/api/v1/reports" \
-H "Content-Type: application/json" \
-d '{"symbols": ["AAPL", "GOOGL"], "format": "pdf"}'

# List available investment themes
curl "http://localhost:8000/api/v1/themes"

# Analyze an investment theme
curl -X POST "http://localhost:8000/api/v1/theme/ai_machine_learning" \
-H "Content-Type: application/json" \
-d '{"theme_id": "ai_machine_learning", "include_narrative": false}'

# Compare multiple themes
curl -X POST "http://localhost:8000/api/v1/themes/compare" \
-H "Content-Type: application/json" \
-d '{"theme_ids": ["ai_machine_learning", "cybersecurity", "electric_vehicles"]}'

# Analyze market disruption profile
curl "http://localhost:8000/api/v1/disruption/TSLA"

# Disruption analysis with LLM narrative
curl -X POST "http://localhost:8000/api/v1/disruption/analyze" \
-H "Content-Type: application/json" \
-d '{"symbol": "NVDA", "include_narrative": true}'

# Compare disruption profiles across competitors
curl -X POST "http://localhost:8000/api/v1/disruption/compare" \
-H "Content-Type: application/json" \
-d '{"symbols": ["TSLA", "F", "GM", "TM"], "include_narrative": false}'

# Analyze quarterly earnings
curl "http://localhost:8000/api/v1/earnings/AAPL"

# Earnings analysis with LLM narrative
curl -X POST "http://localhost:8000/api/v1/earnings/analyze" \
-H "Content-Type: application/json" \
-d '{"symbol": "MSFT", "include_narrative": true}'

# Compare earnings profiles across companies
curl -X POST "http://localhost:8000/api/v1/earnings/compare" \
-H "Content-Type: application/json" \
-d '{"symbols": ["AAPL", "MSFT", "GOOGL"], "include_narrative": false}'
```

### Streamlit Dashboard

```bash
# Install frontend dependencies
pip install -r frontend/requirements.txt

# Launch the interactive dashboard (no LLM required)
streamlit run frontend/app.py
```

The dashboard provides 13 interactive pages covering stock analysis, thematic investing, peer comparison, market disruption, quarterly earnings, portfolio analysis, reports, financial news, historical performance, AI-powered sentiment, ETF screening, and macroeconomic data โ€” with dark/light theme toggle and mobile-responsive layout.

### Command Line Interface

```bash
# Quick analysis
python -m src.cli analyze AAPL

# Portfolio analysis
python -m src.cli portfolio AAPL GOOGL MSFT --output report.pdf

# Start web dashboard
python -m src.cli dashboard --port 8080
```

---

## ๐Ÿ“š Interactive API Documentation

The API includes built-in interactive documentation powered by **OpenAPI 3.0** specification.

### Swagger UI

Access the interactive Swagger UI at: ****

Features:

- Interactive API explorer with "Try it out" functionality
- Auto-generated request/response examples
- Authentication testing
- Schema validation

### ReDoc

Access the ReDoc documentation at: ****

Features:

- Clean, responsive three-panel design
- Deep linking to specific endpoints
- Code samples in multiple languages
- Search functionality

### OpenAPI JSON Schema

Download the raw OpenAPI specification: ****

Use this to:

- Generate client SDKs (Python, TypeScript, Go, etc.)
- Import into Postman or Insomnia
- Create automated API tests

---

## ๐Ÿ”ง API Reference

### Endpoints

| Method | Endpoint | Description |
| ----------- | ------------------------------- | ----------------------------------------------- |
| `POST` | `/api/v1/analyze` | Analyze a stock symbol |
| `GET` | `/api/v1/technical/{symbol}` | Get technical analysis |
| `GET` | `/api/v1/fundamental/{symbol}` | Get fundamental analysis |
| `GET` | `/api/v1/sentiment/{symbol}` | Get sentiment analysis |
| `POST` | `/api/v1/portfolio` | Analyze a portfolio |
| `POST` | `/api/v1/reports` | Generate a report |
| `GET` | `/api/v1/market/summary` | Get market summary |
| `GET` | `/api/v1/themes` | List all available investment themes |
| `POST` | `/api/v1/theme/{theme_id}` | Analyze an investment theme |
| `POST` | `/api/v1/themes/compare` | Compare multiple themes side by side |
| `GET` | `/api/v1/peers/{symbol}` | Get peer comparison (auto-discovery) |
| `POST` | `/api/v1/peers/compare` | Compare stock against specific peers |
| `GET` | `/api/v1/disruption/{symbol}` | Get market disruption analysis |
| `POST` | `/api/v1/disruption/analyze` | Analyze disruption with optional LLM narrative |
| `POST` | `/api/v1/disruption/compare` | Compare disruption profiles across companies |
| `GET` | `/api/v1/earnings/{symbol}` | Get quarterly earnings analysis |
| `POST` | `/api/v1/earnings/analyze` | Analyze earnings with optional LLM narrative |
| `POST` | `/api/v1/earnings/compare` | Compare earnings profiles across companies |
| `GET` | `/api/v1/performance/{symbol}` | Get historical performance tracking |
| `GET` | `/api/v1/events/{symbol}` | Get event-driven performance analysis |
| `POST` | `/api/v1/backtest` | Run a backtesting simulation |
| `GET` | `/api/v1/strategies` | List available backtesting strategies |
| `GET` | `/api/v1/observations/{symbol}` | Key observations and cross-dimensional insights |
| `GET` | `/api/v1/insiders/{symbol}` | Insider & institutional activity analysis |
| `GET` | `/api/v1/options/{symbol}` | Options flow and sentiment analysis |
| `WebSocket` | `/ws/alerts` | Real-time alerts |

### Response Schema

```json
{
"symbol": "AAPL",
"analysis_date": "2024-01-15T10:30:00Z",
"technical": {
"trend": "bullish",
"signals": [...],
"indicators": {...}
},
"fundamental": {
"valuation": "fairly_valued",
"metrics": {...},
"growth_score": 8.5
},
"sentiment": {
"overall": "positive",
"score": 0.72,
"sources": {...}
},
"recommendation": {
"action": "BUY",
"confidence": 0.85,
"reasoning": "...",
"target_price": 195.00,
"stop_loss": 175.00
}
}
```

---

## ๐Ÿค– Agent Capabilities

### 1. Data Collector Agent

```python
Capabilities:
- Fetch real-time stock prices
- Historical data retrieval
- Financial statements download
- News article collection
- Social media data gathering
```

### 2. Technical Analyst Agent

```python
Indicators Supported:
- RSI (Relative Strength Index)
- MACD (Moving Average Convergence Divergence)
- SMA/EMA (Simple/Exponential Moving Averages)
- Bollinger Bands
- Fibonacci Retracements
- Volume Analysis
- Support/Resistance Levels
```

### 3. Fundamental Analyst Agent

```python
Metrics Analyzed:
- P/E Ratio, P/B Ratio, P/S Ratio
- EPS and Revenue Growth
- ROE, ROA, ROIC
- Debt-to-Equity Ratio
- Free Cash Flow
- Dividend Yield and Payout Ratio
- Competitive Analysis
```

### 4. Sentiment Analyst Agent

```python
Sources:
- Financial news articles
- SEC filings and earnings calls
- Social media (Twitter, Reddit)
- Analyst ratings
- Insider trading activity
```

### 5. Thematic Analyst Agent

```python
Capabilities:
- Analyze stocks grouped by investment themes (AI, EV, Green Energy, etc.)
- Multi-horizon performance tracking (1W, 1M, 3M, 6M, 1Y, YTD)
- Intra-theme correlation and diversification scoring
- Momentum scoring (0-100) with configurable weights
- Theme health scoring (0-100) combining performance, momentum, risk
- Sector overlap breakdown
- Top performer and laggard identification
- LLM-generated narrative outlook (optional)

Available Themes:
- AI & Machine Learning - Electric Vehicles
- Green Energy & Clean Tech - Cybersecurity
- Aging Population & Healthcare - Cloud Computing & SaaS
- Fintech & Digital Payments - Space Economy & Aerospace
- Digital Entertainment & Gaming - Blockchain & Web3
```

### 6. Disruption Analyst Agent

```python
Capabilities:
- Analyze whether a company is a market disruptor or at risk of disruption
- R&D intensity analysis (R&D/Revenue ratio, trend vs industry benchmarks)
- Revenue growth acceleration/deceleration tracking
- Gross margin trajectory analysis (expansion = competitive moat)
- Disruption scoring (0-100) with weighted components
- Classification: Active Disruptor, Moderate Innovator, Stable Incumbent, At Risk
- Industry-specific benchmarks for 18+ industries
- Risk factor and competitive strength identification
- Multi-company disruption comparison with ranking
- LLM-generated qualitative competitive assessment (optional)

Disruption Classification:
- Active Disruptor (70+) : High R&D, accelerating growth, expanding margins
- Moderate Innovator (50-70): Some disruptive signals, mixed trajectory
- Stable Incumbent (30-50) : Established position, limited innovation
- At Risk (<30) : Low innovation, weak growth, margin pressure

Scoring Components:
- R&D Intensity Score (35% weight): Innovation investment vs industry
- Revenue Growth Score (40% weight): Growth rate and acceleration
- Margin Trajectory Score (25% weight): Gross margin expansion/contraction
```

### 7. Earnings Analyst Agent

```python
Capabilities:
- Track quarterly EPS actuals vs analyst estimates
- Analyze beat/miss patterns and management guidance accuracy
- Calculate quarter-over-quarter and year-over-year trends
- Assess earnings quality (operational vs one-time items)
- Identify upcoming earnings dates and estimate trends
- Compare earnings profiles across sector peers
- LLM-generated earnings narrative (optional)

Earnings Pattern Classification:
- Consistent Beater (80%+ beat rate): Management under-promises, reliable execution
- Regular Beater (60-80%) : Tends to exceed expectations
- Mixed Results (40-60%) : Unpredictable earnings, higher risk
- Regular Misser (20-40%) : Tends to disappoint
- Consistent Misser (<20%) : Credibility concerns

Earnings Quality Score (1-10):
- High Quality (8-10) : Driven by operations, sustainable
- Good Quality (6.5-8) : Primarily operational with minor concerns
- Average Quality (5-6.5) : Some non-operational factors present
- Below Average (3.5-5) : Significant non-operational items
- Low Quality (1-3.5) : Earnings not reflective of core operations

Key Metrics:
- Beat Rate % : Percentage of quarters exceeding estimates
- Average Surprise % : Mean EPS surprise across quarters
- Revenue/Income Trends : QoQ and YoY growth trajectory
- Margin Trajectory : Gross margin expansion/contraction pattern
```

### 8. Performance Analyst Agent

```python
Capabilities:
- Multi-horizon absolute returns (1D, 1W, 1M, 3M, 6M, YTD, 1Y, 3Y, 5Y)
- Benchmark comparison vs S&P 500 (SPY), Nasdaq 100 (QQQ), and sector ETF
- Auto-detection of sector ETF based on company sector (12 sector mappings)
- Alpha calculation across horizons with outperform/underperform assessment
- Risk-adjusted metrics: Sharpe ratio, Sortino ratio, Beta, volatility
- Rolling 30-day returns with momentum trend analysis
- Drawdown analysis: max drawdown, recovery time, current drawdown
- Daily return statistics: mean, median, best/worst day, positive day %

Risk-Adjusted Ratings:
- Excellent (2.0+) : Superior risk-adjusted performance
- Good (1.0-2.0) : Above-average risk-adjusted returns
- Moderate (0.5-1.0): Acceptable risk-reward balance
- Poor (<0.5) : Risk not adequately compensated

Benchmark Comparison:
- vs S&P 500 (SPY) : Broad market comparison
- vs Nasdaq 100 (QQQ) : Growth/tech benchmark
- vs Sector ETF (XLK, etc.) : Industry-specific comparison

Sector ETF Mappings:
- Technology: XLK - Healthcare: XLV - Financials: XLF
- Consumer Cyclical: XLY - Consumer Defensive: XLP - Communication: XLC
- Industrials: XLI - Energy: XLE - Utilities: XLU
- Real Estate: XLRE - Basic Materials: XLB
```

### 9. Sentiment Engine

```python
Capabilities:
- FinBERT financial-domain sentiment analysis (when transformers installed)
- VADER with 60+ financial-domain lexicon enhancements (default fallback)
- Per-article scoring with confidence and label (Positive/Negative/Neutral)
- Time-weighted aggregate scoring (recent articles weighted higher)
- News volume tracking with spike detection (2.5x+ normal = significant)
- Sentiment trend analysis over time with direction/momentum
- Source diversity assessment (broad/moderate/limited/single-source)
- Topic extraction for key themes (earnings, analyst, product, regulation, etc.)
- News-price correlation signal

Sentiment Engines:
- FinBERT (ProsusAI/finbert) : Financial-domain transformer, high accuracy
- VADER + Financial Lexicon : Fast, no GPU required, enhanced with 60+ terms

Financial Lexicon Additions:
- Positive: beat, outperform, upgrade, bullish, rally, surge, catalyst, tailwind
- Negative: miss, downgrade, bearish, selloff, plunge, bankruptcy, headwind, fraud

Volume Spike Detection:
- 2.5x+ normal : Significant event coverage
- 1.5x+ normal : Elevated interest
- Below 1.5x : Normal news flow
```

---

## ๐Ÿ“Š Sample Analysis

### Example: Apple Inc. (AAPL) Analysis

```
================================================================================
FINANCIAL RESEARCH ANALYST REPORT
Apple Inc. (AAPL)
Generated: 2024-01-15
================================================================================

EXECUTIVE SUMMARY
-----------------
Apple Inc. demonstrates strong fundamentals with continued growth in services
revenue and a robust product ecosystem. Technical indicators suggest a bullish
trend, while sentiment analysis reveals positive market perception.

TECHNICAL ANALYSIS
------------------
Trend: BULLISH
RSI (14): 58.3 (Neutral)
MACD: Bullish crossover detected
Support: $175.00
Resistance: $195.00

FUNDAMENTAL ANALYSIS
--------------------
P/E Ratio: 28.5 (Industry Avg: 25.2)
Revenue Growth: 8.2% YoY
EPS Growth: 12.1% YoY
Debt/Equity: 1.52
ROE: 147.3%

SENTIMENT ANALYSIS
------------------
Overall Sentiment: POSITIVE (Score: 0.72)
News Sentiment: 0.68
Social Media: 0.75
Analyst Consensus: 0.82

RECOMMENDATION
--------------
Action: BUY
Confidence: 85%
Target Price: $195.00
Stop Loss: $175.00

Reasoning: Strong fundamentals combined with positive technical signals and
favorable market sentiment suggest upside potential. The services segment
continues to grow, providing recurring revenue stability.
================================================================================
```

---

## ๐Ÿงช Testing

```bash
# Run all tests
pytest tests/ -v

# Run specific test suite
pytest tests/test_agents.py -v

# Run thematic investing tests
pytest tests/test_thematic.py -v

# Run market disruption analysis tests
pytest tests/test_disruption.py -v

# Run quarterly earnings analysis tests
pytest tests/test_earnings.py -v

# Run peer comparison tests
pytest tests/test_peer_comparison.py -v

# Run with coverage
pytest tests/ --cov=src --cov-report=html

# Run integration tests (requires network access for yfinance)
pytest tests/ -v -m integration
```

---

## ๐Ÿšข Deployment

### Docker Compose

```yaml
version: "3.8"
services:
api:
build: .
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/financial_agent
- REDIS_URL=redis://redis:6379
depends_on:
- db
- redis

db:
image: postgres:15
environment:
POSTGRES_DB: financial_agent
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} # Set in .env file
volumes:
- postgres_data:/var/lib/postgresql/data

redis:
image: redis:7
volumes:
- redis_data:/data

volumes:
postgres_data:
redis_data:
```

### Kubernetes

See `k8s/` directory for Kubernetes deployment manifests.

---

## ๐Ÿ“ Project Structure

```
financial-research-analyst-agent/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”œโ”€โ”€ main.py # Application entry point
โ”‚ โ”œโ”€โ”€ config.py # Configuration management
โ”‚ โ”œโ”€โ”€ agents/
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ base.py # Base agent class (ReAct reasoning, confidence scoring)
โ”‚ โ”‚ โ”œโ”€โ”€ orchestrator.py # Orchestrator (cross-agent conflict detection, RAG ingestion)
โ”‚ โ”‚ โ”œโ”€โ”€ rag_mixin.py # RAG mixin for document-aware agents โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ data_collector.py # Data collection agent
โ”‚ โ”‚ โ”œโ”€โ”€ technical.py # Technical analysis (multi-step reasoning prompts) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ fundamental.py # Fundamental analysis (SEC filings via RAG) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ sentiment.py # Sentiment analysis (transcript tone analysis) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ risk.py # Risk analysis (layered risk assessment) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ thematic.py # Thematic investing analysis agent
โ”‚ โ”‚ โ”œโ”€โ”€ disruption.py # Market disruption analysis agent
โ”‚ โ”‚ โ”œโ”€โ”€ earnings.py # Quarterly earnings analysis agent
โ”‚ โ”‚ โ””โ”€โ”€ report_generator.py # Report generation agent
โ”‚ โ”œโ”€โ”€ tools/
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ market_data.py # Market data fetching tools
โ”‚ โ”‚ โ”œโ”€โ”€ news_fetcher.py # News fetching tools
โ”‚ โ”‚ โ”œโ”€โ”€ technical_indicators.py
โ”‚ โ”‚ โ”œโ”€โ”€ financial_metrics.py
โ”‚ โ”‚ โ”œโ”€โ”€ peer_comparison.py # Peer discovery & comparison tools โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ theme_mapper.py # Theme-to-ticker mapping & analysis tools โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ disruption_metrics.py # R&D, growth, margin & disruption scoring โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ earnings_data.py # Quarterly earnings data & quality scoring โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ performance_tracker.py # Multi-horizon returns & benchmark comparison โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ sentiment_engine.py # FinBERT/VADER financial sentiment scoring โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ news_impact.py # News volume, trends & source diversity โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ event_analyzer.py # Event calendar, price windows & pattern analysis โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ strategy_definitions.py # 9 trading strategies (incl. mean reversion, breakout) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ backtesting_engine.py # Backtest + walk-forward + multi-asset โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ strategy_optimizer.py # Genetic algorithm parameter tuning โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ insight_engine.py # Rule-based observations & ranking
โ”‚ โ”‚ โ”œโ”€โ”€ llm_insight_engine.py # LLM-powered synthesis + historical context โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ document_search.py # RAG-powered SEC filing & transcript search โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ macro_data.py # FRED API: rates, CPI, GDP, yields โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ social_sentiment.py # Reddit sentiment + composite scoring โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ dcf_model.py # DCF valuation (WACC, 3 scenarios, sensitivity) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ ml_forecast.py # ML price forecasting (GradientBoosting) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ anomaly_detector.py # Volume/price anomalies + regime detection โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ portfolio_optimizer.py # Markowitz, efficient frontier, risk-parity โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ benchmark.py # Alpha/beta/tracking error, attribution โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ monte_carlo.py # GBM simulation, VaR/CVaR, portfolio risk โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ factor_model.py # Fama-French factor decomposition โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ brinson_attribution.py # Brinson-Fachler performance attribution โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ tax_loss_harvesting.py # Tax-loss harvesting + wash sale warnings โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ supply_chain.py # Supplier/customer/competitor mapping โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ alerts.py # Real-time alert engine (9 types) โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ scheduled_reports.py # Digest generation + SMTP delivery โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ report_export.py # PDF (reportlab) + Excel (openpyxl) export โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ insider_activity.py # Insider txns, institutional holdings & smart money
โ”‚ โ”‚ โ””โ”€โ”€ options_analyzer.py # Options flow, IV skew, max pain & unusual activity
โ”‚ โ”œโ”€โ”€ rag/ # RAG Pipeline โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ ingester.py # SEC EDGAR document ingestion
โ”‚ โ”‚ โ”œโ”€โ”€ embedder.py # Sentence Transformer embedding pipeline
โ”‚ โ”‚ โ””โ”€โ”€ retriever.py # Similarity search + cross-encoder re-ranking
โ”‚ โ”œโ”€โ”€ data/ # Multi-Provider Data Layer โœจ
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ provider.py # Abstract interface + YFinance + fallback wrapper
โ”‚ โ”‚ โ”œโ”€โ”€ fmp_provider.py # Financial Modeling Prep provider
โ”‚ โ”‚ โ”œโ”€โ”€ alphavantage_provider.py # Alpha Vantage provider
โ”‚ โ”‚ โ””โ”€โ”€ validator.py # Data quality validation & outlier detection
โ”‚ โ”œโ”€โ”€ models/
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ analysis.py # Analysis data models
โ”‚ โ”‚ โ”œโ”€โ”€ report.py # Report data models
โ”‚ โ”‚ โ””โ”€โ”€ persistence.py # SQLAlchemy ORM: users, watchlists, portfolios, history โœจ
โ”‚ โ”œโ”€โ”€ api/
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ routes.py # API routes + WebSocket alerts endpoint
โ”‚ โ”‚ โ”œโ”€โ”€ schemas.py # Pydantic schemas
โ”‚ โ”‚ โ””โ”€โ”€ security.py # API key auth, rate limiting, input sanitization โœจ
โ”‚ โ””โ”€โ”€ utils/
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”œโ”€โ”€ logger.py # Logging utility
โ”‚ โ””โ”€โ”€ helpers.py # Helper functions
โ”œโ”€โ”€ tests/
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”œโ”€โ”€ test_agents.py
โ”‚ โ”œโ”€โ”€ test_tools.py
โ”‚ โ”œโ”€โ”€ test_api.py
โ”‚ โ”œโ”€โ”€ test_peer_comparison.py # Peer comparison tests โœจ
โ”‚ โ”œโ”€โ”€ test_thematic.py # Thematic investing tests โœจ
โ”‚ โ”œโ”€โ”€ test_disruption.py # Market disruption analysis tests โœจ
โ”‚ โ”œโ”€โ”€ test_earnings.py # Quarterly earnings analysis tests โœจ
โ”‚ โ”œโ”€โ”€ test_performance.py # Performance tracking tests โœจ
โ”‚ โ”œโ”€โ”€ test_events.py # Event-driven performance tests โœจ
โ”‚ โ”œโ”€โ”€ test_backtest.py # Backtesting engine tests โœจ
โ”‚ โ”œโ”€โ”€ test_observations.py # Key observations & insights tests โœจ
โ”‚ โ”œโ”€โ”€ test_insiders.py # Insider & institutional activity tests โœจ
โ”‚ โ””โ”€โ”€ test_options.py # Options flow analysis tests โœจ
โ”œโ”€โ”€ frontend/ # Streamlit web dashboard โœจ
โ”‚ โ”œโ”€โ”€ app.py # Main entry point & landing page
โ”‚ โ”œโ”€โ”€ requirements.txt # Streamlit dependencies
โ”‚ โ”œโ”€โ”€ assets/style.css # Dark/light theme CSS + mobile responsive โœจ
โ”‚ โ”œโ”€โ”€ pages/
โ”‚ โ”‚ โ”œโ”€โ”€ 1_Dashboard.py # Market overview & quick analysis
โ”‚ โ”‚ โ”œโ”€โ”€ 2_Stock_Analysis.py # Technical + fundamental + sentiment
โ”‚ โ”‚ โ”œโ”€โ”€ 3_Thematic_Investing.py # Theme browser & analysis
โ”‚ โ”‚ โ”œโ”€โ”€ 4_Peer_Comparison.py # Side-by-side peer metrics
โ”‚ โ”‚ โ”œโ”€โ”€ 5_Market_Disruption.py # Disruption scoring
โ”‚ โ”‚ โ”œโ”€โ”€ 6_Quarterly_Earnings.py # EPS tracking & quality
โ”‚ โ”‚ โ”œโ”€โ”€ 7_Portfolio_Analysis.py # Multi-stock portfolio
โ”‚ โ”‚ โ”œโ”€โ”€ 8_Reports.py # Generate & download reports
โ”‚ โ”‚ โ”œโ”€โ”€ 9_News.py # Financial news feed
โ”‚ โ”‚ โ”œโ”€โ”€ 10_Performance.py # Historical performance tracking
โ”‚ โ”‚ โ”œโ”€โ”€ 11_Sentiment.py # Enhanced news & sentiment analysis
โ”‚ โ”‚ โ”œโ”€โ”€ 12_ETF_Screener.py # ETF screening & analysis
โ”‚ โ”‚ โ””โ”€โ”€ 13_Macro_Economy.py # FRED macro indicators & rate environment โœจ
โ”‚ โ”œโ”€โ”€ components/ # Reusable UI components
โ”‚ โ”‚ โ”œโ”€โ”€ sidebar.py # Navigation sidebar
โ”‚ โ”‚ โ”œโ”€โ”€ charts.py # TradingView chart wrappers
โ”‚ โ”‚ โ”œโ”€โ”€ plotly_charts.py # Plotly visualizations
โ”‚ โ”‚ โ”œโ”€โ”€ metrics_cards.py # KPI cards & badges
โ”‚ โ”‚ โ””โ”€โ”€ data_tables.py # Styled dataframes
โ”‚ โ””โ”€โ”€ utils/
โ”‚ โ”œโ”€โ”€ data_service.py # Cached tool wrappers
โ”‚ โ”œโ”€โ”€ formatters.py # Number/date formatting
โ”‚ โ”œโ”€โ”€ theme.py # Dark/light theme toggle + CSS injection โœจ
โ”‚ โ””โ”€โ”€ session.py # Session state management
โ”œโ”€โ”€ data/
โ”‚ โ””โ”€โ”€ sample_data.csv
โ”œโ”€โ”€ docs/
โ”‚ โ”œโ”€โ”€ ARCHITECTURE.md # System architecture design document โœจ
โ”‚ โ”œโ”€โ”€ IMPLEMENTATION_PLAN.md # 4-phase implementation roadmap โœจ
โ”‚ โ”œโ”€โ”€ GAP_ANALYSIS.md # Gap analysis vs smart financial analyzer โœจ
โ”‚ โ””โ”€โ”€ SCOPE.md # Feature scope & enhancement roadmap
โ”œโ”€โ”€ notebooks/
โ”‚ โ””โ”€โ”€ exploration.ipynb
โ”œโ”€โ”€ static/
โ”‚ โ””โ”€โ”€ dashboard/
โ”œโ”€โ”€ config/
โ”‚ โ”œโ”€โ”€ agents.yaml # Agent configuration
โ”‚ โ””โ”€โ”€ themes.yaml # Investment theme definitions โœจ
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ””โ”€โ”€ README.md
```

---

## ๐Ÿค Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

---

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## ๐Ÿ™ Acknowledgments

- [LangChain](https://langchain.com/) - AI Agent Framework
- [Ollama](https://ollama.ai/) - Local LLM Inference
- [Yahoo Finance](https://finance.yahoo.com/) - Market Data (Primary)
- [Financial Modeling Prep](https://financialmodelingprep.com/) - Financial Data API
- [Alpha Vantage](https://www.alphavantage.co/) - Financial Data API
- [FRED](https://fred.stlouisfed.org/) - Federal Reserve Economic Data
- [ChromaDB](https://www.trychroma.com/) - Vector Store for RAG
- [Sentence Transformers](https://www.sbert.net/) - Embeddings
- [scikit-learn](https://scikit-learn.org/) - ML Forecasting
- [SciPy](https://scipy.org/) - Portfolio Optimization

---

**Created by ๐Ÿค– Antigravity AI (Google DeepMind)**

**Author: Gopal Saini**

_Part of the AI Agents Case Studies Collection_

[โฌ† Back to Top](#-financial-research-analyst-agent)