Slug: llm-embeddings-model Version: 1.0.0 Infer: Yes

Overview

LLM Embeddings Model

The LLM Embeddings model generates vector representations (embeddings) of document content at various granularity levels. These embeddings capture the semantic meaning of text, enabling powerful search, similarity matching, and AI-driven document analysis.

How It Works

  1. The model analyzes your document at the specified node level (page, content area, or line)
  2. For each node, it extracts the text content
  3. Optionally summarizes the content (for page-level embeddings only)
  4. Generates vector embeddings using the specified AI model
  5. Attaches the embeddings to the document structure as features

Options Configuration

OptionDescription
modelThe AI model to use for generating embeddings (default: “amazon.titan-embed-text-v1”)
node_typeThe document component level to embed (page, content-area, or line)
use_summarizationWhen enabled, summarizes page content before embedding (page level only)
summarization_promptCustom prompt for the AI to generate summaries (used when summarization is enabled)
summarization_modelLanguage model to use for generating summaries

Process Flow

Node Type Selection

The choice of node type significantly impacts how embeddings represent your document:

  • Page: Creates embeddings for each full page, capturing overall context but less specific
  • Content Area: Generates embeddings for each logical content area, balancing context and specificity
  • Line: Creates embeddings for each text line, offering high granularity but less contextual information

Summarization Option

When embedding at the page level, enabling summarization offers several benefits:

  1. Concise Representation: Distills page content into a focused summary
  2. Noise Reduction: Filters out less relevant information
  3. Consistency: Creates more uniform-length inputs for the embedding model
  4. Improved Relevance: Often produces better semantic search results

The summarization process uses a separate AI model to generate a concise representation of each page before creating the embedding vectors.

Example Usage

Embeddings enable powerful document processing capabilities such as:

  • Semantic Search: Find content based on meaning rather than keywords
  • Document Similarity: Identify similar documents or document sections
  • Clustering: Group documents by content similarity
  • Recommendation: Suggest related documents based on content
  • Question Answering: Support retrieving relevant content for AI question answering

Configuration Examples

For high-precision search across documents:

model: "amazon.titan-embed-text-v1"
node_type: "content-area"
use_summarization: false

For document classification and clustering:

model: "amazon.titan-embed-text-v1"
node_type: "page"
use_summarization: true
summarization_prompt: "Summarize this document page highlighting its main topics and key information:"
summarization_model: "anthropic.claude-3-5-sonnet-20240620-v1:0"

Inference Options

The following options can be configured when using this model for inference:

NameLabelTypeDescriptionDefaultRequired
modelModelcloudEmbeddingThe model to use for the embeddingsamazon.titan-embed-text-v1No
node_typeNode TypestringThe node type to use for the embeddingscontent-areaNo
use_summarizationUse SummarizationbooleanShould we use summarization to generate the embeddings at the page levelFalseNo
summarization_promptSummarization PromptstringThe model to use to build a summary of each page of the documentcan you summarize this text into one sentence:No
summarization_modelModelcloudModelThe model to use to build a summary of each page of the documentanthropic.claude-3-5-sonnet-20240620-v1:0No

Model Details

  • Provider: Kodexa