---
sourceDocument: Brazil Platform Analytics
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/now-intelligence

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Platform Analytics

ft:clusterId :

    - par

bundleId :

    - par

workflow :

    - Platform


---

# Segments

# Segments in the Query Generation semantic layer {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Segments in the Query Generation semantic layer

Segments are predefined filter conditions that map business terms to specific query filters, enabling the Query Generation semantic layer to translate natural language queries into precise database queries.
They provide essential context to help the system correctly interpret entities, dimensions, and values in user questions.
For example, segments clarify terms like "open" or "emergency" in queries to ensure accurate filtering.
Show full answer Show less  

## Key Features

* **Two types of segments:**
  * **Automated Segments:** System-generated from reports, dashboards, filters, modules, and indicator sources with typically technical names such as "Incidents.Open".
  * **Manual Segments:** Created by administrators with user-friendly names like "Critical Open Incidents". These are managed through a two-table data model with automatic syncing and can be shipped with applications via plugins.
* **Semantic Search and Scoring:** AI search indexes segment metadata and ranks segments by semantic similarity to user queries. Manual segments receive a configurable priority boost (default 5%) to ensure domain-specific segments surface above automated ones.
* **Integration with LLM:** The system passes relevant segment metadata and filters to the large language model (LLM), which uses these segments as building blocks to generate accurate database queries.
* **Segment Lifecycle and Control:** Manual segments are fully controlled by admins and can be adjusted or shipped with apps; automated segments are generated at runtime and tied to the usage of their source records.
* **Automated Segment Sources and Rules:** Automated segments are generated from trusted, recently used data sources such as shared reports, report sources, Performance Analytics indicators, saved filters, and app modules, with rules to avoid outdated or irrelevant segments. Some segment types are restricted on domain-separated instances.
* **Configurable Properties:** System properties allow tuning of segment behavior, including disabling segment creation per source type and adjusting scoring boosts.

## How Segments Work in Query Generation

The process begins with capturing the user's natural language query. AI search then finds semantically similar segments, which are scored and ranked. The system provides segment metadata to the LLM, which combines segment logic with any new user conditions to generate a complete, executable query.

Manual segments additionally assist in entity discovery by boosting relevant entities in the semantic layer's candidate list, improving query accuracy especially for first-time or complex queries.

## Practical Benefits for ServiceNow Customers

* **Improved Query Accuracy:** Segments help translate business language into precise filters, reducing ambiguity in natural language questions.
* **Customizable and Domain-Tuned:** Manual segments allow admins to create tailored, user-friendly filters that better reflect organizational terminology and priorities.
* **Automatic Maintenance:** Automated segments keep the semantic layer current by leveraging existing reports and analytics configurations without manual effort.
* **Flexible Management:** Customers can control segment creation and prioritization through system properties and update sets, enabling fine-tuning based on their environment and use cases.
* **Extensible with Applications:** Manual segments can be shipped with business unit applications, providing ready-to-use domain-specific queries immediately after installation.

## Next Steps for Customers

* Consider creating manual segments for commonly used or critical business queries to enhance query precision and user experience.
* Review and configure system properties to adjust segment scoring and enable or disable automated segment sources as needed.
* Leverage the automatic segment generation from trusted sources to maintain up-to-date query filters without manual intervention.
* Use manual segments in application development to embed domain-specific saved searches within your ServiceNow apps.  
Segments are predefined filter conditions that map business terminology to specific query filters, helping the semantic layer translate natural language questions into accurate database queries.

