Skip to content

LLM Index Document

The task utilizes a large language model (LLM) to generate embeddings of the indexed document text, which are then stored in a vector database for later retrieval.

Prerequisites

Task parameters

Configure these parameters for the LLM Index Document task.

Parameter Description Required/ Optional
inputParameters.vectorDB The vector database to store the data.

Note: If you haven’t configured the vector database on your Orkes Conductor cluster, navigate to the Integrations tab and configure your required provider.
Required.
inputParameters.index The index in your vector database where the text or data will be stored.

The terminology of the index field varies depending on the integration:
  • For Weaviate, the index field indicates the collection name.
  • For other integrations, it denotes the index name.
Required.
inputParameters.namespace Namespaces are separate isolated environments within the database to manage and organize vector data effectively. Enter the namespace the task will utilize.

The usage and terminology of the namespace field vary depending on the integration:
  • For Pinecone, the namespace field is applicable.
  • For Weaviate, the namespace field is not applicable.
  • For MongoDB, the namespace field is referred to as “Collection” in MongoDB.
  • For Postgres, the namespace field is referred to as “Table” in Postgres.
Required.
inputParameters.embeddingModelProvider The LLM provider for generating the embeddings.

Note: If you haven’t configured your AI/LLM provider on your Orkes Conductor cluster, navigate to the Integrations tab and configure your required provider.
Required.
inputParameters.embeddingModel The embedding model provided by the selected LLM provider to generate the embeddings. Required.
inputParameters.dimensions The size of the vector, which is the number of elements in the vector. Optional.
inputParameters.url The URL of the file to be indexed. Required.
inputParameters.mediaType The media type of the file to be indexed. Supported media types:
  • application/pdf
  • text/html
  • text/plain
  • application/json
Optional.
inputParameters.chunkSize The length of each input text segment when divided for processing by the LLM. For example, if the document contains 2,000 words and the chunk size is set to 500, the document is divided into four chunks for processing. Optional.
inputParameters.chunkOverlap The overlap between adjacent chunks. For example, if the chunk overlap is specified as 100, then the first 100 words of each chunk would overlap with the last 100 words of the previous chunk. Optional.

The following are generic configuration parameters that can be applied to the task and are not specific to the LLM Index Document task.

Caching parameters

You can cache the task outputs using the following parameters. Refer to Caching Task Outputs for a full guide.

Parameter Description Required/ Optional
cacheConfig.ttlInSecond The time to live in seconds, which is the duration for the output to be cached. Required if using cacheConfig.
cacheConfig.key The cache key is a unique identifier for the cached output and must be constructed exclusively from the task’s input parameters.
It can be a string concatenation that contains the task’s input keys, such as ${uri}-${method} or re_${uri}_${method}.
Required if using cacheConfig.
Other generic parameters

Here are other parameters for configuring the task behavior.

Parameter Description Required/ Optional
optional Whether the task is optional.

If set totrue, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding.
Optional.

Task configuration

This is the task configuration for an LLM Index Document task.

{
     "name": "llm_index_document",
     "taskReferenceName": "llm_index_document_ref",
     "inputParameters": {
       "chunkSize": 200,
       "vectorDB": "Pinecone",
       "index": "${workflow.input.indexName}",
       "namespace": "docs",
       "embeddingModelProvider": "openAI",
       "embeddingModel": "text-embedding-3-large",
       "dimensions": 3024,
       "url": "https://orkes.io/content/remote-services",
       "mediaType": "text/html",
       "chunkOverlap": 50
     },
     "type": "LLM_INDEX_DOCUMENT"
}

Task output

There is no output. The LLM Index Document task will store the indexed data in the specified vector database.

Examples

Here are some examples for using the LLM Index Document task.

Using an LLM Index Document task in a workflow

See an example of building a document retrieval workflow using Orkes Conductor.