Google Cloud announces preview of ai.classify and ai.extract functions for AlloyDB

·2026.11.12 02:29

Key point

The new functions run on PostgreSQL 18 via the google_ml_integration extension (v1.6.1+) and use smart batching to reduce latency and token costs.

Details

  • Google Cloud introduces ai.classify and ai.extract in the AlloyDB AI query engine, available in preview for PostgreSQL 18 with the google_ml_integration extension version 1.6.1 or later.
  • ai.classify categorizes text into user-defined labels using single or multi-label modes, supporting category descriptions and few-shot prompting without manual prompt engineering.
  • ai.extract transforms unstructured text into structured JSON based on a provided schema or field list, handling system instructions and response parsing internally.
  • Smart batching automatically groups inputs into micro-batches when used in WHERE clauses, improving inference speed and reducing total model token spend compared to row-by-row evaluation.
  • Use cases include structuring clinical notes in healthcare, extracting invoice details in financial services, and populating PostgreSQL Property Graph (PGQ) structures in knowledge graphs.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.