How morglinf/insightai works
InsightAI is a dataset-upload and natural-language analytics application. Users upload files, receive dataset analysis and generated business insights, then ask questions answered with retrieved dataset context and streamed AI responses. The graph includes the documented analytics, RAG, and dashboard capabilities. Route, API-client, and several UI implementation excerpts were not provided, so links involving those modules follow the documented API and workflow; uncertain internal wiring is omitted.
Main entry points: upload.py Upload API · ChatPage.js Chat page · chat.py Chat API · App.js App
Components 23
React dashboard
- App
frontend/src/App.js - Chat page
frontend/src/pages/ChatPage.js - Dataset state
frontend/src/context/DatasetContext.js - Chat interface
frontend/src/components/chat/ChatWindow.js - Analytics panel
frontend/src/components/analytics/AnalyticsPanel.js - API client
frontend/src/api/client.js
API and dataset handling
- Upload API
backend/app/routes/upload.py - Chat API
backend/app/routes/chat.py - File parser
backend/app/utils/file_parser.py - CSV profiling
backend/app/services/csv_engine.py - File registry
backend/app/services/file_registry.py - FastAPI app
backend/app/main.py
Analytics and insights
- Insight analysis
backend/app/services/insight_engine.py
RAG and generation
- RAG ingestion
backend/app/services/rag/ingest.py - Text chunker
backend/app/services/rag/chunker.py - Vector store
backend/app/services/rag/vector_store.py - Context retrieval
backend/app/services/rag/retriever.py - LLM engine
backend/app/services/llm_engine.py
Persistence
- SQLite database
backend/app/database.py - Dataset model
backend/app/models/dataset.py - Insight model
backend/app/models/insight.py
Other components
- User
- OpenAI
Connections 24
- User → App: uses
- App → Chat page: renders
- App → Dataset state: provides state
- Chat page → Chat interface: shows
- Chat page → Analytics panel: shows
- Chat page → API client: requests
- API client → Upload API: uploads
- API client → Chat API: sends questions
- FastAPI app → Upload API: registers route
- FastAPI app → Chat API: registers route
- Upload API → File parser: processes file
- Upload API → CSV profiling: profiles CSV
- Upload API → File registry: registers file
- Upload API → RAG ingestion: ingests data
- Upload API → Insight analysis: generates insights
- RAG ingestion → Text chunker: chunks text
- RAG ingestion → Vector store: stores chunks
- Chat API → Context retrieval: retrieves context
- Context retrieval → Vector store: searches
- Chat API → LLM engine: streams response
- LLM engine → OpenAI: requests completion
- Insight analysis → OpenAI: generates summary
- Dataset model → SQLite database: persists dataset
- Insight model → SQLite database: persists insight