GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - fufankeji/NL2SQL-Data-Analyst: NL2SQL data analysis with LangChain β€” query in natural language and auto-visualize results.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
backend
backend
 
 
frontend
frontend
 
 
README.md
README.md
 
 
README_zh.md
README_zh.md
 
 

Repository files navigation

πŸš€ NL2SQL Data Analysis System Powered by LangChain

Make data analysis as easy as chatting

English | δΈ­ζ–‡

⚑ Project Overview

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.

🎯 Key Features

πŸ” Data Processing & Ingestion

  • Batch upload .csv / .excel files, 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.

πŸ€– Natural Language to SQL (NL2SQL)

  • 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.

πŸ“ˆ Data Visualization

  • 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.

πŸŽ₯ Demo

redpandacompress_nl2sql.mp4

πŸ“ Project Structure

β”œβ”€β”€ 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

πŸš€ Quick Start

1. Configure Environment Variables (.env file)

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

2. Start the Backend Service

# 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

3. Start the Frontend Service

# 1. Enter the frontend directory
cd frontend

# 2. Install dependencies
npm install

# 3. Start the dev server
npm run dev

πŸ™ˆ Contributing

We welcome contributions via PRs and issues on GitHub. Contributions of all kinds are appreciated β€” feature improvements, bug fixes, and documentation enhancements.

😎 Community

Explore our tech community πŸ‘‰ LLM Tech Community | Fanfan Space

Scan to add our assistant and reply with β€œNL2SQL” to join the tech discussion group.

Community QR Code

About

NL2SQL data analysis with LangChain β€” query in natural language and auto-visualize results.

Resources

Readme
Activity

Stars

15 stars

Watchers

0 watching

Forks

10 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.