DMDataMind AI

System design

Open-model analytics architecture for scalable file intelligence.

The architecture separates frontend UX, API routing, AI orchestration, data processing, storage, and model provider fallback so each layer can evolve independently.

1

Frontend

Next.js 14, Tailwind, shadcn/ui, chat UI, upload panel, chart renderer, export trigger, workspace management.

2

API Gateway

FastAPI routes, JWT auth, rate limiting, request validation, upload endpoints, and SSE streaming.

3

AI orchestration

LangChain and LlamaIndex for prompts, RAG, model routing, tool use, memory, and response shaping.

4

Processing engine

pandas, numpy, pdfplumber, PyMuPDF, sqlparse, pytesseract, OpenCV, Plotly, and export libraries.

5

Storage

Supabase PostgreSQL, object storage, file metadata, user workspaces, generated charts, and chat history.

6

Model fallback

Groq primary, OpenRouter fallback, Hugging Face inference, and Ollama/local enterprise mode.

Data flow

File analysis request

  1. User uploads a file through the product frontend.
  2. FastAPI validates type and size, stores the file, and returns a file ID.
  3. Background processing profiles the file, extracts text/tables, and builds data summaries.
  4. Embeddings are stored under the user and project namespace for retrieval.
  5. User asks a question; the API builds context from the prompt, file metadata, and retrieved chunks.
  6. Model provider returns streamed response; chart JSON is generated if needed.
  7. Frontend renders text, charts, confidence states, and export actions.

Tech stack

Recommended implementation choices

LayerChoiceReason
FrontendNext.js 14Fast React UI, SSR/SSG, and easy Vercel deployment.
BackendFastAPINative Python data library integration and async APIs.
ChartsPlotly + RechartsInteractive analytics with export-friendly chart output.
Vector DBChromaDB to QdrantStart light in MVP, migrate for production scale.
DatabaseSupabase PostgreSQLManaged DB, RLS, auth, and instant APIs.
ExportWeasyPrint + python-docx + python-pptxServer-side professional report generation.