Docs/AI Features
Natural Language Queries#
QueryMind's AI Assistant can generate SQL queries from plain English descriptions.
How It Works#
- Describe what you want in natural language
- AI analyzes your schema to understand your database structure
- SQL is generated tailored to your specific tables and columns
- 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:
| Provider | Models | Best For |
|---|---|---|
| OpenAI | GPT-4, GPT-4o | Complex queries, best accuracy |
| Anthropic | Claude 3.5 | Detailed explanations |
| Gemini Pro | Fast responses |
Changing Provider#
- Go to Settings > AI
- Select your preferred provider
- (Optional) Enter your own API key
Bring Your Own Key (BYOK)#
Use your own API key for unlimited queries:
- Go to Settings > AI
- Enable "Use my own API key"
- Enter your API key for OpenAI, Anthropic, or Google
- 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