sykang16/agentic-wealth-intelligence
0
1---2title: Agentic Wealth Intelligence3emoji: π4colorFrom: blue5colorTo: purple6sdk: streamlit7sdk_version: 1.55.08app_file: ui/streamlit_app.py9pinned: false10---11 12# Agentic Wealth Intelligence13 14AI-powered wealth management system with multi-agent orchestration, conversational profiling, RAG-enhanced recommendations, and real-time market data integration.15 16## Architecture17 18**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.19 20### Outer Orchestrator Graph21 22```23 ββββββββββββββββββββββββββββββββββββββββ24 User βββββββΊβ Router β25 β Tier 1: Keyword match (fast path) β26 β Tier 2: LLM fallback (T=0) β27 ββββββββββββββββ¬ββββββββββββββββββββββββ28 β conditional routing29 ββββββββββββββββββββββββββΌβββββββββββββββββββ¬βββββββββββββββ30 βΌ βΌ βΌ βΌ31ββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββ32β Portfolio β β Profiling β β Recommend β β General β33β Module A β β Module B β β [Subgraph] β β (LLM) β34β AssetAgent β β slot-filling β β Supervisor β β β35ββββββββ¬ββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββ¬ββββββ36 ββββββββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββ37 β38 ββββββββΌβββββββ39 β Respond ββββΊ END40 βββββββββββββββ41```42 43### Recommendation Supervisor Subgraph44 45```46βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ47β Supervisor (LLM decision Β· guard: steps <= 5) β48β ββββββββββββββββββββββ¬βββββββββββββββββββ β49β βΌ βΌ βΌ β50β βββββββββββββββ ββββββββββββββββ ββββββββββββββββ β51β βportfolio_ β βprofiling_ β β recommend β β52β βfetch β βfetch β β synthesis β β53β βAssetAgent β βget_profile_ β β RAG + MCP β β54β β.process() β β summary() β β β β55β ββββββββ¬βββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β56β βββββββββββββββββββ΄βββββββββββββββββββ β57β loops back to Supervisor β58β finish ββββββΊ Respond β59βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ60```61 62**Modules:**63- **Portfolio Analysis** β Natural language queries about your holdings, net worth, allocation, gains/losses64- **Investment Profiling** β Conversational slot-filling to build your risk/preference profile65- **Recommendations** β AI-generated investment advice using portfolio data, RAG knowledge base, and live market data66- **AI Advisor** β Unified chat interface that automatically routes to the right module67 68## Quick Start69 70### 1. Install Dependencies71 72```bash73pip install -r requirements.txt74```75 76### 2. Configure Environment77 78Copy `.env.example` to `.env` and set your API keys:79 80```bash81cp .env.example .env82```83 84Required (at least one LLM provider):85- `OPENAI_API_KEY` β OpenAI GPT-4o86- `ANTHROPIC_API_KEY` β Anthropic Claude87- `GEMINI_API_KEY` β Google Gemini88 89Optional (for live data):90- `ALPHA_VANTAGE_API_KEY` β Market quotes and financial news91- `NEWS_API_KEY` β Business news92- `SEC_USER_AGENT` β SEC EDGAR filings93 94### 3. Generate Synthetic Data95 96```python97from backend.src.data_generation import generate_sample_data98generate_sample_data()99```100 101### 4. Run the Streamlit UI102 103```bash104python -m streamlit run ui/streamlit_app.py105```106 107### 5. Run the API Server108 109```bash110uvicorn backend.src.api.app:app --reload111```112 113API documentation available at `http://localhost:8000/docs`.114 115## API Endpoints116 117| Method | Endpoint | Description |118|--------|----------|-------------|119| `POST` | `/api/v1/chat` | Unified orchestrator chat |120| `GET` | `/api/v1/portfolio/{user_id}` | Portfolio summary |121| `POST` | `/api/v1/portfolio/{user_id}/query` | Natural language portfolio query |122| `POST` | `/api/v1/profiling/{user_id}/start` | Start profiling session |123| `POST` | `/api/v1/profiling/{user_id}/respond` | Continue profiling conversation |124| `POST` | `/api/v1/recommendations/generate` | Generate recommendations |125| `GET` | `/health` | Health check |126 127## Project Structure128 129```130backend/131βββ src/132β βββ agents/ # Agent implementations133β β βββ asset_agent.py # Portfolio query agent134β β βββ orchestrator.py # Multi-agent orchestrator135β βββ api/ # FastAPI application136β β βββ app.py # App factory137β β βββ dependencies.py # Dependency injection138β β βββ schemas.py # Request/response models139β β βββ routes/ # API route handlers140β βββ asset_management/ # Module A: Portfolio data141β βββ common/ # Shared models, LLM client142β βββ multi_agent/ # LangGraph orchestrator143β β βββ state.py # State definitions144β β βββ routing.py # Intent classification145β β βββ nodes.py # Graph node functions146β β βββ graph.py # Graph construction147β βββ profiling/ # Module B: Slot-filling agent148β βββ recommendation/ # Module C: RAG + recommendations149β βββ mcp/ # MCP servers for live data150ui/151βββ streamlit_app.py # Main Streamlit application152tests/153βββ unit/ # Unit tests154βββ integration/ # Integration tests155βββ e2e/ # End-to-end tests156```157 158## Running Tests159 160```bash161# All tests162pytest tests/ -v163 164# Specific test categories165pytest tests/unit/ -v166pytest tests/integration/ -v167pytest tests/e2e/ -v168```169 170## Tech Stack171 172- **Python 3.11+** β Core language173- **LangGraph** β Multi-agent orchestration and profiling workflows174- **FastAPI** β REST API layer175- **Streamlit** β Interactive UI176- **ChromaDB** β Vector store for RAG177- **Sentence Transformers** β Document embeddings178- **MCP (Model Context Protocol)** β Live market data integration179- **Pydantic v2** β Data validation180 181## Documentation182 183See [docs/00_INDEX.md](docs/00_INDEX.md) for the full documentation index.184 