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.
- 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.
- 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.
- 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_cachefor stock data to avoid redundant API hits within the same trading day.
- Financial NLP: Local
ProsusAI/finbertmodel for accurate sentiment scoring of market news. - Weighted Consensus: Aggregates multi-article news confidence for a more grounded "Verdict" on market direction.
# 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)docker compose up --build- Dashboard: http://localhost:8501
- API Docs: http://localhost:8000/docs
# 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| 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 |
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."
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.