AlloyDB can now sort and parse text in plain SQL, in preview
Google has put two Gemini-backed SQL functions, ai.classify and ai.extract, into preview in AlloyDB. They require PostgreSQL 18, and the post gives no pricing or regions.

Google has put two new SQL functions, ai.classify and ai.extract, into preview in AlloyDB AI. They sort text into labels and turn free text into JSON inside the database. They need PostgreSQL 18 and google_ml_integration 1.6.1 or later, Google said.
Two functions that replace the prompt-and-parse loop
Product manager Paul Ramsey wrote that teams usually export text from the database, call a model endpoint, wrap prompts, parse the replies and write results back. Google says that loop adds latency, code, token cost and compliance exposure. The new functions move that work into the query engine.

ai.classify assigns text to categories the user defines. Categories can be bare labels or label-and-description pairs. It supports single-label output (output_mode => 'single') and multi-label output ('multi'), few-shot examples supplied inline, and calls on a single row, an array or a cursor. Google’s example labels three product reviews as positive, negative and negative.
ai.extract returns JSON that matches a schema. The schema can be a JSON schema or a plain list of fields. Google says the function handles the system instructions itself, so no prompt template or response parser is needed. Its demo pulls a patient’s name, age, symptoms and medications from a short clinical note.

Both functions are off by default. A session must first run SET google_ml_integration.enable_preview_ai_functions = TRUE;. Google lists healthcare, invoices, contract terms, real estate listings and knowledge-graph population for PostgreSQL Property Graph (PGQ) as uses.
Batching is where the speed claim sits
Google pairs the functions with smart batching, which was previously called AI Function Acceleration. When the functions appear in a WHERE clause, the engine groups inputs into micro-batches before sending them to Gemini Enterprise Agent Platform models. Google says this speeds up queries and cuts token spend, compared with evaluating one row at a time.
The post gives no figures for either claim.
What the preview leaves unanswered
The post names no pricing, regions or date for general availability. It says only that cost optimization, line-level provenance tracking and pushdowns beyond WHERE clauses are planned. The PostgreSQL 18 requirement also rules out any AlloyDB cluster still on an older major version.
Earlier AlloyDB releases give some context. In a July 2, 2026 post, Google said ai.generate, ai.rank, ai.if and ai.forecast were generally available. In that post, smart batching was still a preview feature for ai.if and ai.rank. So the new functions are a second wave on a batching layer that Google was still previewing. By the same account, the largest figures Google has published came from its own internal tests, with smart batching claimed to deliver up to 2,400x over row-at-a-time calls. Those numbers are for other functions, and no equivalent has been published for ai.classify or ai.extract.
The model behind the calls is the other open question. The new post refers to Gemini Enterprise Agent Platform models but does not say which model version runs by default or whether users can pick one. Nor does it say how the functions behave when a model returns malformed JSON or an unexpected label. For regulated data, the claim that clinical text stays within the database also needs checking against how the model endpoint is actually reached. The post does not describe that path, and nothing in it has been independently tested.
For developers, the practical change is that classification and extraction can sit inside a single SQL statement rather than a separate service. Anyone on PostgreSQL 18 can try it now by enabling the preview flag. Everyone else should wait for the pricing and general availability details, which are expected in the AlloyDB documentation and release notes.
Sign Up for the Daily AI Pulse
One email a day. All the stories that matter.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Alex CarterAI News & Big Tech CorrespondentAlex Carter writes for Aiholics, keeping readers updated on the fast-paced world of AI and Big Tech.
You may also like

Google’s Omni 1.2 Flash makes 15-second AI video 30% cheaper

Google’s test: A cheap classifier let Flash-Lite handle easy coding tasks

Gemini TTS models leave preview, with audio output priced at $6-9 per million tokens
