Make data analysis as easy as chatting
English | δΈζThis project is an NL2SQL data analysis system built on LangChain 1.0, using FastAPI + React.
You can use natural language to query, aggregate, and visualize data from a database or uploaded CSV/Excel files. No SQL needed β charts and results are generated automatically.
- Batch upload
.csv/.excelfiles, automatically parse and ingest into a temporary database, support data retrieval, visualization, and detailed analytical report generation based on the file contents. - Automatically extract headers, estimate row counts, and other basic metadata to support quick exploration.
- Integrates LangChain SQL Agent to automatically convert natural language into SQL queries.
- Supports connecting to local/cloud databases, selecting tables, and asking questions in natural language.
- Choose single-table or multi-table automatic analysis; the system generates SQL queries in real time and executes them, then builds visualizations based on the query results.
redpandacompress_nl2sql.mp4
βββ backend/ # Backend (FastAPI + LangChain)
β βββ app/ # Core app (routes, Agent, visualization)
β βββ data/ # Data directory (uploads & visualization outputs)
β βββ requirements.txt # Python dependencies
β βββ api_with_db.py # Launch script (with temporary DB)
β βββ .env # Environment variables (recommended here)
βββ frontend/ # Frontend (React + Vite)
β βββ src/ # Pages & components
β βββ package.json # Node project configuration
βββ README.md
Create and fill backend/.env with:
OPENAI_API_KEY=sk-your-api-key
OPENAI_BASE_URL=https://api.openai.com/v1
DEFAULT_MODEL=gpt-4o-mini
# 1. Enter the backend directory cd backend # 2. Create and activate a virtual environment python -m venv venv source venv/bin/activate # Linux/Mac # or venv\Scripts\activate # Windows # 3. Install dependencies pip install -r requirements.txt # 4. Start the service python api_with_db.py
# 1. Enter the frontend directory cd frontend # 2. Install dependencies npm install # 3. Start the dev server npm run dev
We welcome contributions via PRs and issues on GitHub. Contributions of all kinds are appreciated β feature improvements, bug fixes, and documentation enhancements.
Explore our tech community π LLM Tech Community | Fanfan Space
Scan to add our assistant and reply with βNL2SQLβ to join the tech discussion group.



