Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🧠 AI Financial Copilot

Python FastAPI Groq LangGraph Streamlit

A production-grade, agentic AI system for financial decision-making. Featuring a multi-step LangGraph reasoning loop, real-time portfolio math, RAG-grounded expertise, and high-performance caching.


🌟 Key Features

🤖 Agentic Intelligence (LangGraph)

  • Multi-Step Reasoning: Uses a cyclic state machine to decompose complex goals into discrete tasks.
  • Tool Orchestration: Dynamically selects between Price data, News sentiment, Risk calculations, and RAG search.
  • Parallel Dispatch: Executes independent tools (e.g., News and Market Data) simultaneously for ~50% lower latency.
  • XML Thought Process: Transparent <thought_process> blocks show exactly how the agent is reasoning.

📐 Precision Financial Engine (No Hallucinations)

  • Metric Verification: Real computation of Sharpe, Sortino, VaR (95%), Beta, and Max Drawdown using raw data.
  • Explainable Methodology: Transparent metadata on every risk report showing time windows, benchmarks, and confidence intervals.
  • Modern Portfolio Theory (MPT): Scipy-powered optimization for Max Sharpe, Min Volatility, and Risk Parity.

📚 RAG & Semantic Memory

  • Knowledge Base: Indexed educational documents with ChromaDB to interpret why a metric is good or bad.
  • Source Transparency: Dedicated source citation UI showing news articles and document references.
  • Daily TTL Cache: High-performance lru_cache for stock data to avoid redundant API hits within the same trading day.

📰 Sentiment NLP (FinBERT)

  • Financial NLP: Local ProsusAI/finbert model for accurate sentiment scoring of market news.
  • Weighted Consensus: Aggregates multi-article news confidence for a more grounded "Verdict" on market direction.

🚀 Quick Start

1. Configure Environment

# Clone the repository
git clone https://github.com/your-username/AI_Financial_Copilot.git
cd AI_Financial_Copilot

# Set your API keys in .env
# Required: GROQ_API_KEY (from https://console.groq.com)

2. Run via Docker Compose (Recommended)

docker compose up --build

3. Local Development (Manual)

# Install dependencies
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt

# Start Backend
uvicorn app.main:app --reload

# Start Frontend
streamlit run dashboard/streamlit_app.py

🏗️ Technical Architecture

Layer Technology
LLM Engine Groq (llama-3.3-70b-versatile)
Orchestration LangGraph, LangChain
Backend API FastAPI, Pydantic, SlowAPI
Frontend Streamlit, Plotly (Interactive Charts)
Data/Math yfinance, SciPy, NumPy, Pandas
Vector DB ChromaDB (RAG)
NLP Transformers (FinBERT), sentence-transformers
Observability LangSmith, Structured Logging

📈 Example Commands

The agent is designed to handle complex, nested requests:

  • "What is a good Sharpe ratio? Also, analyze my portfolio: 40% AAPL, 60% MSFT."
  • "Fetch the last 5 news articles for Tesla and tell me the overall sentiment sentiment."
  • "Based on Modern Portfolio Theory, optimize for Min Volatility between NVDA, AMD, and INTC."

🛡️ License & Disclaimer

Licensed under MIT.
Disclaimer: This is an AI research tool for educational purposes only. It does not provide certified financial advice. Always consult a professional before making investment decisions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages