AlloyDB can now extract and classify text straight from SQL
Two new Preview functions, ai.extract and ai.classify, pull structured fields and labels out of unstructured text inside a query, no separate extraction pipeline required.
Google added two AI functions to AlloyDB for PostgreSQL on 27 October, both in Preview. ai.extract pulls structured fields out of unstructured text inside a query, defined by a JSON schema or a plain-language description of what you want back, which means a lead-scoring or support-ticket pipeline no longer needs a separate extraction service. ai.classify sorts text into labels you supply, in either single- or multi-label mode. Both default to Gemini 3.5 Flash-Lite and need PostgreSQL 18 or later with the google_ml_integration extension at 1.6.1 or above.
SELECT ai.extract(
input => bio_text,
output_schema => '{"email": {"type": "string"}}'
) FROM leads;
The same release also renamed parameters on three existing functions, ai.analyze_sentiment, ai.summarize and ai.agg_summarize: prompt/prompts become input/inputs, and the cursor-based versions drop prompt entirely.
Why it matters: this is SQL absorbing a job that used to mean standing up a separate NLP service and gluing it to the database with a queue. If you’re already on AlloyDB, that’s one less moving part for extraction and classification work.
The caveat: everything here is Preview under Google’s pre-GA terms, and this same release just broke parameter names on functions that shipped months ago. Treat the API as unstable until it’s GA.