AI Assistant
PondPilot’s AI assistant helps you write SQL using natural language, fix errors, and optimize queries. It works with OpenAI, Anthropic (Claude), or custom API endpoints.
Getting Started
Section titled “Getting Started”Setting Up
Section titled “Setting Up”- Open Settings (gear icon or Ctrl+K → Settings)
- Navigate to AI Assistant
- Select your provider (OpenAI, Anthropic, or Custom)
- Enter your API key
- Choose a model
Opening the Assistant
Section titled “Opening the Assistant”- Press Ctrl+I (or ⌘+I on Mac)
- Or click the AI button in the editor toolbar
Supported Providers
Section titled “Supported Providers”OpenAI
Section titled “OpenAI”| Model | Best For |
|---|---|
| GPT-4.1 | Complex SQL optimization, best quality |
| GPT-4.1 Mini | Balanced speed and quality |
| o4-mini | SQL analysis with reasoning |
| o3-mini | Cost-efficient reasoning |
Anthropic (Claude)
Section titled “Anthropic (Claude)”| Model | Best For |
|---|---|
| Claude 4 Opus | Complex reasoning, detailed explanations |
| Claude 4 Sonnet | Fast and efficient (recommended) |
Custom Endpoints
Section titled “Custom Endpoints”Use any OpenAI-compatible API:
- Select “Custom” as provider
- Enter your API endpoint URL
- Choose authentication type:
- Bearer Token -
Authorization: Bearer <key> - X-API-Key -
x-api-key: <key>
- Bearer Token -
- Enter your API key
- Specify the model name
Using the Assistant
Section titled “Using the Assistant”Natural Language to SQL
Section titled “Natural Language to SQL”Describe what you want in plain English:
Show me the top 10 customers by total order valueThe AI generates:
SELECT customer_id, customer_name, SUM(order_value) as total_valueFROM ordersJOIN customers ON orders.customer_id = customers.idGROUP BY customer_id, customer_nameORDER BY total_value DESCLIMIT 10;Mentioning Tables and Columns
Section titled “Mentioning Tables and Columns”Use @mentions to reference specific tables and columns:
Calculate the average @orders.amount grouped by @customers.regionThe AI understands your exact schema and generates accurate queries.
Fixing Errors
Section titled “Fixing Errors”When you have a SQL error, the AI can help:
- Run your query and get an error
- Open the AI assistant (Ctrl+I)
- Ask “Fix this error” or describe the issue
- Apply the suggested fix
The AI sees your error message and provides a corrected query.
Optimizing Queries
Section titled “Optimizing Queries”Ask the AI to improve performance:
Optimize this query for better performanceThe AI analyzes your query and suggests:
- Index recommendations
- Query restructuring
- More efficient joins
- Reduced data scanning
AI Capabilities
Section titled “AI Capabilities”What the AI Can Do
Section titled “What the AI Can Do”| Task | Example Prompt |
|---|---|
| Create | ”Write a query to find duplicate records” |
| Explain | ”Explain what this query does” |
| Fix | ”Fix the syntax error in this query” |
| Optimize | ”Make this query faster” |
| Convert | ”Rewrite using a CTE instead of subquery” |
| Debug | ”Why is this returning no results?” |
AI Response Format
Section titled “AI Response Format”The AI provides structured responses:
- Summary - Brief explanation of the assistance
- Code Changes - Specific modifications to apply
- Explanation - Why the changes work
- Alternatives - Other approaches with trade-offs
- Warnings - Important considerations
Applying Suggestions
Section titled “Applying Suggestions”After the AI responds:
- Accept - Apply the suggested changes
- Copy - Copy the SQL to clipboard
- Reject - Dismiss the suggestion
Privacy & Security
Section titled “Privacy & Security”What Data Is Sent
Section titled “What Data Is Sent”The AI assistant sends only:
- Your current SQL query
- Database schema (table and column names/types)
- Your natural language prompt
- Error messages (if fixing errors)
What Is NOT Sent
Section titled “What Is NOT Sent”- Your actual data - Row contents are never transmitted
- File contents - Only metadata about structure
- Other queries - Only the current query context
API Key Security
Section titled “API Key Security”Your API key is:
- Stored locally in your browser
- Never sent to PondPilot servers
- Used only for direct API calls to your chosen provider
Advanced Features
Section titled “Advanced Features”Reasoning Models
Section titled “Reasoning Models”Some models (o4-mini, o3-mini) support explicit reasoning:
- Enable “Use Reasoning” in AI settings
- The model shows its thought process
- Better for complex analytical queries
Prompt History
Section titled “Prompt History”Access previous AI interactions:
- Click the history icon in the AI panel
- Browse past prompts and responses
- Reuse or modify previous prompts
Context Awareness
Section titled “Context Awareness”The AI automatically understands:
- All tables in your Data Explorer
- Column names and data types
- Relationships between tables (when inferable)
- Your current query context
Tips for Better Results
Section titled “Tips for Better Results”Be Specific
Section titled “Be Specific”❌ “Write a query for sales”
✅ “Write a query showing monthly sales totals for 2024, grouped by product category”
Include Context
Section titled “Include Context”❌ “Fix this”
✅ “Fix this query - it should return customers who have made orders in the last 30 days”
Use Mentions
Section titled “Use Mentions”❌ “Join the tables”
✅ “Join @orders with @customers on customer_id”
Iterate
Section titled “Iterate”If the first result isn’t perfect:
- Accept partial improvements
- Ask for refinements
- Provide feedback on what’s wrong
Troubleshooting
Section titled “Troubleshooting””API Key Invalid”
Section titled “”API Key Invalid””- Verify your API key is correct
- Check the key has appropriate permissions
- Ensure your account has API access
”Rate Limited”
Section titled “”Rate Limited””- Wait a moment and try again
- Consider upgrading your API plan
- Use a more efficient model
”Response Too Long”
Section titled “”Response Too Long””- Break complex requests into smaller parts
- Ask for specific aspects one at a time
Model Not Available
Section titled “Model Not Available”- Check your API plan includes the model
- Try a different model
- Verify the model name for custom endpoints