Create a manual segment
Manual segments are admin-created saved searches with friendly names that bridge natural language questions and database filters for the Query Generation semantic layer.
Before you begin
Role required: sn_query_gen.admin or higher
About this task
Use manual segments to ship domain-specific saved searches with your application. They receive a priority boost over automated segments during search. This boost is set in sn_query_gen.segments.manual_segment_scale_factor. The LLM retains all their filters unless irrelevant, whereas automated segment filters are critiqued individually.
- Your organization has standard terminology that maps to specific filters (for example, "Sev1", "VIP", "overdue")
- Users repeatedly ask the same filtered question and the system does not automatically pick up the right filter
- You want to encode business logic that cannot be inferred from field values alone (for example, "at-risk accounts" = combination of multiple conditions)
- The special terminology of your organization is not translated accurately to filter conditions
When creating segment names, use the same language a user would use when asking a question. The name is the primary field the LLM matches against during semantic search. Avoid abbreviations, internal codes, or technical jargon. Think about how a user would phrase the question that this segment answers.
Naming guidelines
Follow these guidelines when creating segment names and descriptions:
- Use plain language
- Write names in the same language users would use when asking questions. Avoid technical abbreviations or internal codes that users would not recognize.
- Think like your users
- Consider how users would phrase questions about this data. The segment name should match their natural language patterns.
- Be specific but clear
- Names should be descriptive enough to distinguish from similar segments while remaining understandable to your audience.
- Use descriptions for context
- When segment names might be ambiguous, use the description field to provide additional context using commonly-used terms.
Procedure
Result
The manual segment is active and available for Query Generation searches.
Manual segments for the incident table
The following examples show well-crafted manual segments for the incident table:
| Name | Description | Table | Filter |
|---|---|---|---|
| Critical Open Incidents | High priority incidents that are currently open and unresolved. Includes all assignment groups. | incident |
priority=1^state!=7^state!=8 |
| My Team's Overdue Incidents | Incidents assigned to the current user's group that have passed their SLA due date. | incident |
assignment_group=javascript:getMyGroups()^sla_due<javascript:gs.nowDateTime()^state!=7 |
| Recent P1 and P2 Escalations | Priority 1 and 2 incidents escalated in the last 7 days. | incident |
priority<=2^escalation=1^sys_updated_on>=javascript:gs.daysAgoStart(7) |