How to search for the most relevant knowledge base article via API (leveraging AI Search)

esguaravkumar
Tera Contributor

I have a 3rd party tool in my contact center that has its own Help Desk Agent Web App independent of Service Now.   We integrate it with multiple external ITSM tools.   The Web App also  integrates with Service Now for creating Incidents etc using the table API. 

 

Now we want to implement a search feature in the Agent Web App.  One of the searches should be a search to Service Now to return the most relevant KB article matching the query provided by the Agent.    We wish to do this via API integration and have the result show in the Agent Web App.

 

 Service Now Supports two engines for this Zing (old) and AI Search.    This functionality works well in the native web interface of Service Now.

 

The knowledge api ( https://docs.servicenow.com/en-US/bundle/utah-api-reference/page/integrate/inbound-rest/concept/know... )   exists but is very rudimentary in its search capability.   Its close to keyword search.  It does not produce the same results for KB Match that is available in the native web interface of Service Now.

 

What API or approach should be use to get the same results that the Service Now Web Interface produces leveraging AI Search (seems to have a built in NLU or advanced search)? 

 

We want to leverage the knowledge already available in Service Now rather than having to fetch all the KBs and create our own search that leverages modern search concepts.

 

Is there a new API for getting the AI Search results?
Do we have to create a custom Web Service for this?

 

Any guidance is appreciated.

2 REPLIES 2

Ratnakar7
Mega Sage
Mega Sage

Hi @esguaravkumar ,

 

You can use the ServiceNow Search REST API. Here are the high-level steps:

  1. Configure the Search API in ServiceNow by defining the search parameters, including the search query, search fields, search filters, and other relevant options.

  2. Use the Search API to send the search query from the Agent Web App to ServiceNow.

  3. Parse the Search API response to extract the most relevant knowledge base article(s) that match the query.

  4. Display the knowledge base article(s) in the Agent Web App, along with any relevant metadata and links to related resources.

To use the AI Search engine specifically, you can specify the 'ai' parameter in the Search API query. For example:

GET /api/now/v2/search?q=<search_query>&ai=true

This will return results based on the AI Search engine, which includes natural language understanding (NLU) and advanced search capabilities.

It's worth noting that the Search API is a relatively new API in ServiceNow, and its functionality may vary depending on the version of ServiceNow you're using. However, it should be possible to retrieve relevant knowledge base articles using this API, leveraging the AI Search engine.

 

Thanks,

Ratnakar

 

esguaravkumar
Tera Contributor

Thanks @Ratnakar7 .    For future reference, would you also have the formal Service Now Documentation link that defines the ai=true parameter (and others that we may have missed)?