Working with Kernels
Working with Kernels
Kernels are an API and follow the authorization protocols of other Expert APIs. Our Getting Started Guide is available here. Attached to this page is a Postman collection with almost everything you need to begin testing the Kernels API in Postman.
To test the Kernels API in Postman:
- Generate a server token.
- Import the collection to Postman.
- In Postman:
- Go to the collection settings in Postman (click on the name of the collection).
- Update the key and secret in the Pre-Request Script tab.
- Update the baseURL variable in the Variables tab.
- Replace SITE_URL_HERE with the actual site url. Keep the /@api/deki/ portion, and be sure to begin the URL with https://.
- Update the query query parameter in the endpoint settings.
- Click Send.
Kernel request example
[SITE_URL]@api/deki/llm/kernels?q=hello&limit=5
Query Parameters
Parameter |
Value |
Example |
q (required) |
Requested query |
q=what is a touchpoint? |
limit |
Limit of result list, defaults to 10, maximum allowed is 100 |
limit=99 |
threshold |
Score threshold, defaults to 0.70 |
threshold=0.65 |
pathancestors |
Comma separated list of path ancestors to filter search results. Each pathancestor must be encoded first. If supplying more than one path ancestor, separate them with a comma, then encode the full list again.
|
example: [base_url]/@api/deki/llm/kernels?q=dryers&pathancestors=Connected_Appliances will return kernels from pages in the "Connected Appliances" category example: [base_url]/@api/deki/llm/kernels?q=dryers&pathancestors=Connected_Appliances%2CRadios will return kernels from pages in the "Connected Appliances" category or the Radios category. Note: the comma to sepatate the Connected Appliance and Radios pathancestors is encoded. UTF encoding examples:
|
tags |
To retrieve kernels with any provided tags (OR logic): Comma separated list of tags to filter search results (default: none)
To retrieve kernels with all provided tags (AND logic): List of tags with "AND" separator (note: "AND" must be capitalized) |
example: [base_url]/@api/deki/llm/kernels?q=dryers&tags=kernels-testing,kernels-production will return kernels from pages that either have the tag 'kernels-testing' or 'kernels-production'
example: [base_url]/@api/deki/llm/kernels?q=dryers&tags=kernels-testing AND kernels-production (URL encoded as [base_url]/@api/deki/llm/kernels?q=dryers&tags=kernels-testing%20AND%20kernels-production) will return kernels from pages that have been tagged with both 'kernels-testing' and 'kernels-production' |
Kernel response elements
Kernel Responses contain a number of vector records. Each vector record contains:
ID: The unique ID of the record
Score: Confidence score assigned to the kernel.
Chunk: The text from the Expert page (This is meant to be consumed by an LLM application and is not meant to be human readable or consumable.)
Page:
- ID: Page ID of the source information
- GUID: Page GUID of the source page
- Draft.State: If the page has a draft or not
- href: The href of the source page
- uri.ui: The URL of the source page
- title: The title of the page at the time it was most recently indexed
- path: the path of the page at the time it was most recently indexed
- namespace: if the page was in the main or media namespace (only relevant for customers with Media Manager)
- date created: the date the page was created
- language: The language of the source content at the time it was most recently indexed
- restriction: The page level restriction. Either: Public, Semi-Public, Private, Semi-Private. More information on the restriction values can be found here.
- Page top ancestor: Contains information from the highest parent page that at the same time is a child of the locations filtered at that moment.
Single Kernel response example
<kernels> <kernel id="a7b0ad3d-da51-0f01-be50-fb0b83562178"> <score>0.851665258407593</score> <chunk>CXone Mpower Expert (CXE) is an AI-powered knowledge management solution that reduces friction by projecting personalized content to customers seeking self-service through the digital channels they turn to first. From search engines and websites to mobile applications and chatbots, Expert surfaces the right content when, where, and how the customer wants it to give them the best experience possible. CXone Mpower Expert lets you deliver the information, answers, and support your customers need wherever they are in their knowledge journey.</chunk> <page id="17488" guid="2f7bbf98feb44cf7a76e952c9c35ed15" draft.state="inactive" href="https://expert-help.nice.com/@api/deki/pages/17488?redirects=0" deleted="false"> <uri.ui>https://expert-help.nice.com/Introduction_to_NICE_CXone_Expert/What_is_CXone_Expert%3F</uri.ui> <title>What is CXone Expert?</title> <path seo="true">Introduction_to_NICE_CXone_Expert/What_is_CXone_Expert?</path> <namespace>main</namespace> <date.created>2022-06-15T19:31:19Z</date.created> <language>en-US</language> <restriction id="1">Public</restriction> <page.top_ancestor id="17488" guid="2f7bbf98feb44cf7a76e952c9c35ed15" draft.state="inactive" href="https://expert-help.nice.com/@api/deki/pages/17488?redirects=0" deleted="false"> <uri.ui>https://expert-help.nice.com/Introduction_to_NICE_CXone_Expert/What_is_CXone_Expert%3F</uri.ui> <title>What is CXone Expert?</title> <path seo="true">Introduction_to_NICE_CXone_Expert/What_is_CXone_Expert?</path> <namespace>main</namespace> <date.created>2022-06-15T19:31:19Z</date.created> <language>en-US</language> <restriction id="1">Public</restriction> </page.top_ancestor> </page> </kernel> ... </kernels>
Known Limitations
- Images are not available in Kernels (As of Q1 2024: tables and PDFs are available in Kernels).
- Content formatting is not included in Kernels
- Queries are text only and no advanced search functionality is respected. Available query parameters are listed elsewhere on this page.
Additional Helpful API Recipes
The below are suggestions for how additional Expert features may be leveraged in your LLM application alongside Kernels.
Images and Attachments
- Images are not automatically included in Kernels results. To retrieve images to use as a part of a generative response, you can use a separate API endpoint to get all the attached or embedded images from a given page ID.
- Page IDs can be retrieved from the Kernels or from the search results as outlined above.
- To retrieve an image URL, use the following endpoint and the page ID of your choosing:
-
{base_URL}/@api/deki/pages/{pageID}/files
-
-
Files response example:
-
<files count="2" offset="0" totalcount="2" href="https://success.mindtouch.com/@api/deki/pages/18153/files"> <file id="16348" revision="1" res-id="34473" href="https://success.mindtouch.com/@api/deki/files/16348/info" res-is-head="true" res-is-deleted="false" res-rev-is-deleted="false" res-contents-id="188911"> <filename>Expert Kernels.postman_collection.json</filename> <description/> <alt-text/> <contents type="application/json" size="2340" href="https://success.mindtouch.com/@api/deki/files/16348/Expert_Kernels.postman_collection.json"/> <date.created>2023-09-14T19:05:24Z</date.created> <date.last-modified>2023-09-14T19:05:24Z</date.last-modified> <user.createdby anonymous="false" virtual="false" id="795" wikiid="site_11706" href="https://success.mindtouch.com/@api/deki/users/795" guid="ecf1b6be968b4d0abad9bac994b3cd85"> <nick>whitney.meer@mindtouch.com</nick> <username>whitney.meer@mindtouch.com</username> <fullname>Whitney Meer</fullname> <email>whitney.meer@mindtouch.com</email> <password exists="false"/> <license.seat>true</license.seat> <date.created>2022-04-05T19:30:34Z</date.created> <status>active</status> <date.lastlogin>2023-08-28T19:32:23Z</date.lastlogin> <hash.email>a006b2b5a0cac7a1e1e440c2f0dea6f1</hash.email> <uri.gravatar>https://gravatar.com/avatar/a006b2b5a0cac7a1e1e440c2f0dea6f1.png?d=mm</uri.gravatar> <uri.avatar>https://gravatar.com/avatar/a006b2b5a0cac7a1e1e440c2f0dea6f1.png?d=mm</uri.avatar> </user.createdby> <revisions count="1" totalcount="1" href="https://success.mindtouch.com/@api/deki/files/16348/revisions"/> <page.parent id="18153" guid="358df04b59b143bc9c8aaef0ba99be1a" draft.state="inactive" href="https://success.mindtouch.com/@api/deki/pages/18153?redirects=0" deleted="false"> <uri.ui>https://success.mindtouch.com/Internal/Product/Documentation/Expert_Kernels_Beta_Release</uri.ui> <title>Expert Kernels Beta Release</title> <path seo="true">Internal/Product/Documentation/Expert_Kernels_Beta_Release</path> <namespace>main</namespace> <date.created>2023-08-22T19:12:35Z</date.created> <language>en-US</language> </page.parent> </file> </files>
-
Linking to Search Results
- To generate links to pages, you need to make a separate API call to the search endpoint.
- In the co-pilot demo, they use an LLM to generate a search query from the user input, then call Expert's search endpoint to return a list of pages. They use the search results to generate buttons.
- Information on how to do this is available in the Recipe for Use Case 1 and 2 documentation.
- Search results API response for one page:
-
<page id="3461" guid="59edada9c67a4b0a80c9d3461712d9a7" draft.state="inactive" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461?redirects=0" deleted="false" unpublish="true" revision="1" score="1"> <uri.ui>https://kernels-testing.mindtouch.us/Sales_Offers/OAWash_High_Efficiency_Laundy_Detergent</uri.ui> <title>OAWash High Efficiency Laundy Detergent</title> <path seo="true">Sales_Offers/OAWash_High_Efficiency_Laundy_Detergent</path> <namespace>main</namespace> <date.created>2023-09-12T17:07:46Z</date.created> <language>en-US</language> <article>topic-guide</article> <language.effective>en-US</language.effective> <metrics> <metric.views>0</metric.views> <metric.charcount>959</metric.charcount> </metrics> <summary/> <security href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/security"> <permissions.effective> <operations mask="18446744073709551615">LOGIN,BROWSE,READ,SUBSCRIBE,UPDATE,CREATE,DELETE,CHANGEPERMISSIONS,CONTROLPANEL,UNSAFECONTENT,USERHISTORY,DRAFT_UPDATE,DRAFT_CREATE,DRAFT_DELETE,ADMIN</operations> </permissions.effective> <permissions.page> <operations mask="18446744073709551615">LOGIN,BROWSE,READ,SUBSCRIBE,UPDATE,CREATE,DELETE,CHANGEPERMISSIONS,CONTROLPANEL,UNSAFECONTENT,USERHISTORY,DRAFT_UPDATE,DRAFT_CREATE,DRAFT_DELETE,ADMIN</operations> <restriction id="1">Public</restriction> </permissions.page> <grants/> <permissions.revoked/> </security> <user.createdby anonymous="false" virtual="false" id="1" wikiid="site_15087" href="https://kernels-testing.mindtouch.us/@api/deki/users/1"> <nick>admin</nick> <username>admin</username> <fullname/> <email>whitney.meer@nice.com</email> <password exists="true"/> <license.seat owner="true">true</license.seat> <date.created>2023-09-11T20:54:17Z</date.created> <status>active</status> <date.lastlogin>2023-09-13T22:15:51Z</date.lastlogin> <hash.email>a02ee170012de9ce99a2a42fa4202f9f</hash.email> <uri.gravatar>https://gravatar.com/avatar/a02ee170012de9ce99a2a42fa4202f9f.png?d=mm</uri.gravatar> <uri.avatar>https://gravatar.com/avatar/a02ee170012de9ce99a2a42fa4202f9f.png?d=mm</uri.avatar> </user.createdby> <date.edited>2023-09-12T17:07:46Z</date.edited> <date.modified>2023-09-12T17:07:46Z</date.modified> <timeuuid>e4bf1d00-518e-11ee-805d-3d1d8e36be44</timeuuid> <user.author anonymous="false" virtual="false" id="1" wikiid="site_15087" href="https://kernels-testing.mindtouch.us/@api/deki/users/1"> ... </user.author> <description>Page created, 109 words added</description> <page.parent id="3258" guid="c493ec624e784d7bb4328ed20f8a3d93" draft.state="inactive" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3258?redirects=0" deleted="false"> ... </page.parent> <rating score="" count="0" seated.score="" seated.count="0" unseated.score="" unseated.count="0" anonymous.score="" anonymous.count="0"/> <subpages href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/subpages"/> <aliases href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/aliases"/> <revisions count="1" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/revisions"/> <revisions.archive count="0" deprecated="true" href="https://kernels-testing.mindtouch.us/@api/deki/archive/pages/=Sales_Offers%252FOAWash_High_Efficiency_Laundy_Detergent/revisions"/> <comments count="0" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/comments"/> <properties count="0" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/properties"/> <tags count="1" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/tags"> <tag value="article:topic-guide" id="2" href="https://kernels-testing.mindtouch.us/@api/deki/site/tags/2"> <uri>https://kernels-testing.mindtouch.us/Special:Tags?tag=article:topic-guide</uri> <type>text</type> <title>article:topic-guide</title> </tag> </tags> <files count="0" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/files?redirects=0"/> <contents type="application/vnd.deki1410+xml" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/contents" etag="b37a35f0f90a3bcbd84bb5502c87043e"/> <contents.alt type="application/pdf" href="https://kernels-testing.mindtouch.us/@api/deki/pages/3461/pdf/OAWash%2bHigh%2bEfficiency%2bLaundy%2bDetergent.pdf"/> </page>
-
Page Restriction Info
Sometimes it may be useful to know if the source page of a given kernel has any restrictions. Use the page restriction from the Kernel response to identify the source page's privacy.
FAQs
How often are kernels updated?
Kernels are automatically updated based on page changes.
How is cross-CXone platform authorization done?
All Copilot customers MUST deploy CXone as the IDP for Expert. If customers have non-agent users an IDP such as Azure, OKTA, etc can also be setup to integrate with Expert.
Can I restrict kernels to "public only," and what would that mean?
Yes, Kernels can be configured to only return public and semi-public content.
Sites can be public or private, either accessible via the open internet or behind a login. Both types of sites can enable "public only" or "private only" kernels.