Skip to content

DivyangP2003/ai_finance_agent_llm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

155 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  AI Market Intelligence โ€” Multi-Agent Decision Framework

A Global Multi-Agent Financial Analysis & Decision Support System

DashboadOverview

AI Market Intelligence is an advanced, multi-agent financial analytics platform powered by Google Gemini 2.0.
It enables researchers, traders, asset managers, and risk professionals to:

  • Generate benchmark-aware investment insights
  • Analyze global equities
  • Compute quantitative risk metrics
  • Explore markets using interactive AI explanations

The platform integrates real market data, multi-agent reasoning, quantitative finance, and interactive visual analytics into a single institutional-grade workflow.


๐Ÿ“Œ Table of Contents


Overview

AI Market Intelligence is a decision-support platform combining:

  • ๐Ÿงฉ Multi-agent AI reasoning
  • ๐Ÿ“Š Benchmark-aware financial analysis
  • ๐Ÿ“ˆ Quantitative market analytics
  • ๐Ÿ’ฌ Real-time sentiment extraction
  • ๐ŸŒŽ Global market data
  • ๐Ÿ’ผ Portfolio optimization
  • ๐Ÿค Interactive AI insights

It is designed to help professionals make faster, smarter, and data-driven decisions in financial markets.


Screenshots

๐Ÿ“ˆ Overview

Overview


๐Ÿงญ User Guide

User Guide


๐Ÿข Company Deep Dives

Company Deep Dives


๐Ÿ“‰ Risk & Correlation (Masonry Collage)


๐Ÿค– AI Dashboard


๐Ÿ“Š Portfolio Strategist

Portfolio Strategist


๐Ÿ’ฌ Chat Assistant

Chat Assistant


๐Ÿ“˜ Audit & Exports

Audit & Exports


Key Features

๐Ÿ”ธ 1. Multi-Agent Market Intelligence

Six highly specialized AI agents independently analyze different domains:

Agent Role
๐Ÿง  MarketAnalystAgent Market trends, volatility, momentum & regime detection
๐Ÿข CompanyResearchAgent Fundamentals, earnings, catalysts, valuation
๐Ÿ’ฌ SentimentAgent Region-aware news sentiment from live RSS feeds
โš–๏ธ RiskAnalystAgent VaR, CVaR, beta, drawdown, correlations, stress tests
๐Ÿ“Š PortfolioStrategistAgent Allocation strategies: equal weight / risk parity / momentum
๐Ÿ‘จโ€๐Ÿ’ผ TeamLeadAgent Synthesizes all insights into a final benchmark-aware report

๐Ÿ”ธ 2. Global Market Support

  • ๐ŸŒŽ Multi-country ticker normalization
  • ๐Ÿ“ˆ Regional benchmark selection
  • ๐Ÿ›๏ธ Exchange suffix auto-application
  • ๐Ÿ“ฐ Region-aware news in multiple languages

๐Ÿ”ธ 3. Quantitative Analytics Engine

Includes institutional-grade risk & performance analytics:

  • Rolling Volatility
  • Rolling Beta (vs benchmark)
  • Correlation Heatmap
  • Maximum Drawdown
  • Alpha & Tracking Error
  • Value-at-Risk (VaR)
  • Conditional VaR (CVaR / Expected Shortfall)
  • Sortino Ratio
  • Sector Composition Approximation

Stress Testing:

  • โšก Shock-based stress test
  • ๐Ÿ“‰ Historical analog crash scenarios

๐Ÿ”ธ 4. Benchmark-Aware Reporting

All insights, charts, and metrics are contextualized against benchmark indices, such as:

S&P 500, NASDAQ 100, Dow Jones, FTSE 100, Nikkei 225, Nifty 50, Euro Stoxx 50

๐Ÿ”ธ 5. Interactive AI Dashboard

Users can ask Gemini:

"Explain this chart to me"

And receive:

  • Observations
  • Risk insights
  • Anomalies
  • Trend interpretation
  • Recommendations

๐Ÿ”ธ 6. Portfolio Strategy Engine

Supports multiple allocation frameworks:

  • Equal-Weight
  • Risk-Parity (inverse volatility)
  • Momentum Tilt
  • Custom Inputs

Includes expected risk/return interpretation for each strategy.

๐Ÿ”ธ 7. Chat Assistant

A conversational interface to ask about:

  • Market questions
  • Company comparisons
  • Risk explanations
  • Benchmark analysis
  • Financial definitions
  • Portfolio construction

Multi-Agent Architecture

Multi-Agent Architecture Diagram

Multi-Agent Workflow

Multi-Agent Workflow Diagram

The system follows a multi-agent orchestration pipeline where each specialized AI agent contributes domain-specific intelligence to the final report.

