• TRAINING
  • INFERENCE
  • AUDIT
  • HUMAN

How to train and run SQL models with your AI

Connect MindsDB to your AI client to turn your database into a predictive engine using standard SQL.

Ask AI about this page

Short answer

How can I use SQL to train and run AI models?

You use standard SQL commands to tell MindsDB to train predictors on your data and then query those models for results. Your AI client handles the conversation while the database executes the math. You get immediate predictive insights from your existing tables.

The results of your requests

Where your data turns into intelligence

Your AI manages the lifecycle of a model from creation to inference.

TRAINING

New model creation

The AI sends SQL to MindsDB to build a predictor from your tables. You get a functional model ready for queries.

INFERENCE

Real-time predictions

Your AI runs SQL to pull predictions from active models. You get instant answers based on your live data.

AUDIT

Model status checks

The AI checks which models are active or still training. You get a clear view of your predictive assets.

HUMAN

Logic and tuning

You decide which SQL logic to use for training. The AI executes your commands, but you control the model parameters.

The workflow

What your AI does when you ask for a model.

The AI translates your intent into SQL commands that MindsDB understands.

  1. Check available models

    The AI looks at your MindsDB instance to see what predictors are already built and ready to use.

    list_models
  2. Inspect model settings

    If you ask about a specific predictor, the AI pulls its configuration and metadata.

    get_model
  3. Trigger training

    The AI sends the SQL instructions needed to train a new model on your specific data tables.

    execute_sql_query
  4. Get predictions

    The AI runs the SQL required to generate real-time predictions from your trained models.

    execute_sql_query

Try it

Copy these to start.

Use these prompts to interact with your data immediately.

Starting points

Swap the names in quotes for your actual table or model names.

MindsDB Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_wo8z4btUozCcWNcaSyNerjmMILAoiY0Mm4LOh9m9/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — MindsDB capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "mindsdb-ai-database-predictors-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_wo8z4btUozCcWNcaSyNerjmMILAoiY0Mm4LOh9m9/mcp"
    }
  }
}
Copy into chat04
  • List all the models currently in my MindsDB instance.

  • Show me the details for the 'customer_churn' model.

  • Train a new model using my 'sales_history' table.

  • Predict the next order date using the 'delivery_predictor' model.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect MindsDB once, then ask.

Connect your account in one click. Your credentials stay encrypted, and you can start querying your database through your AI client right away.

Connect MindsDB to your AI

FAQ

How this task behaves

  • 01

    Can the AI delete my database tables?

    No. The tools only allow for model management and SQL execution. The AI cannot drop or delete your underlying tables.

  • 02

    Does the AI write the SQL for me?

    Yes. When you ask to train a model or get a prediction, the AI generates the SQL and runs it via the execution tool.

  • 03

    Can the AI create new database schemas?

    No. The AI is limited to the tools provided, which do not include schema modification or table creation.

  • 04

    Can I see the training progress?

    Yes. You can ask the AI to check the status of your models to see if they are still training or ready.

  • 05

    Can the AI manage my database users?

    No. There are no tools available for user administration or permission management.

  • More questions about MindsDB? See everything the MindsDB Connector can do

Connect MindsDB to Claude, Cursor, ChatGPT & more