How to perform semantic similarity matching between Incident text and Knowledge Articles in an AI Ag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi Community,
I am building an AI Agent in AI Agent Studio to automatically recommend Knowledge Articles for resolved incidents.
I created a custom tool script that:
1. Retrieves incident details (short description, description, work notes, close notes).
2. Retrieves published articles from kb_knowledge.
3. Returns incident_text and kb_candidates to the AI Agent.
I expected the AI Agent to use these inputs and generate:
- Most similar Knowledge Article
- Similarity score
- Recommendation type
- Reasoning
However, the AI Agent only displays the returned data and does not perform semantic comparison or ranking automatically.
I explored the following Script Includes:
- AISearchRetrieveSearchResults
- AISearchRetrieveSearchResultsWrapper
- AISearchSemanticSearchUtils
I can retrieve search results, but I cannot find a supported API that returns semantic similarity scores or allows programmatic comparison between arbitrary incident text and Knowledge Articles.
My questions are:
1. Is there a ServiceNow-supported API for semantic similarity matching between incident text and KB articles?
2. Can AI Search embeddings or reranking capabilities be invoked programmatically from a custom AI Agent tool script?
3. If not, what is the recommended architecture for implementing Incident-to-Knowledge recommendations using AI Agents?
Any guidance, examples, or best practices would be greatly appreciated.
Thank you!