---
sourceDocument: Brazil Platform Analytics
sourceDocumentLink: https://www.servicenow.com/docs/r/now-intelligence

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Platform Analytics

ft:clusterId :

    - par

bundleId :

    - par

workflow :

    - Platform


---

# Explore

# Exploring Query Generation {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read  
Query Generation is an AI-powered service that translates user questions into an executable query and returns the results. An executable query contains the data source, filter, aggregation, and visualization
instructions that best answer the user's question. The results include a textual summary, a data visualization, and suggestions for follow-up.

## Query Generation overview {#exploring-query-generation__cf-exploring-parent-overview}

Query Generation supports the following data sources:

* Tables
* Performance Analytics [automated indicators](https://www.servicenow.com/docs/SAYEkH1d7Qjsj7I4aT4WVg#gloss-automated-indicator "An automated indicator uses an indicator source as its data set. The indicator source specifies a table or database view, conditions for filtering records from that source, and the frequency at which you expect to display the data. The indicator applies an aggregator and optional conditions to this data. In classic Performance Analytics, the indicator also specifies a data collection job and any breakdowns to apply.") (excluding Benchmarking and Data Snapshots indicators)
* Performance Analytics [formula indicators](https://www.servicenow.com/docs/SAYEkH1d7Qjsj7I4aT4WVg#gloss-formula-indicator "Produces a computed indicator score from one or more other indicators. Besides indicator scores, the formula can include calculations such as the gap between an indicator score and the indicator target.") (excluding Benchmarking and Data Snapshots indicators)
{#exploring-query-generation__ul_txk_cjs_rjc}

Table data is queried through a [semantic data layer](https://www.servicenow.com/docs/IdnWqSqSuznwHmUlqWEvYg#gloss-semantic-layer "A flat representation of database tables and columns used by Query Generation to identify the correct data sources when processing a natural language question. The semantic layer consists of entities (tables), dimensions (columns), and segments (filter conditions)."). The semantic data layer is a flat representation of tables and table columns. Query Generation uses the semantic data layer to find the actual [facts tables](https://www.servicenow.com/docs/IdnWqSqSuznwHmUlqWEvYg#gloss-facts-table "A database table included in the Query Generation semantic layer as a data source. Query Generation searches facts tables to answer user questions. Not all instance tables are included; administrators control which tables are added.") and columns related to a user [utterance](https://www.servicenow.com/docs/IdnWqSqSuznwHmUlqWEvYg#gloss-utterance "A natural language question or input submitted by a user to an AI system. Query Generation processes utterances to identify the correct entities, dimensions, and segments needed to construct an executable query."). Specifically, facts tables are represented by [Entity](https://www.servicenow.com/docs/IdnWqSqSuznwHmUlqWEvYg#gloss-entity "A semantic layer record that represents a database table. Query Generation uses entities to identify the correct facts table when processing a natural language question.") records and their columns by [Dimension](https://www.servicenow.com/docs/IdnWqSqSuznwHmUlqWEvYg#gloss-dimension "A semantic layer record that represents a column on a database table. Dimensions can follow reference fields across tables. Query Generation uses dimensions to identify the correct fields when processing a natural language question.") records.

Not all facts tables are included in Query Generation, as this would overload an instance. To see which facts tables are included, open the Semantic Tables Configurations list \[sn_query_gen_table_config_list\], and note which tables are present and have
Enable Semantic Generation = true. You can add more tables to the list, but be careful of possible performance impacts. For more information, see [Add a table to the semantic data layer](https://www.servicenow.com/docs/E3BMoMkuGdhpOLEm_VXDig#add-table-semantic-layer "Add more tables to the Query Generation semantic layer so that users can use ServiceNow Otto for Platform Analytics applications to ask questions about the data in those tables.").

Indicator data is searched through the Indicator \[pa_indicators\] table. Indicators are not represented in the semantic data layer. The 12 indicators that most closely match the user's query are passed to
the LLM. Keywords, context, and a default setting are used to determine whether automated or formula indicators are returned. If a formula indicator is returned, follow-up questions can drill down to its contributing indicators. Follow-up questions can also drill down to the source table, including the source tables of contributing indicators. For more information about returning automated or formula indicators, see [Indicator vs Table data source selection](https://www.servicenow.com/docs/MrUsI45a7Y8JvmJ9vrcBZQ "After you submit a query to AI Data Explorer, the system checks the query for specific keywords that indicate whether to use table or indicator data. If there are no such keywords, it falls back on a default set in a system property.").

## How Query Generation works {#exploring-query-generation__section_nsr_sdl_dgc}

The filter first checks the query contents for information about whether to use table data or an indicator score in the response. The check follows these steps:

1. Does the application calling Query Generation support only table data, only indicator data, or both? In the case
2. If it supports both data sources, is a data source specified in the query?
   1. Are there keywords in the query, such as "table" or "indicator," that clearly show what data source is desired?
   2. Is the query made in the context of a data source type? For example, is an AI Data Explorer query launched from a data visualization of table or indicator data? Is it launched from a follow-up question, and if so, what is the data source of the parent query? If the parent query data source is an indicator, that indicator is automatically included among the 12 indicators that most closely match the query.
   {#exploring-query-generation__ol_m1z_pgq_tjc}
3. If the data source is not specified, the fallback defined in
   sn_query_gen.default_source_type is used. The default value is
   table.

   Note:  
   If indicator data is selected, but the query would require more than two levels of breakdown in the response, Query Generation falls back to table data.
{#exploring-query-generation__ol_im1_3gq_tjc}

## Filtering table data {#exploring-query-generation__section_u34_j3q_tjc}

Before Query Generation can call the [LLM](https://www.servicenow.com/docs/IdnWqSqSuznwHmUlqWEvYg#gloss-llm "An AI model trained on large volumes of text data to understand and generate natural language. Query Generation uses an LLM to interpret user questions and produce semantic queries."), it has to filter the instance schema down to only the relevant entities and dimensions needed to answer the user's question. This filtration serves two critical purposes:

* It provides the LLM with precise grounds for truth about available tables and columns, preventing hallucination of non-existent data structures.
* It maintains a focused context window, which improves LLM performance and accuracy compared to processing the entire schema.
{#exploring-query-generation__ul_cfm_g2l_dgc}

Query Generation uses a semantic filter to narrow the entities (facts tables) to the 12 closest matches to the user's question. Then from those entities, it narrows the dimensions (columns) to the 150 most similar
to the user's question. Query Generation passes these results to the LLM, which generates a semantic query. A constitutor takes this semantic query and translates it into an [executable query](https://www.servicenow.com/docs/IdnWqSqSuznwHmUlqWEvYg#gloss-executable-query "A query produced by Query Generation that contains the data source, filter conditions, aggregation method, and visualization instructions needed to answer a user's natural language question.").  
Query Generation resolves entities and dimensions through examining the following information:

* Platform metadata
  * Table names and labels
  * Column names and labels
  {#exploring-query-generation__ul_ev4_rgg_1lc}
* System ID numbers
* Prefix-matching
* Existing semantic similarity followed by semantic score to rank the matches
* Existing reference and dimension resolution
{#exploring-query-generation__ul_xln_qgg_1lc}

## Query Generation users {#exploring-query-generation__cf-exploring-parent-users}

{#exploring-query-generation__table_b32_mj2_bgc__entry__2}

| User | Description |
|-|-|
| ServiceNow AI Platform administrators responsible for ServiceNow Otto for Platform Analytics \[admin, sn_query_gen.admin\] | Administrators can add or remove tables from the semantic data layer. Only users with the admin role can read or change Query Generation records. |
| Users of ServiceNow Otto for Platform Analytics applications \[sn_query_gen.user\] | Users of the ServiceNow Otto for Platform Analytics applications call Query Generation through those applications, although Query Generation is not visible to them. They should have the required sn_query_gen.user role through the roles granted to them to use the intermediary application. |
[Table 1. Users]

{#exploring-query-generation__table_b32_mj2_bgc}

## What to explore next {#exploring-query-generation__cf-exploring-parent-links}

To learn more about configuring and using Query Generation, see:

* [Configuring Query Generation](https://www.servicenow.com/docs/LZqGnNzmWeObrbJMrQHong "Select the tables that are subject to Query Generation.")
* [Query Generation reference](https://www.servicenow.com/docs/RgSY9RF63t9sHyrZaOWvJw "A list of ServiceNow Otto applications that come with Query Generation and the tables, jobs, and logs included in Query Generation.")
{#exploring-query-generation__ul_f32_mj2_bgc}

