This page describes AlloyDB AI natural language, which lets you create user-facing generative AI applications using natural language to query databases.
AlloyDB AI natural language generate context-aware SQL queries for application end users' natural language questions, and it provides a security API to execute these queries. Natural language streamlines the development of generative AI applications by transferring the complexity of converting natural language to SQL from the application layer to the database layer. Natural language-to-SQL (NL2SQL) orchestration is embedded in the database. You can query structured and unstructured data.
AlloyDB AI natural language also provides an intuitive interface to SQL developers that translates natural language to SQL, as shown in the following example:
SELECT
alloydb_ai_nl.get_sql(
...,
'What is the sum that client number 4''s account has following transaction 851?'
);
AlloyDB AI natural language support is provided through
alloydb_ai_nl,
which is an AlloyDB for PostgreSQL extension. The extension has a
dependency on PostgreSQL extensions like google_ml_integration
, vector,
and
pg_trgm
.
Use cases
AlloyDB AI natural language is well-suited for developers who want to do the following:
- Rapidly build a customer chat interface by using query generation from natural language.
- Refine automatically generated queries and perform thorough testing to provide accurate responses.
- Tune generated results by adding templates and context information.
- Deploy an intuitive, accurate chat experience that lets customers ask natural language questions about their relational data.
Key capabilities
Key capability | Description |
---|---|
Semantic layer |
|
Concept search |
|
Query store |
|
Limitations
You must enable the AlloyDB AI natural language flag
on every instance of AlloyDB for PostgreSQL.
AlloyDB AI natural
language objects created on the primary instance are propagated to read-only
replicas and cross-region replicas. However, the
alloydb_ai_nl.enabled
flag setting isn't replicated automatically, so you must replicate
it manually on each instance. For more information, see Generate SQL queries that answer natural language questions.
What's next
- Generate SQL queries that answer natural language questions.
- Use AlloyDB AI natural language to generate SQL.
- Learn how to search your relational data stored in AlloyDB in Google Agentspace using AlloyDB AI natural language (Preview).