How to Query Your Database in Plain English with MindsDB

October 24, 2026

MindsDB is an open-source platform that adds a natural-language layer to your existing database: you connect Postgres, MySQL, or BigQuery, ask a question in English, and it generates SQL, runs it, and returns rows. The self-hosted Docker install takes about 20 minutes; connecting a database and running your first query usually fits inside an hour.

It is not a chatbot bolted onto a SQL editor. The interesting part is that MindsDB registers your database as a “data source” and treats AI models as tables you can join against — so a query can mix your orders table with a language model in the same statement.

What is MindsDB actually good at?

Three use cases where it earns its place:

  • Non-engineers asking questions of production data without writing SQL or waiting on the data team.
  • Forecasting. Its time-series models take a table and predict the next N periods, which is genuinely useful for inventory and churn tables.
  • Joining a model to a table. Send each support ticket to a language model for categorization inside a single SQL statement.

What it is not: a BI dashboard. Do not expect it to replace Metabase or Looker for scheduled reporting.

How do you install MindsDB locally?

Docker is the fastest route and the one the docs lead with.

  1. Pull and run the container. docker run -p 47334:47334 -p 47335:47335 mindsdb/mindsdb starts the HTTP API on 47334 and MySQL wire protocol on 47335.
  2. Open the Studio. Browse to http://localhost:47334 for the query editor. There is also a SQL client path if you prefer DBeaver or TablePlus on port 47335.
  3. Check available handlers. Run SHOW HANDLERS; to see which database connectors are built in. Postgres, MySQL, MariaDB, ClickHouse, and Snowflake are all there.

For a production setup, add a volume mount so your models and config survive restarts. Running the container without a volume means every retrain starts from scratch.

How do you connect your database?

You create a database object with credentials, then it behaves like any other schema.

CREATE DATABASE shop
WITH ENGINE = 'postgres',
PARAMETERS = {
  "host": "db.internal",
  "port": 5432,
  "user": "readonly_user",
  "password": "***",
  "database": "orders"
};

Use a read-only user. This is not optional. The natural-language layer generates SQL you have not reviewed, and a permissions mistake becomes a data incident. Create a role that can only SELECT on the schemas you want exposed.

After creating the database, verify with SELECT * FROM shop.orders LIMIT 5;. If that returns rows, the connection is live.

How do you ask a question in English?

Point the natural-language engine at the correct tables first. Vague table scope is the top cause of bad generated SQL.

CREATE DATABASE nl_engine
WITH ENGINE = 'mindsdb',
PARAMETERS = {"tables": ["shop.orders", "shop.customers"]};

Then ask:

SELECT * FROM nl_engine
WHERE question = 'Which five customers had the highest total order value last quarter?'
AND model = 'gpt-4o';

You get back the answer rows plus the generated SQL. Always read the SQL. On a two-table question the model gets it right most of the time; on a five-table join with date logic, accuracy drops and you should expect to rephrase.

Does MindsDB cost anything?

The open-source version is free and self-hosted — MIT licensed, no seat limits. You pay for your own database and for whatever model API you point it at. A typical GPT-4o query costs a fraction of a cent.

MindsDB Cloud is the paid managed option. Pricing is quoted rather than published on a simple page, which is a friction point if you want to budget quickly.

What are the honest limitations?

Accuracy on complex schemas. Column names like amt_usd_pre and amt_usd_post confuse the SQL generator. You can add a description file per column, and you should.

No row-level security passthrough. MindsDB’s permissions are its own. If your Postgres has RLS policies, they apply at the connection level, not per MindsDB user.

Self-hosting is a real job. Upgrades, model retraining, and container health are yours. Teams without someone who owns infrastructure should take the managed route or skip it.

Who should use this?

Small data teams where the analyst is a bottleneck: yes, this removes a real queue. A 200-person company with one BI person will get hours back each week.

Organizations with strict data residency rules and no one to run the container: not yet. The value shrinks if you have to file a ticket every time it needs an upgrade.

Key Takeaways

  • MindsDB is an open-source natural-language SQL layer for Postgres, MySQL, BigQuery and more.
  • Docker install takes about 20 minutes; always mount a volume and use a read-only DB user.
  • Scope the NL engine to specific tables — vague scope is the top cause of wrong SQL.
  • The free self-hosted edition has no seat limits; you only pay your model provider.
  • It struggles with ambiguous column names and complex multi-table joins; read generated SQL every time.

Full setup notes and alternatives are on the MindsDB page at iAIFeed.

Tags: