Data Grid

Use natural language to filter, sort, group, pivot, and chart your query results directly in the data grid.

AI Assist lets you manipulate query results using natural language instead of manually configuring the grid. Ask questions like “sort by revenue descending”, “group by country”, or “chart this as a bar chart” and the grid updates instantly.

Getting Started

  1. Run a query so results appear in the data grid
  2. Open the AI Assist panel from the grid sidebar (sparkle icon)
  3. Type a natural language request and press Enter
  4. The grid updates to reflect your request

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.

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

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 state

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

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

  1. Your natural language request is sent to the configured AI provider along with the grid’s structured schema
  2. The LLM returns a JSON object describing the desired grid state (sort model, filter model, column visibility, etc.)
  3. AI Assist validates the response and applies it to the grid using setState()
  4. 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.

Privacy

AI Assist 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.

See AI Privacy and Security for more details on how DBCode handles AI data.