📔 Text ➡️ SQL 🧑💻
- How to Use LangChain to Build a Text-to-SQL Solution
- Text2SQL GitHub Repository
- Text2SQL Workshop GitHub Repository
- A Survey on Employing Large Language Models for Text-to-SQL Tasks
- PET-SQL: A Prompt-enhanced Two-stage Text-to-SQL Framework with Cross-consistency
- SeaD: End-to-end Text-to-SQL Generation with Schema-aware Denoising
- Next-Generation Database Interfaces:A Survey of LLM-based Text-to-SQL
1 - install requirements
pip install requirements.txt2- navigate to /data and run sqlite-synthetic.py to create a toy dataset
cd data
python sqlite-synthetic.pyafter this step you should see a synthetic_data.db in /src
3- navigate to src and run either main.py or the UI:
For command line interface:
cd ../src
# Use OpenAI (default)
python main.py
# Or use Google's Gemini model
python main.py -geminiFor the web interface:
cd ../src
# Run the Streamlit UI
python run_ui.pyOptional run visualize_workflows.py to show workflow graphs
Create a keys.env file in the src/agents directory with your API keys:
OPENAI_API_KEY=your_openai_key_here
GOOGLE_API_KEY=your_gemini_key_here # Optional, only if using Gemini
See TODO.md for planned features and improvements.
Langgraph Workflow 🦜
- Master Workflow
- Python Workflow
- SQL Workflow