Each Agent Receives

  • ๐Ÿงน Cleaned and pre-processed data
  • ๐Ÿ“ˆ Historical price series
  • ๐Ÿ“Š Computed returns and volatility metrics
  • ๐ŸŒ Regional sentiment information
  • ๐Ÿงฎ Benchmark-adjusted metrics

The TeamLeadAgent consolidates all agent outputs, applies benchmark awareness, and generates a final institutional-grade report that includes:

  • ๐Ÿง  Synthesized insights
  • ๐Ÿ“‰ Quantitative performance metrics
  • โš–๏ธ Risk evaluation
  • ๐Ÿ’ผ Portfolio recommendations
  • ๐Ÿ’ฌ Interactive explanations via Gemini

System Capabilities

  • โœ” Global equity analysis
  • โœ” Benchmark-relative performance
  • โœ” Rolling factor analytics
  • โœ” Quantitative risk modeling
  • โœ” AI-assisted chart interpretation
  • โœ” Portfolio design & optimization
  • โœ” News sentiment classification
  • โœ” Multi-agent chain-of-thought synthesis
  • โœ” Rich visualization suite (powered by Matplotlib & Seaborn)

Quantitative Analytics

Metric Description
VaR (Value-at-Risk) Worst expected loss at a given confidence level
CVaR (Expected Shortfall) Average loss in tail-risk events
Rolling Beta Benchmark sensitivity over time
Alpha Outperformance vs benchmark
Tracking Error Deviation from benchmark
Correlation Matrix Inter-asset co-movements
Drawdown Curve Historical peak-to-trough dynamics
Stress Test Shock simulation & historical crash modeling
Sector Exposure Approximation Equal-weighted sector inference

Tab-by-Tab Breakdown

User Guide

Beginner-friendly introduction & glossary.

Overview

  • ๐Ÿ“ˆ Price charts
  • ๐Ÿ“Š Cumulative returns
  • ๐Ÿง  MarketAnalystAgent insights

Company Deep Dives

  • ๐Ÿข Company metadata
  • ๐Ÿ’ฐ Financials
  • ๐Ÿ“ฐ News sentiment
  • ๐Ÿงพ CompanyResearchAgent results

Risk & Correlation

  • ๐Ÿ“‰ Volatility
  • ๐Ÿ”ฅ Correlation heatmaps
  • โš–๏ธ Rolling beta
  • ๐Ÿงฎ CVaR & VaR
  • ๐Ÿ’ฅ Stress tests
  • ๐Ÿ‘๏ธ RiskAnalystAgent insights

AI Dashboard

  • ๐Ÿ’ฌ Interactive Gemini explanations
  • ๐Ÿ“Š Multi-chart insights

Portfolio Strategist

  • โš–๏ธ Equal-weight
  • ๐Ÿ“ˆ Risk parity
  • ๐Ÿš€ Momentum tilt
  • ๐Ÿค– PortfolioStrategistAgent recommendations

Chat Assistant

  • ๐Ÿ—ฃ๏ธ Context-aware question routing
  • ๐Ÿค Multi-agent responses

Audit & Exports

  • ๐Ÿงพ TeamLeadAgent multi-agent report
  • ๐Ÿ“˜ Benchmark-aware synthesis

Data Sources

Source Usage
Yahoo Finance Prices, metadata, and returns
RSS News Feeds Region-aware news sentiment
Google Gemini 2.0 AI reasoning, synthesis, and explanations

Installation & Setup

Clone the repository and install the required dependencies:

pip install -r requirements.txt

Ensure you add your Google API key as an environment variable

GOOGLE_API_KEY="your_api_key"

Run the Streamlit application

streamlit run app.py

Tech Stack

Component Technology
๐Ÿ–ฅ๏ธ Frontend Streamlit
โš™๏ธ Backend Python
๐Ÿง  AI Models Google Gemini 2.0 Flash
๐Ÿ’พ Data Sources Yahoo Finance + RSS Feeds
๐Ÿ“Š Visualization Matplotlib / Seaborn
๐Ÿค– Orchestration Custom Multi-Agent Framework

Target Users

The platform is designed for:

  • ๐Ÿงพ Equity Researchers
  • ๐Ÿ’น Traders
  • ๐Ÿ’ผ Asset Managers
  • โš–๏ธ Risk Managers
  • ๐Ÿ“ˆ Quantitative Analysts
  • ๐ŸŽ“ Finance Students
  • ๐Ÿ’ป FinTech Developers

Future Enhancements

  • ๐Ÿ“‰ Monte Carlo return simulation
  • ๐Ÿงฎ Efficient frontier (mean-variance optimization)
  • ๐Ÿ“š Factor model integration (Famaโ€“French)
  • ๐Ÿ’ฐ ETF + Crypto asset class support
  • ๐Ÿ’พ Persistent user sessions

About

Multi-agent AI platform for global equity research, quantitative risk analytics, sentiment modeling, and portfolio intelligence using Gemini 2.0 and Streamlit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages