--- title: FinAI emoji: 📊 colorFrom: indigo colorTo: purple sdk: docker app_port: 7860 pinned: false short_description: Conversational analytics for Magic Bus India Foundation --- # MBF Insight — Magic Bus AI Insights Platform A Julius.ai-grade dynamic intelligence platform for the Magic Bus India Foundation `magicbusDB` knowledge base. Each query produces a uniquely composed dashboard with citations, multi-modal retrieval (GraphRAG + LlamaIndex SubQuery + Text-to-SQL + pgvector hybrid), and adaptive chart counts/types driven by data + intent. ## Monorepo layout ``` FinAi/ ├── apps/ │ ├── web/ Next.js 15 (App Router) + shadcn/ui │ └── api/ FastAPI orchestrator + LangGraph ├── etl/ Data foundation (MySQL import, PG mirror, Parquet, GraphRAG, vectors) ├── infra/ Docker compose (MySQL, Postgres+pgvector+AGE, Jupyter, Langfuse, Redis) ├── evals/ Gold-query eval harness ├── mbtestdb/ Source MySQL dump (read-only) └── data/ Local snapshots, parquet, graphrag artifacts (gitignored) ``` ## Quick start (local-only) ```powershell # 1. Spin infrastructure docker compose -f infra/docker-compose.yml up -d # 2. Configure secrets (edit .env.local with DeepSeek keys — DO NOT commit) copy .env.local.example .env.local # 3. Import the MySQL dump bash etl/import_mysql.sh # 4. Mirror to Postgres + build dim tables python etl/mirror_to_pg.py # 5. Snapshot Parquet + build vectors + GraphRAG python etl/snapshot_parquet.py python etl/build_vectors.py python etl/build_graphrag.py # 6. Start backend cd apps/api && uvicorn mbf.app:app --reload --port 8000 # 7. Start frontend cd apps/web && pnpm install && pnpm dev ``` ## Security - **Never commit `.env.local`** — it holds the 15 DeepSeek API keys. - The MySQL dump is read-only source-of-truth; the backend connects via a **read-only DB user**. - Generated SQL passes through an **AST allow-list** (SELECT-only, no DDL/DML). See [`/memories/session/plan.md`](./.docs/plan.md) for the full 8-phase plan.