How to create a Web Search AI Agent on ServiceNow

This is a guide on how to create a Web Search AI Agent on ServiceNow. I'm using patch Yokohama Patch 1 and AI Agent plugin 3.0.9. For the Web search, there are two flows that can be used as shown on the flow diagram below: The first path is searching and scraping, where we first search with Bing or Google. Then, on those URLs, we scrape with Scrapping Bee or Crawlbase. The last step is to send that scraped data to our NowLLM to create an answer. This is the default path that the Websearch tool would use. The second path is to use an AI search engine like Perplexity or Google Gemini to create the answer for the search query. You’ll need to go into the credentials tables in ServiceNow and enter your own API keys for each of those services. The following image shows the credentials table (discovery_credentials) and is filtered to the "AI Websearch" application. At the moment, I'm using mostly perplexity because that's a key I have. For Scraping Bee and Crawlbase, you can get test keys with your personal email to test. Now, we also need to define the default definition (which provider) every capability should use. For this, we are going to the 'one extend capability' table (sys_one_extend_capability). Filter for the type (column) 'Websearch', and you will see five entries. Let's open the 'AI Search answers' record. Here, we can choose between Perplexity or Gemini; this depends on which API key you added to the credentials table. I'm using Perplexity, so you need to change Gemini default to false and Perplexity to true: If you also want to use the default path for searching and scraping, you need to change to the right providers in the 'one extend capability' for 'Web Search APIs', which would be Google or Bing, and 'Web Scraping APIs', which would be Crawlbase or ScrapingBee. Now that everything is set up for the 'Websearch' tool, we can create our Websearch AI agent in the AI Agent Studio. First, create a new AI Agent and then you can write your instructions, which can be very simple like this: Important!! You can see that I also wrote, 'Use as search_type input 'ai_answers', in the instructions. As described above, there are two ways how the search can be done: the searching and scraping or the AI answer path. With that instruction, I'm telling the tool to go the AI answers way, which is using, in my case, Perplexity. This is up to you which path you want to use. Just remember that the default path is the searching and scraping, so you need to have that set up and all API keys need to be valid. On the next page of the AI agent you can now just add the 'web search' tool. With the instructions above, I'm setting the value in the inputs field 'search_type' to 'ai_answers' to ensure it uses the second path. Again, this is up to you to design the tool. You can also see that there are other input values, which you can play around with. I hope that helps and have fun creating awesome AI Agents on ServiceNow!

Mar 24, 2025 - 12:01
 0
How to create a Web Search AI Agent on ServiceNow

This is a guide on how to create a Web Search AI Agent on ServiceNow.
I'm using patch Yokohama Patch 1 and AI Agent plugin 3.0.9.

For the Web search, there are two flows that can be used as shown on the flow diagram below:

Image description

The first path is searching and scraping, where we first search with Bing or Google. Then, on those URLs, we scrape with Scrapping Bee or Crawlbase. The last step is to send that scraped data to our NowLLM to create an answer. This is the default path that the Websearch tool would use.

The second path is to use an AI search engine like Perplexity or Google Gemini to create the answer for the search query.

You’ll need to go into the credentials tables in ServiceNow and enter your own API keys for each of those services.

The following image shows the credentials table (discovery_credentials) and is filtered to the "AI Websearch" application.
Image description

At the moment, I'm using mostly perplexity because that's a key I have. For Scraping Bee and Crawlbase, you can get test keys with your personal email to test.

Now, we also need to define the default definition (which provider) every capability should use. For this, we are going to the 'one extend capability' table (sys_one_extend_capability). Filter for the type (column) 'Websearch', and you will see five entries.

Image description

Let's open the 'AI Search answers' record. Here, we can choose between Perplexity or Gemini; this depends on which API key you added to the credentials table. I'm using Perplexity, so you need to change Gemini default to false and Perplexity to true:

Image description

If you also want to use the default path for searching and scraping, you need to change to the right providers in the 'one extend capability' for 'Web Search APIs', which would be Google or Bing, and 'Web Scraping APIs', which would be Crawlbase or ScrapingBee.

Now that everything is set up for the 'Websearch' tool, we can create our Websearch AI agent in the AI Agent Studio.

First, create a new AI Agent and then you can write your instructions, which can be very simple like this:

Image description

Important!! You can see that I also wrote, 'Use as search_type input 'ai_answers', in the instructions. As described above, there are two ways how the search can be done: the searching and scraping or the AI answer path. With that instruction, I'm telling the tool to go the AI answers way, which is using, in my case, Perplexity. This is up to you which path you want to use. Just remember that the default path is the searching and scraping, so you need to have that set up and all API keys need to be valid.

On the next page of the AI agent you can now just add the 'web search' tool.

Image description

Image description

With the instructions above, I'm setting the value in the inputs field 'search_type' to 'ai_answers' to ensure it uses the second path. Again, this is up to you to design the tool. You can also see that there are other input values, which you can play around with.

I hope that helps and have fun creating awesome AI Agents on ServiceNow!