AI Assist for Data Grid
AI Assist lets you work with query results using natural language instead of manually configuring the grid or writing SQL by hand. The panel has two modes, switched with the Grid | Query toggle at the top:
- Grid mode manipulates the grid directly - sorting, filtering, grouping, pivoting, and charting the current result set. Ask questions like “sort by revenue descending”, “group by country”, or “chart this as a bar chart” and the grid updates instantly.
- Query mode has a conversation with the AI that writes and runs real SQL against the table you have open. See Query Mode below.

Getting Started
Section titled “Getting Started”- Open a table, or run a query so results appear in the data grid
- Open the AI Assist panel from the grid sidebar (sparkle icon)
- Use the Grid | Query toggle at the top of the panel to pick a mode
- Type a natural language request and press Enter
AI Assist uses the same AI provider configured in your AI settings. Any model that supports structured JSON output works - including GitHub Copilot, OpenAI, Anthropic, Ollama, and custom providers.
The rest of this section covers Grid mode.
What You Can Do
Section titled “What You Can Do”AI Assist works through AG Grid’s state API, so anything the grid supports can be controlled via natural language:
- Filter — “Only show orders over $100” or “Filter to US and UK customers”
- Sort — “Sort by date, newest first” or “Sort by revenue descending”
- Group — “Group by category” or “Group by country, then by city”
- Aggregate — “Sum the amounts per group” or “Show average price by category”
- Pivot — “Pivot by month” or “Pivot by quarter with revenue totals”
- Column visibility — “Hide the ID column” or “Only show name, email, and status”
- Column pinning — “Pin the name column to the left”
- Column sizing — “Make the description column wider”
- Charts — “Chart this as a bar chart” or “Create a pie chart of revenue by region”
Example Conversation
Section titled “Example Conversation”You: "Sort by total_spend descending"→ Grid sorts the total_spend column in descending order
You: "Only show the top countries"→ Grid applies a filter to the country column
You: "Group by region and sum total_spend"→ Grid groups rows by region with aggregated totals
You: "Chart this as a bar chart"→ A bar chart opens with the current grouped data
You: "Reset grid"→ Grid returns to its original stateContext Awareness
Section titled “Context Awareness”When you open the AI Assist panel, it automatically captures the grid’s structured schema — column names, data types, and available operations. This schema is sent to the LLM along with your request so it can generate valid grid state changes.
No row data is sent to the LLM. Only the schema (column definitions and supported operations) is included as context.
Quick Actions
Section titled “Quick Actions”The panel provides suggested actions based on your current columns, giving you one-click shortcuts for common operations like sorting, grouping, or filtering specific columns.
Use the Reset grid button in the toolbar to return to the original query result state at any time.
How It Works
Section titled “How It Works”- Your natural language request is sent to the configured AI provider along with the grid’s structured schema
- The LLM returns a JSON object describing the desired grid state (sort model, filter model, column visibility, etc.)
- AI Assist validates the response and applies it to the grid using
setState() - A human-readable summary of what changed is displayed in the panel
If the LLM returns a text response instead of JSON (for example, answering a question about the data), it is displayed as formatted text in the panel.
Query Mode
Section titled “Query Mode”Switch the AI Assist panel to Query and it becomes a conversation that writes real SQL against the table you have open, instead of manipulating the grid directly.
Conversational Follow-ups
Section titled “Conversational Follow-ups”Query mode remembers the conversation, so follow-up requests refine the previous query instead of starting over. Ask for a weekly report, then follow up with “now monthly instead of weekly” or “only for the last quarter”, and the AI adjusts the existing SQL rather than rebuilding it from scratch.
What Gets Sent to the AI
Section titled “What Gets Sent to the AI”- Schema DDL for the open table, plus any tables it has foreign key relationships with
- If the AI needs more context, it can request the definitions of additional tables
- Your prompt and the conversation so far
No table rows are ever sent in Query mode. If you have filters applied to the grid, the filter settings (including the values you filtered by) are shared as context so the AI knows what you are looking at.
Reviewing and Running SQL
Section titled “Reviewing and Running SQL”Every answer shows the generated SQL. Nothing runs automatically - you choose what happens next:
- Run here executes the query on the same connection and shows the results in the same grid, in place. An AI results chip appears in the grid toolbar while AI-generated results are showing. Click the chip’s close button, or Back to table, to restore the original table rows.
- Open in editor exports the SQL to a new editor tab instead of running it.
Fixing Failed Queries
Section titled “Fixing Failed Queries”If a run fails, the database error is shown directly in the conversation with a one-click Fix it button that asks the AI to correct the query using that error message.
Permissions
Section titled “Permissions”Running SQL from Query mode follows the same statement permissions as running SQL from the editor. If your connection’s role requires confirmation for, or denies, statements like UPDATE or DELETE, those same rules apply here.
AI Provider
Section titled “AI Provider”Query mode works with any configured AI provider - GitHub Copilot, a custom/BYO endpoint, or DBCode AI.
Privacy
Section titled “Privacy”Grid mode sends the grid’s column schema only (column names, data types, available filter operations) to your configured AI provider. No row data is sent. The LLM never sees your actual query results - it only knows the structure of the grid and generates state changes based on that.
Query mode sends the open table’s schema DDL (plus related tables, fetched as needed) to your configured AI provider. No table rows are ever sent to the AI in Query mode either - only the schema and your current filter and sort settings. Queries only run locally against your database connection when you click Run here.
See AI Privacy and Security for more details on how DBCode handles AI data.