sykang16/agentic-wealth-intelligence
0
Agentic Wealth Intelligence
AI-powered wealth management system with multi-agent orchestration, conversational profiling, RAG-enhanced recommendations, and real-time market data integration.
Architecture
LangGraph Hybrid Supervisor Routing — two-tier intent classification feeds into a flat outer graph; the Recommend node embeds a Supervisor subgraph for multi-step context gathering.
Outer Orchestrator Graph
┌──────────────────────────────────────┐
User ──────►│ Router │
│ Tier 1: Keyword match (fast path) │
│ Tier 2: LLM fallback (T=0) │
└──────────────┬───────────────────────┘
│ conditional routing
┌────────────────────────┼──────────────────┬──────────────┐
▼ ▼ ▼ ▼
┌────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────┐
│ Portfolio │ │ Profiling │ │ Recommend │ │ General │
│ Module A │ │ Module B │ │ [Subgraph] │ │ (LLM) │
│ AssetAgent │ │ slot-filling │ │ Supervisor │ │ │
└──────┬─────┘ └──────┬───────┘ └──────┬───────┘ └────┬─────┘
└────────────────────┴──────────────────┴────────────────┘
│
┌──────▼──────┐
│ Respond │──► END
└─────────────┘Recommendation Supervisor Subgraph
┌───────────────────────────────────────────────────────────────┐
│ Supervisor (LLM decision · guard: steps <= 5) │
│ ┌────────────────────┬──────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │portfolio_ │ │profiling_ │ │ recommend │ │
│ │fetch │ │fetch │ │ synthesis │ │
│ │AssetAgent │ │get_profile_ │ │ RAG + MCP │ │
│ │.process() │ │ summary() │ │ │ │
│ └──────┬──────┘ └──────┬───────┘ └──────┬───────┘ │
│ └─────────────────┴──────────────────┘ │
│ loops back to Supervisor │
│ finish ─────► Respond │
└───────────────────────────────────────────────────────────────┘Modules:
- Portfolio Analysis — Natural language queries about your holdings, net worth, allocation, gains/losses
- Investment Profiling — Conversational slot-filling to build your risk/preference profile
- Recommendations — AI-generated investment advice using portfolio data, RAG knowledge base, and live market data
- AI Advisor — Unified chat interface that automatically routes to the right module
Quick Start
1. Install Dependencies
pip install -r requirements.txt2. Configure Environment
Copy .env.example to .env and set your API keys:
cp .env.example .envRequired (at least one LLM provider):
OPENAI_API_KEY— OpenAI GPT-4oANTHROPIC_API_KEY— Anthropic ClaudeGEMINI_API_KEY— Google Gemini
Optional (for live data):
ALPHA_VANTAGE_API_KEY— Market quotes and financial newsNEWS_API_KEY— Business newsSEC_USER_AGENT— SEC EDGAR filings
3. Generate Synthetic Data
from backend.src.data_generation import generate_sample_data
generate_sample_data()4. Run the Streamlit UI
python -m streamlit run ui/streamlit_app.py5. Run the API Server
uvicorn backend.src.api.app:app --reloadAPI documentation available at http://localhost:8000/docs.
API Endpoints
Project Structure
backend/
├── src/
│ ├── agents/ # Agent implementations
│ │ ├── asset_agent.py # Portfolio query agent
│ │ └── orchestrator.py # Multi-agent orchestrator
│ ├── api/ # FastAPI application
│ │ ├── app.py # App factory
│ │ ├── dependencies.py # Dependency injection
│ │ ├── schemas.py # Request/response models
│ │ └── routes/ # API route handlers
│ ├── asset_management/ # Module A: Portfolio data
│ ├── common/ # Shared models, LLM client
│ ├── multi_agent/ # LangGraph orchestrator
│ │ ├── state.py # State definitions
│ │ ├── routing.py # Intent classification
│ │ ├── nodes.py # Graph node functions
│ │ └── graph.py # Graph construction
│ ├── profiling/ # Module B: Slot-filling agent
│ ├── recommendation/ # Module C: RAG + recommendations
│ └── mcp/ # MCP servers for live data
ui/
├── streamlit_app.py # Main Streamlit application
tests/
├── unit/ # Unit tests
├── integration/ # Integration tests
└── e2e/ # End-to-end testsRunning Tests
# All tests
pytest tests/ -v
# Specific test categories
pytest tests/unit/ -v
pytest tests/integration/ -v
pytest tests/e2e/ -vTech Stack
- Python 3.11+ — Core language
- LangGraph — Multi-agent orchestration and profiling workflows
- FastAPI — REST API layer
- Streamlit — Interactive UI
- ChromaDB — Vector store for RAG
- Sentence Transformers — Document embeddings
- MCP (Model Context Protocol) — Live market data integration
- Pydantic v2 — Data validation
Documentation
See docs/00_INDEX.md for the full documentation index.
