Google Cloud has confirmed general availability of BigQuery's Gemini-powered AI.AGG function and detailed a new option for returning structured results. The 1 December announcement explains how teams can use a SQL aggregation to turn groups of unstructured records into fields that downstream tools can query. For analysts who previously had to read a paragraph about each group and manually transfer its findings to another system, the change removes a step that was difficult to automate reliably.
Standard SQL aggregation works well when the facts are already represented as columns. A query can count orders by category or calculate the average delivery time without making a judgement about what the underlying records mean. AI.AGG brings a model into the aggregation. A team can group customer comments by product and ask it to identify recurring themes across the text in each group. Google says the function can work with multimodal inputs as well as text.
A summary that can join another table
During preview, Google says, AI.AGG returned a prose summary for each group. This works for a person reading results in the console. It creates extra work for a dashboard that needs the theme in one field, a label in another and a list of supporting topics in a third. A slight change in the writing could break an application that relies on splitting the paragraph in predictable places.
The new output schema parameter lets the query author specify the shape of the response. A schema can describe fields for text, numbers or booleans, and can represent nested structures and arrays. Google illustrates this with Spark application logs. A group can produce a description of normal operation and an array of potential issues, with fields for the issue and an estimated occurrence count. The resulting columns can then be filtered or explored using SQL.
A customer support team might use the same idea with returns. It could group written explanations by product family and ask for a limited set of recurring reasons. A follow-up query could join the results with each product's sales volume. That lets an analyst compare themes between products of different sizes and inspect a sample of the underlying customer records before treating a pattern as a finding.
What a type can and cannot establish
A structured response makes a result easier to consume. It can ensure that a field intended to contain a number comes back in the expected type. The number's accuracy still depends on what the model inferred from the source material. If a report needs an exact count of records with an existing category, a database count remains the appropriate measure. A model-generated estimate is better treated as a starting point for investigating material that had no reliable label.
The distinction is especially important when a result becomes part of a wider data pipeline. A paragraph read by an analyst often comes with an expectation of judgement. A metric in a dashboard may look definitive, especially when it is plotted beside financial or operational data. Giving inferred fields explicit names and retaining a path back to the original rows can help reviewers see how the numbers were produced.
Teams can also decide which fields may be missing. A response that is forced to fill every field can be less helpful when the source material is unclear. In many workflows, a field indicating uncertainty or the need for review is more informative than an assertion. Limiting the number of requested items also helps keep the output manageable. Google lists a response cap of 10,000 tokens per group, so a query asking for an exhaustive list may need a different grouping strategy.
Where the production costs sit
Google also points to token-based cost management controls, including quotas by project and user. Teams running a scheduled query should measure how much material a typical group sends to the model, how that changes on busy days and whether the query is rerun repeatedly for the same data. That tells them more about expected spend than the number of rows alone.
One practical trial is to compare the model's output with a reviewed sample of recent records. Teams can identify outcomes that are good enough for a weekly report and those that need a person before a label or number is acted on. Starting with known examples gives the analyst a way to notice when a revised prompt or change in the record mix shifts the results. It can also reveal which groups are too broad to produce a useful answer.
The appeal of AI.AGG is that the source material, grouping and resulting fields can remain in a workflow the analytics team already understands. General availability and structured output make that easier to put into regular use. The strongest applications will use the model for interpretation where interpretation is needed, then use the data warehouse to store, check and combine the results. That division makes it easier for a downstream reader to understand both the business conclusion and the kind of evidence behind it.