Tuning the semantic layer
The semantic layer maps natural language questions to ServiceNow AI Platform® tables and fields. Tune the semantic layer to improve AI Data Explorer accuracy for your organization's terminology and data structure.
The semantic layer identifies the best matching entities (tables), dimensions (fields), and segments (filters) when users ask questions in AI AI Data Explorer. Tuning improves these matches so users consistently get the right table, field, and filter.
How the semantic layer works
When a user asks a question, the system identifies the best matching components and passes that context into query generation. The semantic layer has three building blocks:
- Entities
- Represent tables such as Incident [incident], Change Request [change_request], or CMDB Class Information [cmdb_class_info].
- Dimensions
- Represent fields on those tables such as Priority, Assigned to, or State. Dimensions can follow reference fields across tables. For example, caller_id.department traverses from an incident's caller to their department.
- Segments
- Pre-defined filter conditions such as "Open incidents" = active=true.
When to tune the semantic layer
Before you tune, verify that the issue is repeatable. The LLM occasionally makes incorrect decisions. Try the same question or a similar one multiple times first. Only tune if the problem is consistent.
Tune the semantic layer when:
- The system selects the wrong table or cannot find one
- A field is missing or the wrong field is selected
- Your organization uses different terminology than the auto-generated labels
- The right table or field is selected, but the query is constructed incorrectly
- Special terminology of your organization is not translated accurately to filter conditions
Validation and iteration process
- Capture the utterance and expected result.
- Classify the failure as entity, dimension, segment, or ACL.
- If results are wrong for only some users, verify read ACL access to the intended table and fields before retuning.
- Apply one targeted tuning change.
- Retest the same utterance.
- Check and confirm the improved match path.
- Repeat only if still incorrect.