Spaces:
Build error
Build error
metadata
title: BankBot AI
emoji: π¦
colorFrom: blue
colorTo: green
sdk: docker
pinned: true
license: mit
short_description: >-
AI-Native Financial Operating System β real-time streaming, fraud detection,
forecasting
π¦ BankBot AI
AI-Native Financial Operating System
A production-grade AI fintech platform with real-time WebSocket streaming, multi-provider AI fallback, fraud detection, financial forecasting, and a premium glassmorphism UI.
π Demo
Login with the demo account:
Email: alex@bankbot.dev
Password: BankBot2026!
The demo account includes:
- $59,637 across 3 accounts (checking Β· savings Β· investment)
- 301 transactions across 6 months
- 1 fraud alert (Tech Store NYC, $847, 78% risk score)
- 4 financial goals (Emergency Fund Β· Vacation Β· MacBook Β· Down Payment)
- 4 investments (S&P 500 Β· AAPL Β· BTC Β· Treasury Bonds)
- 6 notifications (3 unread)
β¨ Features
π€ AI Financial Twin
- Contextual chat β AI knows your real balance, goals, investments, and spending patterns
- 4-tier AI fallback: OpenAI β Groq β Ollama β Rule-based (always responds)
- Real-time streaming via WebSocket β character-by-character with auto-reconnect
π Financial Intelligence
- Health Score β 100-point composite across 6 dimensions
- What-If Simulator β 6 sliders, instant 36-month projection
- Spending Heatmap β weekly behavioral patterns
- Category Intelligence β AI insights per spending category
π‘οΈ Fraud Detection
- Real-time scoring β amount spikes, timing anomalies, rapid-fire, duplicates
- Risk levels β verified / suspicious / flagged
- Live alerts β notification panel with unread count
β‘ Performance
- Dashboard: 65ms cold, 10ms cached
- Cache-aside: Redis β in-memory fallback (automatic)
- All data endpoints: < 20ms warm
π Observability
- Live metrics at
/api/metrics - System Status page at
/status - Structured JSON logging with request tracing
ποΈ Architecture
Browser (port 7860)
β
βΌ
Nginx (port 7860) β single entry point
β β
βΌ βΌ
Next.js (3000) FastAPI (8000)
β β
ββββββββββββββββββββββ€
β
ββββββββββββ΄βββββββββββ
β β
SQLite/PostgreSQL Redis/Memory
(auto-fallback) (auto-fallback)
β
ββββββββββββ΄βββββββββββ
β β β
OpenAI Groq Ollama
(P1) (P2) (P3)
Rule-based (P4)
βοΈ Configuration (HF Secrets)
Set these in your Space's Settings β Repository secrets:
| Secret | Required | Description |
|---|---|---|
OPENAI_API_KEY |
Optional* | OpenAI GPT-4o-mini |
GROQ_API_KEY |
Optional* | Groq llama-3.3-70b (free) |
JWT_SECRET_KEY |
Recommended | JWT signing secret |
DATABASE_URL |
Optional | External PostgreSQL (Neon/Supabase) |
REDIS_URL |
Optional | External Redis |
*At least one AI key recommended. Without any key, the app uses rule-based responses from your actual financial data.
Get a free Groq key: https://console.groq.com/keys
ποΈ Database Options
Option 1: SQLite (Default β works out of the box)
No configuration needed. Data resets on Space restart (fine for demo).
Option 2: Neon PostgreSQL (Persistent)
- Create free DB at https://neon.tech
- Set
DATABASE_URLsecret:postgresql://user:pass@ep-xxx.neon.tech/bankbot?sslmode=require
Option 3: Supabase PostgreSQL (Persistent)
- Create project at https://supabase.com
- Set
DATABASE_URLfrom Settings β Database β Connection string
π‘ API Endpoints
GET /health Health check
GET /api/status Runtime info
GET /api/metrics Live observability
GET /docs Interactive API docs
POST /api/auth/login Login β JWT
POST /api/auth/register Register
GET /api/dashboard/overview Full dashboard (65ms)
GET /api/transactions/ Transaction history
GET /api/notifications/ Notifications
GET /api/ai/coaching/score Health score
GET /api/ai/fraud/analysis Fraud alerts
POST /api/ai/chat HTTP chat
WS /api/ai/chat/ws Streaming chat
π οΈ Tech Stack
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, TypeScript, Tailwind CSS |
| Animation | Framer Motion |
| Charts | Recharts |
| State | Zustand |
| Backend | FastAPI, Python 3.11 |
| Database | PostgreSQL / SQLite fallback |
| Cache | Redis / in-memory fallback |
| Auth | JWT (python-jose), bcrypt |
| AI | OpenAI / Groq / Ollama / Rule-based |
| Container | Docker (single container) |
| Proxy | Nginx (port 7860) |
π Source Code
Full source: GitHub Repository
Documentation: