Use the Ask Question of Content action in the Aisera package to send a natural-language query against indexed content in Aisera and return the top answer with citation details.

Prerequisites

  • You must have the Bot Creator role to use the Aisera: Ask Question of Content action in a bot.
  • You must have the Aisera chat base URL for question requests. For example, https://<your-tenant>-<port>.chatbot.aisera.cloud.
    Important: The chat base URL used for the Ask Question of Content action is different from the tenant base URL used for the Ingest Content action. Confirm both URLs with your Aisera administrator.
  • You must have an API bearer token from the Channel details page in your Aisera tenant.
  • You must have the agent channel ID configured in Aisera. The channel ID appears on the Channel Details page in your Aisera tenant.
  • The content you want to query must already be ingested and indexed in Aisera. See Ingest Content action.

The Ask Question of Content action sends a natural-language query to the Aisera conversation API against the indexed content in the specified channel. The action returns the top answer and citation details, which your automation can use in downstream processing steps. You can optionally filter the query to specific content by providing a metadata JSON string.

Procedure

  1. In the Automation Anywhere Control Room, navigate to the Actions pane, select Aisera, drag Ask Question of Content, and place it in the canvas.
  2. Enter or select the following fields:

    1. Enter the Base URL. This is the Aisera chat base URL for question requests. For example, https://<your-tenant>-<port>.chatbot.aisera.cloud.
    2. Enter the API bearer token. This is the bearer token from the Channel details page in your Aisera tenant.
    3. Enter the Channel ID. This is the agent channel ID configured in Aisera. The channel ID appears on the Channel Details page in your Aisera tenant.
    4. Enter the Query. This is the natural-language question to send to Aisera against the indexed content.
    5. (Optional) Enter a Metadata JSON string to filter the query to content that matches the specified metadata. The value must be a valid JSON object string. For example, {"category": "support"}.
  3. In the Output section, assign a Dictionary variable to store the response. The variable contains the following keys:
    Key Type Description
    topChoice String The top answer returned by Aisera for the query.
    topChoiceCitations Table A table of citation details for the top answer. Each row contains source information for the content used to generate the response.
    error String An error message returned by the Aisera API if the request failed.
    success Boolean true if the query was sent and a response was received; false if the request failed.
  4. Click Run to start the bot. Check the success key in the output variable to confirm the query succeeded. If success is false, read the error key for the error message returned by the Aisera API.

If the query is successful, success is true, topChoice contains the top answer as a string, and topChoiceCitations contains a table of source citations for the answer. Use these values in downstream steps in your automation, such as displaying the answer in a message box or writing it to a file.

If the query fails, success is false. Common causes include:

  • The chat base URL, API bearer token, or channel ID is incorrect.
  • The Metadata JSON string field does not contain a valid JSON object string.
  • No content has been ingested and indexed for the specified channel.

Next steps

Use the topChoice and topChoiceCitations variables in subsequent steps in your automation to process, display, or store the answer and its sources. For example, you can write the answer to a log file, pass it to a notification step, or use it as input to another action.