Design, modify, and query databases using natural language.
DB Studio is an agent-based platform that enables users to:
- 🏗️ Create databases from requirements
- ✏️ Modify schemas safely
- 💬 Query data using natural language (NL → SQL)
Built with LLM agents, validation pipelines, and cloud-backed storage.
DB Studio is a modular AI-powered platform that allows users to interact with databases without writing SQL manually.
It combines:
- Natural language processing
- Agent-based workflows
- Structured validation pipelines
- Cloud persistence
The system is designed for:
- Rapid database prototyping
- Safe schema evolution
- Intelligent querying with explainability
- Convert business requirements → database schema
- Generate tables and relationships
- Produce SQLite database files
- Generate schema documentation / ERD
- Modify existing schemas safely
- Validate schema changes before applying
- Approval workflow before execution
- Preserve database integrity
- Natural Language → SQL generation
- Query validation pipeline
- Human approval workflow
- SQL execution
- Natural language response generation
- Query traceability/debugging
The project follows a feature-based modular architecture:
app.py
feature1_app.py
feature2_app.py
feature3_app.py
Features/
│
├── Feature1_create_db/
├── Feature2_modify_db/
├── Feature3_chat_db/
│
shared/
├── config.py
├── blob_storage.py
├── workspace.py
User Input (UI)
↓
Workspace State Update
↓
Agent Pipeline
↓
SQL Generation
↓
Validation / Approval
↓
Execution (SQLite)
↓
Results + NL Response
↓
Persist to Blob Storage
Python Streamlit Azure OpenAI Azure Blob Storage SQLite Pydantic LangGraph / Agent workflows SQL validation pipelines
git clone https://github.com/your-username/DB-Studio.git
cd DB-Studiopython3 -m venv .venv
source .venv/bin/activateFor Windows:
.venv\Scripts\activatepip install -r requirements.txtCopy the example environment file:
cp .env.example .envThen open .env and fill in your credentials:
- Azure OpenAI credentials
- Azure Blob Storage credentials
- deployment names
- required environment variables
streamlit run app.pyShow top selling products
NL Query
→ SQL Generation
→ Validation
→ Execution
→ Response
- Generated SQL query
- Query results table
- Natural language explanation
DB-Studio/
├── app.py
├── feature1_app.py
├── feature2_app.py
├── feature3_app.py
├── Features/
│ ├── Feature1_create_db/
│ ├── Feature2_modify_db/
│ └── Feature3_chat_db/
├── shared/
│ ├── config.py
│ ├── blob_storage.py
│ └── workspace.py
├── requirements.txt
└── README.md- Never commit
.env - Never expose API keys
- Use secret managers in production
- Secure database credentials
- Unit tests for agent nodes
- Blob storage mocking
- Integration testing for NL → SQL flow
- Dockerize the application
- Use HTTPS proxy
- Inject secrets via CI/CD
- Monitor logs