[Segments](https://servicenow-prod.fluidtopics.net/IdnWqSqSuznwHmUlqWEvYg#gloss-segment "A predefined filter condition in the Query Generation semantic layer that maps business terminology to specific query filters. Segments help the system translate natural language questions into accurate database queries. Segments can be automated or manual.") provide non-obvious context to assist the semantic layer in selecting the correct entity, dimension, and values. For example, in the [utterance](https://servicenow-prod.fluidtopics.net/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.") "How many open emergency change requests
are there?", a segment identifies that "open" means "active=true" and "emergency" is a Type, not a Priority.{#querygen-segments__semantic-layer-segments-merged-para-1}

When a user asks a question, the Query Generation engine searches for matching segments. It includes their filters in the [LLM](https://servicenow-prod.fluidtopics.net/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.") prompt, so the model can reuse them to construct accurate queries.{#querygen-segments__manual-segments-overview}

There are two types of segments:{#querygen-segments__segment-types}

Automated Segments
:   System-generated from reports, dashboards, filters, modules, and indicator sources. Names are often technical---for example, "Incidents.Open".

Manual Segments
:   Created by admins via the Manual Segment Config table. Names are user-friendly, such as "Critical Open Incidents". Manual segments use a two-table data model with automatic synchronization and can be shipped with applications via
    plugins.
{#querygen-segments__segment-type-list} {#querygen-segments__manual-vs-automated-comparison__entry__3}

|   | Manual Segments | Automated Segments |
|-|-|-|
| Created by | Admin, shipped via update set | System-generated from reports, dashboards, filters, modules |
| Name quality | User-friendly, tuned for search | Often technical---for example, "Incidents.Open" |
| Search priority | 5% boost over automated (adjustable insn_query_gen.segments.manual_segment_scale_factor) | Standard scoring |
| LLM treatment | Retain all filters unless irrelevant | Critique each filter individually |
| Prompt label | `user_defined_segment` | `automated_segment` |
| Lifecycle | Fully controlled by admin | Tied to source record activity/usage |
| Shipped with app | Yes (update set) | No (generated at runtime) |
[Table 1. Comparison: Manual vs automated segments]

{#querygen-segments__manual-vs-automated-comparison}

## How segments work {#querygen-segments__how-segments-work}

The system uses AI search to find segments that are semantically similar to the user's query. AI search indexes the Name, Description, Entity, and Filter fields in the Segments table, comparing
them to the user's query to produce a subset of relevant segments.{#querygen-segments__semantic-layer-segments-merged-para-2}

In the LLM call, the system passes the Name, Description, Entity, and Filters. The LLM uses the segments as building blocks for generating a new query. For example, a user asks "Unassigned
Incidents located in San Diego". The segment "Unassigned Incidents" is passed to the LLM, and the LLM uses the segment's filter as the starting point. Then it attaches the location filter "San Diego" on top of the segment.{#querygen-segments__semantic-layer-segments-merged-para-3}
{#querygen-segments__segment-process-table__entry__3}

| Step | Purpose | Output |
|-|-|-|
| 1: Input | Capture user's natural language query | Raw query text |
| 2: Search | Find semantically similar prebuilt segments | Subset of relevant segments |
| 3: Scoring | Rank the set of relevant segments based on their semantic similarity scores | The subset of relevant segments, now ranked and sorted |
| 4: Context | Provide segment metadata to LLM | Structured segment data |
| 5: Generate | Combine segment logic with new conditions | Complete executable query |
[Table 2. Segment process summary]

{#querygen-segments__segment-process-table}

## How manual segments work {#querygen-segments__section_xbb_rlc_y3c}

Manual segments serve two roles at query time:{#querygen-segments__manual-segments-intro}

Entity discovery
:   On first-time queries with no previous context, segment matches can add or boost entities in the entity list. A match against a manual segment name helps identify the intended entity by adding or boosting it in the candidate list.
    For example, a user asks "Show me critical open incidents" and a manual segment named "Critical Open Incidents" exists on the Incident \[incident\] table. Therefore, the `incident` entity gets boosted in the results.

Filter provision
:   Matching segments are formatted into the LLM prompt context. The LLM sees:

        **Related Segments**:
        - **Critical Open Incidents** (user_defined_segment)
          - description : High priority incidents that are open and unresolved
          - entity : incident
          - filter : { conditions : [{"field":"incident.priority","operator":"=","value":"1"}, ...] }

    {#querygen-segments__llm-prompt-example} The LLM then decides whether to reuse the segment's filters fully or partially when constructing the query. Manual segments are
    labeled `user_defined_segment` in the prompt, which tells the LLM to retain all filters unless completely irrelevant.
{#querygen-segments__manual-segment-roles}

## Manual segment scoring boost {#querygen-segments__section_shf_l4c_y3c}

Manual segments receive a priority boost. When the engine searches for relevant segments, it scores each result by semantic similarity---how closely the segment's name and description match the user's question. By
default, manual segments receive a 5% boost applied on top of their raw similarity score.{#querygen-segments__priority-boost-para}

The boost factor is configurable via the system property sn_query_gen.segments.manual_segment_scale_factor. Increasing it, for example to `1.10`, elevates manual segments more
strongly. Setting it to `1.0` removes the boost entirely.{#querygen-segments__boost-configuration}

In practice, automated segments often have names that partially match user utterances. For example, a report called "Open Incidents" may score similarly to a manual segment called "Critical Open Incidents". The
boost ensures that your handmade, domain-tuned segments surface ahead of system-generated ones when both are close matches.{#querygen-segments__boost-importance}

## How segment scoring works {#querygen-segments__section_vp5_xlc_y3c}

1. AI Search returns a raw semantic similarity score (0.0--1.0) for each candidate segment.
2. Segments below the match threshold (default `0.70`) are discarded.
3. Manual segment scores are multiplied by the scale factor (default `1.05`).
4. Results are sorted by boosted score and capped at the result limit.
{#querygen-segments__scoring-steps}

## Automatic segment sources {#querygen-segments__automatic-segments}

The system auto-generates segments from existing data sources on a schedule. The Query Generation Sync Segments job creates segments automatically, running at installation and then weekly by default.{#querygen-segments__semantic-layer-segments-merged-para-4}
{#querygen-segments__segment-sources-table__entry__2}

| Source | What it pulls |
|-|-|
| Saved Reports (sys_report) | Report filters from recently viewed reports |
| Report Sources (sys_report_source) | Analytics data source filters |
| PA Indicators (pa_cubes) | Performance Analytics indicator conditions |
| Saved Filters (sys_filter) | Global saved filters only (excludes user-specific and group-specific filters) |
| App Modules (sys_app_module) | Module-level list view filters |
[Table 3. Automatic segment sources]

{#querygen-segments__segment-sources-table}

## Automated segment rules {#querygen-segments__section_jjz_xq3_s3c}

To reduce noise from outdated and irrelevant segments, the job follows specific rules. Segments based on reports, report sources, or indicator sources are active only if the records meet
certain criteria:{#querygen-segments__semantic-layer-segments-merged-para-5}

* Reports must be shared, created by a user with an analytics manager role (admin, dashboard_admin, report_admin, pa_admin, or viz_admin), and have run recently (within 180 days by default).
* Report sources must be included in a data visualization or used in a report that has run recently.
* Indicator sources must be linked to indicators with scores that have recently changed.

{#querygen-segments__segment-criteria-list}  
Important:  
Segments cannot be created from indicator sources or modules on domain-separated instances.

For reports, "run recently" is defined by the sn_query_gen.segments.reports.last_viewed_threshold_days system property. The default value is 180 days.{#querygen-segments__semantic-layer-segments-merged-para-11}

For indicator sources, the time span for "recently changed" depends on the indicator frequency:{#querygen-segments__semantic-layer-segments-merged-para-12}

* Daily: last 7 days
* Weekly: last 30 days
* Bi-weekly: last 30 days
* Monthly: last 90 days
* Four weeks: last 90 days
* Bi-monthly: last 90 days
* Quarterly: last 180 days
* Fiscal quarterly: last 180 days
* Six months: last 12 months
* Yearly: last 24 months
* Fiscal yearly: last 24 months

{#querygen-segments__indicator-timing-list}

You can change the time spans for indicator sources by applying a multiplier using the sn_query_gen.segments.indicator.inactivity_threshold_multiplier system property. The
value must be an integer, meaning you can only lengthen the periods, not shorten them.{#querygen-segments__semantic-layer-segments-merged-para-13}

## Disabling segment sources {#querygen-segments__section_pk5_4q3_s3c}

You can disable segment creation altogether, or for individual source types. You might disable segment generation to troubleshoot, or if segments from a source are "noisy." Each source type has
a corresponding sn_query_gen.segments.disable.\* system property. Disable segments for that source by setting the corresponding system property to true. All existing segments created from
sources of that type are excluded from AI Data Explorer search results. No new segments of that type are created. During the next Sync Segments job, all segments of that type are deactivated. For more information, see [Query Generation properties](https://servicenow-prod.fluidtopics.net/h9tHOx4wzidQTMJcxnaHuA "The properties included with Query Generation apply to segments. They define whether the record or indicator that is the basis for a segment has been recently used or changed.").{#querygen-segments__semantic-layer-segments-merged-para-6}
* **[Guidelines for segments](https://servicenow-prod.fluidtopics.net/zrzfEZ8GeWveVYIP2xo1bg)**   
  Follow these suggestions to help you use segments in the semantic layer effectively.
* **[Create a manual segment](https://servicenow-prod.fluidtopics.net/bCxcKK~4dXP8WP9xrM~bzw)**   
  Manual segments are admin-created saved searches with friendly names that bridge natural language questions and database filters for the Query Generation semantic layer.
* **[Manual segment data model and sync behavior](https://servicenow-prod.fluidtopics.net/_gkswBMVWQepDfQQ96bFgQ)**   
  Manual segments use a two-table data model with automatic synchronization between the configuration table and the runtime table used for search operations.
* **[Shipping manual segments via plugins](https://servicenow-prod.fluidtopics.net/FQReYLviqMgNePkoNJUPHQ)**   
  Business unit application developers can ship manual segments with their applications to provide domain-specific saved searches that work from the moment the app is installed.

**Related concepts**   

* [Manual segment data model and sync behavior](https://servicenow-prod.fluidtopics.net/_gkswBMVWQepDfQQ96bFgQ "Manual segments use a two-table data model with automatic synchronization between the configuration table and the runtime table used for search operations.")
* [Shipping manual segments via plugins](https://servicenow-prod.fluidtopics.net/FQReYLviqMgNePkoNJUPHQ "Business unit application developers can ship manual segments with their applications to provide domain-specific saved searches that work from the moment the app is installed.")
* [Guidelines for segments](https://servicenow-prod.fluidtopics.net/zrzfEZ8GeWveVYIP2xo1bg "Follow these suggestions to help you use segments in the semantic layer effectively.")  
**Related tasks**   

* [Create a manual segment](https://servicenow-prod.fluidtopics.net/bCxcKK~4dXP8WP9xrM~bzw "Manual segments are admin-created saved searches with friendly names that bridge natural language questions and database filters for the Query Generation semantic layer.")  
**Related reference**   

* [Roles, tables, and scheduled jobs included with Query Generation](https://servicenow-prod.fluidtopics.net/7YsHcM_Sres7c_NM4ncWOQ "Several types of components are installed with Query Generation, including tables and scheduled jobs.")
* [Query Generation properties](https://servicenow-prod.fluidtopics.net/h9tHOx4wzidQTMJcxnaHuA "The properties included with Query Generation apply to segments. They define whether the record or indicator that is the basis for a segment has been recently used or changed.")

