Generic agentic retrieval-augmented generation (RAG) - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

This web service allows users with the GENERATIVE_AI_USER role to query an AI-powered chatbot with agentic capabilities. The chatbot uses tools, the content of the portal, as well as reasoning, to give accurate answers with sources to users. The

  • The Generic agentic retrieval-augmented generation (RAG) web service differs from the Agentic retrieval-augmented generation (RAG) in that its answers must conform to a JSON schema defined in the AI profile.
  • This web service relies on the use of an Agentic chatbot AI profile. See Create an AI profile.
  • It is necessary to provide an Ft-Calling-App value when using Fluid Topics web services. See Fluid Topics calling app.
Method Endpoint
POST
/api/ai/agent/generate

Request example

The following example shows a JSON request body for this web service:

{
  "query": "value",
  "profileId": "generic_agent_profile_id",
  "conversationId": "c41dcf61-8ecb-49f7-a613-890264bbd746",
  "stream": true,
  "searchFilters": []
}
Field Type Required? Description
query String Yes The user's input.
profileId String Yes An AI profile ID.
This web service requires the use of a GENERIC_AGENT profile.
conversationId String Yes An ID for the conversation. Use a unique ID (for example, an UUID).
stream Boolean No Whether the response is streamed or not. Defaults to true.
searchFilters Array No Filters the results based on selected criteria including metadata and date ranges. Defaults to an empty list.
and Object No Combines filters requiring all conditions to be met.
or Object No Combines filters requiring any condition to be met.
not Object No Excludes results that match the specified condition.
key String No Expects a metadata key.
values Array No Defines the value for the selected key. When multiple values are defined, they are combined with an AND or an OR operator depending on the tenant's configuration.
hierarchicalValues Array No Defines hierarchical values for the selected key.

Response body

The content type of the response is of type text/event-stream. The response conforms to the JSON schema defined in the Agentic chatbot AI profile, and as such varies from profile to profile.

For example, for the following JSON schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "connectors": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "capabilities": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "name"
              ]
            }
          }
        },
        "required": [
          "id",
          "name",
          "type"
        ]
      }
    }
  },
  "required": [
    "connectors"
  ]
}

The final output is:

{
  "type": "response",
  "content": {
    "connectors": [
      {
        "id": "Antora",
        "name": "Antora",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes Antora documentation content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "Authorit",
        "name": "Author-it",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes Author-it content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "AuthoritMagellan",
        "name": "Author-it Magellan",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes Author-it Magellan content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "Confluence",
        "name": "Confluence",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes Confluence content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "Dita",
        "name": "DITA",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes DITA content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "External",
        "name": "External",
        "type": "content-source type",
        "features": [
          {
            "name": "External source",
            "description": "Represents externally managed content sources.",
            "capabilities": [
              "create source",
              "manage source metadata"
            ]
          }
        ]
      },
      {
        "id": "ExternalDocument",
        "name": "External Documents",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes external documents through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "FrameMaker-basic-html",
        "name": "Adobe FrameMaker Basic HTML",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes Adobe FrameMaker Basic HTML output through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "Ftml",
        "name": "FTML",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes FTML content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "Jinja",
        "name": "Jinja",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes Jinja-based content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "OpenAPI",
        "name": "OpenAPI",
        "type": "content-source connector",
        "features": [
          {
            "name": "API documentation processing",
            "description": "Processes OpenAPI v2, v3, or v3.1 documents in YAML or JSON format and generates API documentation output.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub",
              "process YAML",
              "process JSON",
              "render API specs"
            ]
          }
        ]
      },
      {
        "id": "Madcap-flare",
        "name": "MadCap Flare",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes MadCap Flare content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "attachments",
        "name": "Attachments",
        "type": "content-source type",
        "features": [
          {
            "name": "Attachment processing",
            "description": "Processes attachment content associated with Knowledge Hub sources.",
            "capabilities": [
              "create source",
              "upload content",
              "publish attachments"
            ]
          }
        ]
      },
      {
        "id": "Markdown",
        "name": "Markdown",
        "type": "content-source connector",
        "features": [
          {
            "name": "Markdown processing",
            "description": "Processes Markdown content; supports table-of-contents and metadata organization.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub",
              "TOC file",
              "metadata file"
            ]
          }
        ]
      },
      {
        "id": "Microsoft-excel",
        "name": "Microsoft Excel",
        "type": "content-source connector",
        "features": [
          {
            "name": "Spreadsheet processing",
            "description": "Processes Microsoft Excel content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "Microsoft-word",
        "name": "Microsoft Word",
        "type": "content-source connector",
        "features": [
          {
            "name": "Document processing",
            "description": "Processes Microsoft Word content; supports document and topic metadata management.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub",
              "manage metadata"
            ]
          }
        ]
      },
      {
        "id": "MkDocs",
        "name": "MkDocs",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes MkDocs documentation content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "Paligo",
        "name": "Paligo",
        "type": "content-source connector",
        "features": [
          {
            "name": "Paligo processing",
            "description": "Processes Paligo content; supports features such as tabbed content and cross-book anchors.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub",
              "tabbed content",
              "cross-book anchors"
            ]
          }
        ]
      },
      {
        "id": "SCHEMA ST4",
        "name": "SCHEMA ST4",
        "type": "content-source connector",
        "features": [
          {
            "name": "Source processing",
            "description": "Processes SCHEMA ST4 content through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub"
            ]
          }
        ]
      },
      {
        "id": "UnstructuredDocuments",
        "name": "Unstructured Documents",
        "type": "content-source connector",
        "features": [
          {
            "name": "Unstructured document processing",
            "description": "Processes unstructured document formats through a Knowledge Hub source.",
            "capabilities": [
              "create source",
              "upload content",
              "publish to Knowledge Hub",
              "plain-text content extraction"
            ]
          }
        ]
      }
    ]
  },
  "run_id": "lc_run--019f9489-5e99-7ce2-8b4f-3b8747a1e16d",
  "session_id": "c362031e-522d-4721-adce-a0bcb995bc35"
}
Field Type Description
id String The unique identifier for the chat (appears in the first event).
type String The type of event. Can be tool_call, tool_result, reasoning, or response.
tool_name String Present in tool_call and tool_result events. The name of the tool invoked. Can only be semsearch at the moment.
args Object Present in tool_call events. The arguments passed to the tool.
query String Present in semsearch calls. The user's query.
tool_call_id String Present in tool_call and tool_result events. The unique identifier for the tool call.
content String Present in reasoning events. Incremental reasoning content.
content Object Present in response events. An object containing the LLM's answer and sources.
message String The LLM's answer.
sources Array An array of sources used by the LLM for its answer.
contentId String The topic's unique ID.
contentUrl String The URL to the source content.
excerpt String The relevant text excerpt from the source.
publicationId String The publication ID the source belongs to.
publicationType String The type of content (for example, TOPIC).
title String The title of the source used for the answer.
run_id String The run identifier for this event.
session_id String The session identifier for this conversation.
Return code Description
200 OK The chatbot rating has been successfully sent.
400 BAD REQUEST Invalid JSON request body, or the requested action is impossible.

For a comprehensive list of all possible return codes, see Return codes.