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:

  1. Artifact ID in Luma Knowledge

  2. Search phrase

  3. Search phrase with additional Metadata such as Domains, Topic, Subjects, Actions, Motivation.

Use the following details to configure and use the Web Service operation:

  1. URI: /api/v1/search

  2. HTTP Method for the operation: POST

  3. Pass the following as Header to the API:

    1. Content-Type: application/json

    2. ClientType:Ajax

    3. Accept: application/json

    4. 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>

  4. Pass the search criteria in Outbound Payload or Request to the Web Service. The request is passed in the following JSON format.

    1. You could use the Artifact ID to search for the Artifact. The request should be in the below format :

      { "id":<ArtifactID> }
    2. 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":[] }
    3. 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":[] }
  5. 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.

  6. 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.