A comprehensive financial AI engine built with LangGraph multi-agent system, Streamlit UI, and advanced RAG capabilities.
Developed by Sankar Subbayya
- Python 3.12+
- uv package manager (recommended)
-
Clone the repository
git clone <repository-url> cd finnie
-
Install dependencies with uv
# Install all dependencies uv sync # Install with development dependencies uv sync --extra dev # Install with documentation dependencies uv sync --extra docs # Install with all extras uv sync --all-extras
-
Run the application
# Using uv (recommended) uv run finnie # Or in development mode uv run streamlit run app/main.py # Or directly uv run python run_app.py
-
Access the application Open your browser to
http://localhost:8501
- Orchestrator: Routes queries to appropriate agents
- Tutor Agent: Educational content and Socratic Q&A
- Portfolio Analyst: Portfolio analysis and metrics
- Market Intelligence: Real-time market data and news
- Compliance Agent: Ensures regulatory compliance
- Frontend: Streamlit with Material Design
- AI Core: LangGraph multi-agent system
- RAG: Hybrid retrieval (BM25 + Vector search)
- Data: yfinance, Alpha Vantage APIs
- Storage: SQLite/PostgreSQL + FAISS/Chroma
- Conversational AI with context awareness
- Source attribution and citations
- Follow-up question suggestions
- Quick action buttons
- Upload CSV holdings data
- Comprehensive performance metrics
- Risk analysis and recommendations
- Interactive visualizations
- Real-time quotes and news
- Sector performance heatmaps
- Economic calendar
- Watchlist management
- Structured learning paths
- Interactive quizzes
- Knowledge base search
- Progress tracking
finnie/
βββ app/ # Streamlit application
β βββ pages/ # UI pages (Chat, Portfolio, Markets, Learn)
β βββ utils.py # Utility functions
βββ agents/ # Multi-agent system
β βββ orchestrator.py # Main coordinator
β βββ tutor.py # Educational agent
β βββ portfolio.py # Portfolio analyst
β βββ market.py # Market intelligence
β βββ compliance.py # Compliance agent
βββ graph/ # LangGraph workflow
β βββ workflow.py # Main workflow orchestration
βββ rag/ # RAG system
β βββ ingest.py # Content ingestion
β βββ retrieve.py # Hybrid retrieval
βββ tools/ # MCP tools
β βββ mcp_market.py # Market data tools
β βββ portfolio_metrics.py # Portfolio calculation tools
βββ docs/ # Documentation
# Using uv
uv run pytest
# Or with coverage
uv run pytest --cov=app --cov=agents --cov=graph --cov=rag --cov=tools# Format code with black
uv run black .
# Lint with flake8
uv run flake8 .
# Type checking with mypy
uv run mypy .# Serve documentation locally
uv run mkdocs serve
# Build documentation
uv run mkdocs buildfrom tools.portfolio_metrics import calculate_portfolio_metrics
holdings = [
{'symbol': 'AAPL', 'quantity': 10, 'cost_basis': 150.00},
{'symbol': 'MSFT', 'quantity': 5, 'cost_basis': 300.00}
]
metrics = calculate_portfolio_metrics(holdings)
print(f"Sharpe Ratio: {metrics['performance_metrics']['sharpe_ratio']:.2f}")from tools.mcp_market import get_quotes
quotes = get_quotes(['AAPL', 'MSFT', 'GOOGL'])
for symbol, data in quotes.items():
print(f"{symbol}: ${data['price']:.2f} ({data['change_percent']:+.2f}%)")from rag.retrieve import RAGSystem
rag = RAGSystem(documents)
results = rag.search("What is portfolio diversification?", k=5)
for result in results:
print(f"Title: {result['title']}")
print(f"Score: {result['final_score']:.3f}")- Regulatory Compliance: Built-in compliance checks and disclaimers
- Content Filtering: Prohibited content detection and sanitization
- Risk Warnings: Automatic risk warnings for investment content
- Source Attribution: All responses include proper source citations
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is part of the SupportVectors AI training curriculum and is subject to the SupportVectors intellectual property guidelines.
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Finnie - Empowering Financial AI Education through Comprehensive Documentation and Robust Architecture