Overview
PlanetScale uses generative AI to power Insights features. This overview explains those features and how PlanetScale ensures safety and privacy of customer data.Which features use generative AI
Features of Insights which use generative AI:- Postgres index recommendations use a large language model to interpret query patterns and identify potential indexes that could improve performance of those patterns. The prompt sent to the LLM includes one or more query patterns and one or more table schemas. Query patterns and table schemas include the names of tables and columns, but not any actual row data. This process runs automatically on each database each night.
- Query summaries for both Postgres and Vitess use a large language model to convert a query pattern to a one-sentence description. The prompt sent to the LLM contains a query pattern. This feature is invoked only when a user clicks on the “Summarize query” button on an Insights query-details page.
- Insights Agent uses a large language model to write code changes that fix slow queries and apply schema recommendations, and opens them as pull requests in your connected repositories.
Insights Agent
Insights Agent opens pull requests in your connected repositories that fix slow queries and apply schema recommendations. It runs on demand or on a schedule. To generate its recommendations, Insights Agent uses:- Code from the connected repository.
- Query and schema information for the database branch, such as query patterns, query statistics and sample executions, query tags, table schemas, and schema recommendations.
Privacy and security
All AI use is covered by PlanetScale’s existing terms of service and subprocessor list. Our LLM providers are Google Gemini, Anthropic, and OpenAI.- Google Gemini encrypts all communication in transit, does not use prompts for training, and retains prompts only long enough to screen for abuse.
- Anthropic and OpenAI do not train on customer data. We send requests to them with our own provider keys through Cloudflare AI Gateway. Cloudflare does not train on customer data or retain it for other purposes.

