# Chat with your database in plain English — locally, for free

> Source: <https://dev.to/retrovirusretro/chat-with-your-database-in-plain-english-locally-for-free-2l0c>
> Published: 2026-05-20 21:28:03+00:00

"What were our top 10 customers last quarter by revenue, as a bar chart?"
DB-GPT translates that to SQL, runs it against your database, and renders the chart. No SQL knowledge required. Fully local. MIT licensed. 17K GitHub stars — almost no English content.
DB-GPT is an open-source framework that puts a natural language interface on top of your databases. You connect PostgreSQL, MySQL, SQLite, or others — then ask questions in plain English. It generates the SQL, executes it, and can visualize results automatically.
Think Metabase meets AI, but fully self-hosted and free.
PostgreSQL · MySQL · MariaDB · SQLite · ClickHouse · DuckDB · Spark SQL
Clone the repo, copy .env.example
to .env
, add your database connection string, then docker compose up -d
. Open localhost:5670
→ admin / admin
→ Settings → Database → Add → paste connection string.
Full docker-compose: chinese-ai-tools-english-guide/tools/db-gpt
Once your database is connected:
DB-GPT generates SQL for each, runs it, returns results. Charts render automatically in the UI.
Settings → LLM Provider → Ollama → Base URL: http://ollama:11434/v1
→ Model: llama3
For best SQL accuracy use sqlcoder
— fine-tuned specifically for SQL generation. Pull it with docker exec -it ollama ollama pull sqlcoder
.
Both let you query databases with natural language:
DB-GPT if you want a complete self-contained app. Vanna.ai if you're embedding the capability programmatically into your own product.
A ready-to-import workflow JSON is in the repo (integration/n8n-workflows/db-gpt-query.json
). POST {question, db_name}
→ returns {answer, sql, data}
.
→ chinese-ai-tools-english-guide
Previous articles in this series:
Your data never leaves your machine. No API keys, no cloud, no SQL knowledge needed.
