Docs/AI Features

Natural Language Queries#

QueryMind's AI Assistant can generate SQL queries from plain English descriptions.

How It Works#

  1. Describe what you want in natural language
  2. AI analyzes your schema to understand your database structure
  3. SQL is generated tailored to your specific tables and columns
  4. Review and execute the generated query

Using the AI Assistant#

Open the Assistant#

Click the AI Assistant button in the top-right corner, or use:

  • Cmd+Shift+A (Mac)
  • Ctrl+Shift+A (Windows/Linux)

Write Your Request#

Be specific about what data you want:

Good examples:

"Show all customers who made a purchase in the last 30 days"

"Find products with inventory below 10 units, sorted by stock level"

"Get total revenue by month for 2024"

Tips for better results:

  • Mention specific table or column names if you know them
  • Include any filters or conditions
  • Specify how results should be sorted

Review the Query#

The AI will show:

  • The generated SQL query
  • An explanation of what the query does
  • Any assumptions made about your data

Execute or Modify#

  • Click Execute to run the query
  • Edit the SQL if needed before running
  • Ask follow-up questions to refine the query

AI Providers#

QueryMind supports multiple AI providers:

ProviderModelsBest For
OpenAIGPT-4, GPT-4oComplex queries, best accuracy
AnthropicClaude 3.5Detailed explanations
GoogleGemini ProFast responses

Changing Provider#

  1. Go to Settings > AI
  2. Select your preferred provider
  3. (Optional) Enter your own API key

Bring Your Own Key (BYOK)#

Use your own API key for unlimited queries:

  1. Go to Settings > AI
  2. Enable "Use my own API key"
  3. Enter your API key for OpenAI, Anthropic, or Google
  4. Your key is stored securely in your OS keychain

Query Types#

The AI can generate various query types:

SELECT Queries#

Data retrieval with joins, filters, aggregations

INSERT/UPDATE/DELETE#

Data modification (requires confirmation)

DDL Statements#

Table creation, alterations (requires confirmation)

Safety: DML and DDL queries require explicit confirmation before execution.

Limitations#

  • AI may occasionally generate incorrect queries
  • Always review generated SQL before executing
  • Complex business logic may need manual adjustments
  • Schema must be connected for AI to analyze

Next Steps#