Searching Artifact using API
While Luma Virtual Agent can automatically connect to Luma Knowledge to leverage the existing Knowledge in the system, Administrators or skill developers can also create integration with Luma Knowledge to search for artifacts as a step during skill execution. The Search API allows a third-party system to search and view the Artifacts available in the Knowledge base.
Using the Search API, you search for Artifact based on:
Artifact ID in Luma Knowledge
Search phrase
Search phrase with additional Metadata such as Domains, Topic, Subjects, Actions, Motivation.
Use the following details to configure and use the Web Service operation:
URI: /api/v1/search
HTTP Method for the operation: POST
Pass the following as Header to the API:
Content-Type: application/json
ClientType:Ajax
Accept: application/json
Capture the tenant access token retrieved during the Login API call. This Bearer token is sent as the Header to the API. The Bearer token is valid only for 15 mins. So, it should be generated using the Login API and passed to Search API as Header
Authorization: Bearer: <Tenant Access Token>
Pass the search criteria in Outbound Payload or Request to the Web Service. The request is passed in the following JSON format.
You could use the Artifact ID to search for the Artifact. The request should be in the below format :
{ "id":<ArtifactID> }
To search for Artifact based on a user phrase, you can use the following request. Luma Knowledge will generate metadata from the provided user phrase and search for Knowledge artifacts.
{ "query": "<search phrase>", "domains":[], "actions":[], "subjects":[], "topics":[], "motivations":[] }
You could also provide additional metadata such as Domains, Topics, Subjects, Actions, Motivations along with the search query to search for relevant Artifacts. Build the request in the following format:
{ "query": "<search phrase>", "domains":["Government"] "actions":[], "subjects":["<Subject 1>","<Subject 2>"], "topics":[<Topic>], "motivations":[] }
For a successful search, the web service returns the response in the following format. For every artifact in the result set, you can find information such as artifact name, Summary, Topic, domain, Direct URL etc.
IF Lums finds a matching Precise Answer for the search, the web service returns the response in the following format. For every answer, you can find information just as Question, Answer, Artifact ID, URL, etc.
A Knowledge search could either return Precise Answer or Artifact List.