Case Study – Investment Advisor


⭐ Investment Advisor — Project Case Study

URL: InvestmentAdvisor.LinhTruong.com

🚀 Overview

Investment Advisor is an AI‑powered portfolio analysis and recommendation platform that helps users understand their current holdings, risk profile, and potential allocation strategies. The system ingests portfolio data, market context, and user preferences, then generates structured insights, risk assessments, and suggested rebalancing strategies.

The goal is to provide explainable, transparent investment guidance, not black‑box predictions—so every recommendation is backed by rationale, constraints, and clear language.


👨‍💻 My Role

  • Architecture:
    Overall system design, data flow, and integration strategy
  • Backend:
    Portfolio ingestion, analytics engine, risk modeling services
  • AI/ML:
    Prompt design, reasoning templates, explanation generation
  • Frontend:
    Dashboard UX for portfolio visualization and recommendations
  • DevOps:
    Deployment, monitoring, and environment configuration

🧩 Problem & Constraints

The platform needed to support real‑world investment scenarios:

  • Ingest portfolios from multiple sources (manual input, CSV, APIs)
  • Handle different asset classes (stocks, ETFs, funds, cash)
  • Provide clear, explainable recommendations (no opaque “buy/sell” calls)
  • Respect user constraints (risk tolerance, time horizon, preferences)
  • Present insights in a way that non‑experts can understand
  • Be extendable to more advanced analytics later (factor exposure, scenarios)

🏗️ 1. System Architecture Diagram

┌───────────────────────────────┬───────────────────────────────┬───────────────────────────────┐
│           Frontend            │        API Gateway Layer       │       Analytics Dashboard      │
│ (Portfolio & Insights UI)     │ (Auth, Routing, Validation)    │ (Charts, Tables, Explanations) │
└───────────────┬───────────────┴───────────────┬───────────────┴───────────────┬───────────────┘
                │                               │                               │
                ▼                               ▼                               ▼
        ┌──────────────────────────┐     ┌──────────────────────────┐     ┌──────────────────────────┐
        │   Portfolio Ingestion    │     │   Portfolio Analytics    │     │   Risk & Profile Engine  │
        │ (CSV/API/User Input)    │     │ (Allocations, Metrics)   │     │ (Risk Score, Tolerance)  │
        └───────────────┬──────────┘     └───────────────┬──────────┘     └───────────────┬──────────┘
                        │                               │                               │
                        └───────────────┬───────────────┴───────────────┬───────────────┘
                                        ▼                               ▼
                              ┌──────────────────────────┐     ┌──────────────────────────┐
                              │   Context Builder        │     │       LLM Layer           │
                              │ (User + Market Context)  │     │ (Advice + Explanation)    │
                              └──────────────────────────┘     └──────────────────────────┘

🔄 2. Data Flow Diagram

┌──────────────────────────┐
│ 1. User Inputs Portfolio │
│ (Manual, CSV, API)       │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 2. API Gateway Validates │
│    & Normalizes Data     │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 3. Portfolio Ingestion   │
│    Stores Holdings       │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 4. Analytics Engine      │
│    Computes Metrics      │
│ (Alloc, Sector, Risk)    │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 5. Risk/Profile Engine   │
│    Applies Constraints   │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 6. Context Builder       │
│    Prepares Prompt Data  │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 7. LLM Layer Generates   │
│    Advice + Explanation  │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 8. UI Renders Insights   │
│    & Recommendations     │
└──────────────────────────┘

🔁 3. Workflow Diagram

┌──────────────────────────┐
│ 1. Start: User Loads App │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 2. User Enters or Uploads│
│    Portfolio Data        │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 3. System Validates Data │
│    & Normalizes Assets   │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 4. Compute Portfolio     │
│    Metrics & Exposures   │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 5. Assess Risk Profile   │
│    & Constraints         │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 6. Generate Advice +     │
│    Explanation (LLM)     │
└───────────────┬──────────┘
                ▼
┌──────────────────────────┐
│ 7. Display Insights,     │
│    Rationale & Next Steps│
└──────────────────────────┘

🤖 4. “Advisor Brain” Coordination Diagram

┌──────────────────────────┐
│   Portfolio Analytics    │
│ (Allocations, Metrics)   │
└───────────────┬──────────┘
                │
                ▼
┌──────────────────────────┐
│  Risk & Profile Engine   │
│ (Tolerance, Horizon)     │
└───────────────┬──────────┘
                │
                ▼
┌──────────────────────────┐
│   Context Builder        │
│ (User + Portfolio +      │
│  Market Summary)         │
└───────────────┬──────────┘
                │
                ▼
┌──────────────────────────┐
│      LLM Layer           │
│ (Advice + Explanation)   │
└───────────────┬──────────┘
                │
                ▼
┌──────────────────────────┐
│  Recommendation Renderer │
│ (UI + Narrative)         │
└──────────────────────────┘

🎨 UX & Design Rationale

  • Single, focused dashboard
    : portfolio, risk, and recommendations in one view
  • Plain‑language explanations
    : every suggestion is accompanied by “why”
  • Visual breakdowns
    : allocations by asset, sector, and risk level
  • Non‑overwhelming defaults
    : hides advanced metrics until requested
  • Clear disclaimers
    : reinforces that this is guidance, not guaranteed returns

🔬 Technical Deep Dive

Portfolio Ingestion & Normalization

  • Parses CSV and API payloads into a unified schema
  • Maps tickers to metadata (sector, asset class, region)
  • Handles missing or partial data gracefully

Analytics Engine

  • Computes allocation percentages, diversification metrics, and concentration
  • Flags overexposure to single assets or sectors
  • Supports extension to factor or scenario analysis

Risk & Profile Engine

  • Encodes user preferences (risk tolerance, time horizon, constraints)
  • Applies simple rules + heuristics to shape recommendations
  • Feeds structured context into the LLM layer

LLM Reasoning Layer

  • Uses structured prompts with:
    • Current allocation summary
    • Risk profile
    • Constraints (e.g., “avoid high‑volatility tech overweight”)
  • Generates:
    • Suggested changes
    • Rationale in plain language
    • Trade‑offs and caveats

📈 Results & Impact

  • Provides instant, explainable portfolio insights without requiring financial expertise
  • Helps users understand risk, concentration, and diversification
  • Creates a foundation for more advanced advisory features (scenarios, tax‑aware suggestions)
  • Demonstrates how AI can be used for transparent decision support, not opaque predictions

🔗 Live Demo

InvestmentAdvisor.LinhTruong.com