# BankBot AI — Presentation Structure (12 Slides) --- ## Slide 1 — Title Slide **BankBot AI** *An AI-Native Financial Operating System* Subtitle: Production-grade · Real-time · Intelligent Visual: Dark glassmorphism background, animated gradient orb, tech badges --- ## Slide 2 — Problem Statement **Traditional banking apps are passive. BankBot is intelligent.** | Problem | BankBot Solution | |---------|-----------------| | Banks show data, not insights | AI-powered financial analysis | | No real-time fraud intelligence | Live anomaly detection scoring | | No personalized coaching | Financial health score + AI briefing | | No scenario planning | What-If Simulator with 36-month projection | | No behavioral analysis | Spending heatmap + pattern detection | Visual: Side-by-side comparison screenshot --- ## Slide 3 — Solution Overview **Your AI Financial Twin** 5 core capabilities: 1. Real-time AI chat with full financial context 2. Predictive balance forecasting (conservative/expected/optimistic) 3. Automated fraud detection (4-factor scoring) 4. Behavioral spending analysis (heatmap, patterns) 5. Interactive what-if financial simulator Visual: Dashboard screenshot --- ## Slide 4 — System Architecture **Production-Grade Full-Stack Architecture** ``` Next.js 14 Frontend ↕ HTTPS / WSS Nginx (TLS + Rate Limiting) ↕ FastAPI Backend (33 routes) ↕ ↕ ↕ PostgreSQL 15 Redis 7 AI Engine → SQLite → memory OpenAI → Groq fallback fallback → Ollama → offline ``` Key point: **Every layer has a fallback — the system never fully fails** --- ## Slide 5 — AI Intelligence Engine **4-Tier AI Fallback Chain** ``` Priority 1: OpenAI GPT-4o-mini (fastest, most capable) ↓ if unavailable Priority 2: Groq llama-3.3-70b (free tier, very fast) ↓ if unavailable Priority 3: Local Ollama llama3 (fully offline) ↓ if unavailable Priority 4: Rule-based engine (always available) ``` Context injected per message: - Live account balances · Transaction history - Financial goals · Investment portfolio - Behavioral patterns · Health score Visual: Chat page with streaming animation --- ## Slide 6 — Real-Time WebSocket Architecture **Streaming AI + Live Updates** ``` Browser ──WS connect──► FastAPI Browser ──{ type: "chat", message: "..." }──► ◄──{ type: "chat_start" }── ◄──{ type: "chat_chunk", content: "H" }── ◄──{ type: "chat_chunk", content: "er" }── ◄──{ type: "chat_end" }── Browser ──{ type: "ping" }──► (every 25s) ◄──{ type: "pong" }── ``` Features: - Character-by-character streaming - Heartbeat every 25s - Exponential backoff reconnect (1s → 2s → 4s → 30s max) - HTTP fallback when WebSocket unavailable - Prompt injection prevention (9 regex patterns) --- ## Slide 7 — Financial Intelligence **AI-Powered Analytics** - **Health Score** — 100-point composite (6 dimensions) - **Spending Heatmap** — weekly activity patterns - **Category Intelligence** — AI insights per spending category - **Net Worth Timeline** — balance trajectory - **Behavioral Analysis** — late-night spending, weekend patterns - **Subscription Optimization** — detect unused subscriptions Visual: Analytics page screenshot --- ## Slide 8 — Fraud Detection Algorithm **Real-Time Anomaly Scoring** ``` Transaction → Score 4 factors: Amount spike > 3.5x avg → +40 pts Timing anomaly 11PM–4AM → +25 pts Rapid-fire < 3min gap → +20 pts Duplicate same+10min → +30 pts Score ≥ 30 → logged to fraud_logs Score ≥ 50 → status: "flagged" Score < 30 → status: "verified" ``` Visual: Fraud alert notification screenshot --- ## Slide 9 — Performance & Caching **Cache-Aside Pattern with Auto-Fallback** | Endpoint | Cold | Cached | TTL | |----------|------|--------|-----| | Dashboard | 65ms | 10ms | 2 min | | AI Score | ~2s | 10ms | 10 min | | AI Briefing | ~3s | 10ms | 1 hr | | Transactions | 18ms | — | — | Optimization: `Query.with_entities()` — column-only queries, no ORM hydration Result: **32x speedup** (2.1s → 65ms) Cache: Redis → in-memory fallback (automatic, zero config) --- ## Slide 10 — Database Design **10-Table Normalized Schema** Core tables: - `users` — profile, personality, AI settings - `accounts` — checking/savings/investment - `transactions` — 300+ with categories, tags, emotion labels - `goals` — target amounts, AI-generated plans - `investments` — portfolio with AI risk analysis - `subscriptions` — with AI usage detection - `notifications` — typed alerts (fraud/insight/warning) - `fraud_logs` — risk scores, details, status - `ai_insights` — cached AI-generated content - `analytics_snapshots` — daily financial snapshots Fallback: PostgreSQL → SQLite (automatic, same ORM code) --- ## Slide 11 — Security & Observability **Production-Grade Engineering** Security: - JWT (60min access + 7-day refresh rotation) - bcrypt hashing (rounds=12, direct library) - Rate limiting (120/min API, 10/min auth) - Security headers (CSP, X-Frame-Options, etc.) - Prompt injection prevention (9 patterns) - CORS restricted to configured origins Observability (`GET /api/metrics`): - Request count, error rate, auth failures - AI provider health (calls/errors/latency) - Cache hit ratio - Per-route timing (avg + max) - Last 50 errors with timestamps CI/CD: GitHub Actions (backend lint, frontend build, Docker smoke test) --- ## Slide 12 — Demo + Conclusion **Live Demo** Demo flow (5 min): 1. Login → Dashboard (65ms load) 2. AI Chat → WebSocket streaming 3. What-If Simulator → live sliders 4. Analytics → heatmap + radar 5. System Status → live metrics **What makes this different:** - Not a prototype — deployable to production today - Every feature backed by real data (301 transactions) - AI that knows your finances, not generic advice - Resilient architecture that never fully fails - Full observability — you can see it working **Numbers:** 33 routes · 14 pages · 10 DB tables · 65ms dashboard · 4-tier AI fallback --- ## Presenter Notes **Opening line:** > "Most banking apps show you data. BankBot understands it." **Closing line:** > "This isn't a student project that happens to use an AI API. It's a production-grade system where AI is the core — every response is personalized, every insight is grounded in real data, and every layer has a fallback." **If asked about deployment:** > "The frontend is on Vercel, the backend on Render with managed PostgreSQL and Redis. The whole stack can also run locally with a single command — `run.bat` on Windows." **If asked about the most impressive feature:** > "The AI orchestration layer. It builds a personalized system prompt from the user's live database records, streams the response through whichever AI provider is available, and falls back gracefully through 4 levels. Very few projects implement this kind of resilient AI infrastructure."