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:
GenaiBaseQueryThe
GenaiBaseQueryclass 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, seeGenaiBaseQueryclass in the FNCM documentation.GenaiVectorQueryThe
GenaiVectorQueryclass inherits from theGenaiBaseQueryclass. 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 hasVIEW_CONTENTpermissions for the underlying documents. The set of documents that most closely match the input prompt are then returned. For more information, seeGenaiVectorQueryclass in the FNCM documentation.GenaiDocumentQueryThe class inherits from theGenaiVectorQueryclass. 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 hasVIEW_CONTENTaccess 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
GenaiRelevancyFilterLevelvalue 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.
GenaiDocumentQueryclass in the FNCM documentation.- Entire document processing - If the extracted text is less than 400,000 characters and no
custom value is specified for
GenaiMultiDocumentQueryThe class inherits from the
GenaiVectorQueryclass. 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 hasVIEW_CONTENTaccess for the specified documents. The set of document chunks that most closely match the input prompt are then returned. For more information, seeGenaiMultiDocumentQueryclass in the FNCM documentation.GenaiAdhocSummaryThe
GenaiAdhocSummaryclass inherits from theGenaiBaseQueryclass. 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.GenaiDocumentComparisonThe
GenaiDocumentComparisonclass inherits from theGenaiBaseQueryclass. 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 haveVIEW_CONTENTaccess to both documents. The caller may specify additional instructions that specify how watsonx.ai should perform the comparison.