GenAI query classes

The FileNet P8 Content Engine Java™ and .NET APIs or the FileNet P8 Content Services GraphQL API supports the following Content Engine classes:

  • GenaiBaseQuery

    The GenaiBaseQuery class enables an API caller to submit a question and generate a response from the watsonx LLM. The base class can be used directly but it does not allow the question to be augmented with document context. For more information, see GenaiBaseQuery class in the FNCM documentation.

  • GenaiVectorQuery

    The GenaiVectorQuery class inherits from the GenaiBaseQuery class. It enables an API caller to perform a vector query across the vector index for an entire object store. Before any of the document chunks are used for LLM inferencing, or returned to the caller, the Content Platform Engine server verifies whether the caller has VIEW_CONTENT permissions for the underlying documents. The set of documents that most closely match the input prompt are then returned. For more information, see GenaiVectorQuery class in the FNCM documentation.

  • GenaiDocumentQuery
    The class inherits from the GenaiVectorQuery class. It enables an API caller to query a single document and generate a response from the watsonx LLM. The Content Platform Engine server verifies whether the call has VIEW_CONTENT access for the underlying document. The document is processed by using one of the following methods:
    • Entire document processing - If the extracted text is less than 400,000 characters and no custom value is specified for GenaiRelevancyFilterLevel, the entire document text is sent directly to the LLM without querying the vector database. In this case, the relevancy score checking is also ignored. This optimization works well for large documents where relevant sections are scattered across different areas.
    • Retrieval-augmented generation (RAG) - If the extracted text exceeds 400,000 characters or a custom GenaiRelevancyFilterLevel value is specified, this method is used. A vector query retrieves the most relevant document chunks, which are then sent to the LLM along with the prompt to generate a response.
    For more information, see GenaiDocumentQuery class in the FNCM documentation.
  • GenaiMultiDocumentQuery

    The class inherits from the GenaiVectorQuery class. It enables an API caller to perform a vector query that is filtered to include chunks from a specified document list. The Content Platform Engine server verifies whether the call has VIEW_CONTENT access for the specified documents. The set of document chunks that most closely match the input prompt are then returned. For more information, see GenaiMultiDocumentQuery class in the FNCM documentation.

  • GenaiAdhocSummary

    The GenaiAdhocSummary class inherits from the GenaiBaseQuery class. The class takes a list of documents as input and generates the watsonx summary for the documents by passing a subset of the document content to the LLM. The amount of text that is taken from each input document depends on the number of input documents and the LLM context window.

  • GenaiDocumentComparison

    The GenaiDocumentComparison class inherits from the GenaiBaseQuery class. This class can be used to compare two document versions. These can be two versions of the same document, or document versions from two different documents. The caller must have VIEW_CONTENT access to both documents. The caller may specify additional instructions that specify how watsonx.ai should perform the comparison.