A multi-agent AI system that generates institutional-grade investment memos using LangGraph, AutoGen, and advanced LLMs.
Deep Finance simulates a virtual buy-side analyst team that researches investment opportunities, debates findings through consensus mechanisms, and produces comprehensive reports with quantitative risk analysis, network modeling, and AI-generated cover art.
AI-powered investment research platform using multi-agent LLMs (LangGraph + AutoGen) to generate institutional-grade memos with risk scoring, network analysis & consensus voting.
- Investment Committee Planner: Breaks down research topics into MECE (Mutually Exclusive, Collectively Exhaustive) sections
- 4-Model Gladiator Arena: Parallel drafting using Llama 3.3 70B, Qwen 3 32B, GPT-OSS 120B, and Kimi K2
- Consensus Voting System: AI judge evaluates competing drafts and selects the best version
- Real-time WebSocket Updates: Live progress tracking with status updates for each research phase
- Graph Neural Network (GNN) Risk Analyzer: Simulates network dependencies and contagion risks
- Quantitative Risk Scoring: XGBoost-style risk model with 0-100 scoring
- Valuation Specialist: Stress-tests market-implied assumptions against historical data
- Portfolio Manager Review: Binary capital allocation decisions with conviction ratings
- Institutional-Grade Reports: Structured memos with executive summaries, scenario analysis, and monitoring checklists
- LaTeX Math Rendering: Proper mathematical notation using KaTeX
- AI-Generated Cover Art: Google Gemini 2.5 Flash creates symbolic investment thesis visualizations
- PDF Export: One-click download of formatted research reports
- Interactive Network Graphs: Vis.js visualization of supply chain and dependency risks
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Flask) β
β Dashboard UI β’ WebSocket Client β’ Real-time Visualization β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β HTTP/WebSocket
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β Backend (FastAPI) β
β WebSocket Manager β’ Research Orchestration β’ API Endpoints β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β LangGraph Workflow β
β β
β ββββββββββββ ββββββββββββββββ ββββββββββββ β
β β Planner βββββΆβ Worker Graph βββββΆβ Compiler β β
β ββββββββββββ ββββββββββββββββ ββββββββββββ β
β (Parallel Tasks) β β
β βΌ β
β ββββββββββββ ββββββββββββ ββββββββββββββββ β
β β GNN βββββΆβ Risk βββββΆβ Valuation β β
β β Analyzer β β Scorer β β Specialist β β
β ββββββββββββ ββββββββββββ ββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββ ββββββββββββ ββββββββββββββββ β
β β Designer βββββΆβ Reviewer βββββΆβ Curator β β
β β (Gemini) β β (PM) β β (GLM-4.7) β β
β ββββββββββββ ββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Research β Draft (4 Models) β Consensus Vote β Section Complete
- Python 3.9+
- API Keys:
- Groq API (for Llama, Qwen, GPT-OSS models)
- Cerebras API (for GPT-OSS 120B and GLM-4.7)
- Google AI Studio (for Gemini image generation)
- Clone the repository
git clone https://github.com/manan-tech/DeepResearch/
cd deep-finance- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt
pip install -r backend/requirements.txt
pip install -r frontend/requirements.txt- Configure environment variables
Create backend/.env:
GROQ_API_KEY=your_groq_api_key_here
CEREBRAS_API_KEY=your_cerebras_api_key_here
GOOGLE_API_KEY=your_google_ai_studio_key_hereOption 1: Using the start script
chmod +x start.sh
./start.shOption 2: Manual startup
# Terminal 1 - Backend
uvicorn backend.main:app --reload --port 8000
# Terminal 2 - Frontend
python frontend/app.pyAccess the application:
- Frontend: http://localhost:5000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
-
Enter Research Topic
- Single stock: "AAPL", "Long Thesis on NVDA"
- Sector analysis: "Semiconductors", "AI Infrastructure"
- Macro themes: "Inflation Impact on Tech", "Fed Rate Cuts"
-
Optional Sources
- Add comma-separated URLs for specific documents to include
-
Monitor Progress
- Research Plan: View breakdown of research sections
- Consensus Engine: Watch live model debates and voting
- Live Report: See the report build in real-time
-
Explore Results
- Click draft cards to view full model outputs
- Open network graph to visualize dependencies
- Download PDF or copy markdown
- FastAPI: High-performance async API framework
- LangGraph: Stateful multi-agent workflow orchestration
- LangChain: LLM integration and tooling
- WebSockets: Real-time bidirectional communication
- Groq: Ultra-fast inference for Llama 3.3 70B, Qwen 3 32B
- OpenRouter: Access to GPT-OSS 120B, Kimi K2 Instruct
- Cerebras: High-performance GPT-OSS 120B and GLM-4.7
- Google AI: Gemini 2.5 Flash for image generation
- Flask: Lightweight web framework
- Marked.js: Markdown parsing with KaTeX extension
- Vis.js: Network graph visualization
- html2pdf.js: Client-side PDF generation
- DuckDuckGo Search: Web search for research data
- BeautifulSoup4: HTML parsing and content extraction
deep-finance/
βββ backend/
β βββ __init__.py
β βββ main.py # FastAPI app & WebSocket manager
β βββ agents.py # LangGraph workflow & agent logic
β βββ requirements.txt
β βββ .env # API keys (not in repo)
βββ frontend/
β βββ app.py # Flask server
β βββ requirements.txt
β βββ templates/
β β βββ dashboard.html # Main UI
β βββ static/
β βββ css/
β β βββ style.css # Glassmorphism design
β βββ js/
β βββ main.js # WebSocket client & UI logic
βββ requirements.txt # Root dependencies
βββ start.sh # Startup script
βββ README.md
| Agent | Model | Purpose |
|---|---|---|
| Planner | Llama 3.3 70B | Breaks topic into research sections |
| Researcher | DuckDuckGo | Gathers web data for each section |
| Drafters (A-D) | 4 Different LLMs | Generate competing section drafts |
| Judge | Llama 3.3 70B | Evaluates drafts and selects winner |
| Compiler | GPT-OSS 20B | Synthesizes sections into unified report |
| GNN Analyzer | Llama 3.3 70B | Network risk and dependency analysis |
| Risk Scorer | Llama 3.3 70B | Quantitative risk scoring (0-100) |
| Valuation Specialist | GPT-OSS 20B | Stress-tests market assumptions |
| Designer | Gemini 2.5 Flash | Generates symbolic cover art |
| Reviewer (PM) | GPT-OSS 120B | Makes capital allocation decision |
| Curator | GLM-4.7 | Final polish and formatting |
- Planning: Investment committee breaks down research scope
- Parallel Research: Workers gather data for each section
- Gladiator Drafting: 4 models compete to write each section
- Consensus Voting: Judge selects best draft per section
- Compilation: Sections synthesized into unified report
- Risk Analysis: GNN network modeling + quantitative scoring
- Valuation Check: Stress-test market-implied assumptions
- Art Generation: AI creates symbolic thesis visualization
- PM Review: Portfolio manager makes allocation decision
- Final Curation: Professional formatting and polish
Edit backend/agents.py to customize models:
self.models = {
"A": "llama-3.3-70b-versatile",
"B": "qwen/qwen3-32b",
"C": "openai/gpt-oss-120b",
"D": "moonshotai/kimi-k2-instruct-0905"
}POST /api/research: Start research job{ "topic": "Long Thesis on NVDA", "sources": ["https://example.com/doc"] }WebSocket /ws: Real-time updates
Contributions welcome! Areas for improvement:
- Additional LLM provider integrations
- Enhanced risk modeling algorithms
- Custom data source connectors
- Advanced visualization options
- Multi-language support
This project is provided as-is for educational and research purposes.
- LangGraph for stateful agent orchestration
- Groq for lightning-fast LLM inference
- Cerebras for high-performance model serving
- Google AI for generative image capabilities
- Open-source community for foundational tools
For issues, questions, or feature requests, please open an issue on GitHub.
Built with β€οΈ for the AI x Finance community