AlloyDB AI natural language overview
Stay organized with collections
Save and categorize content based on your preferences.
Transform natural language questions directly into SQL. The AlloyDB AI natural language feature (Preview) translates natural language queries into schema—aware SQL queries, empowering both developers and analysts to get answers faster.
Provide fine-grained access control, ensuring that end users only see data they're authorized to access, which is critical for applications executing AI-generated queries.
How it works
AlloyDB AI natural language (Preview) feature is designed to work securely with your database schema. After registering your schema objects with a natural language configuration, you can call the alloydb_ai_nl.get_sql() function from your application to translate plain English questions into SQL queries, or use explain_sql to understand a query. The feature integrates with standard PostgreSQL roles and IAM for security, and you can use parameterized secure views for fine—grained access control.
To accelerate setup and ensure accuracy, AlloyDB includes productivity tools for automatic context generation from your schema. These tools automatically generate schema context and suggest query templates, reducing the manual effort required to get started. You can further refine results by adding business—specific query templates to the template store. The underlying model can generate complex SQL—including multi—table joins, aggregations, and window functions—based on user intent and schema context, with accuracy improving as more context and templates are provided.
Use cases
Explore how you can apply AlloyDB AI natural language queries can be applied to common business scenarios.
Learn more
Explore Google developer resources to build your natural language query applications with AlloyDB.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-22 UTC."],[],[]]