Skip to main content
LLM Enrich stage showing structured data extraction with language models
The LLM Enrich stage uses language models to extract structured data from document content. It can identify entities, classify content, extract key information, and generate structured outputs.
Stage Category: ENRICH (Enriches documents)Transformation: N documents → N documents (with extracted data added)

When to Use

When NOT to Use

Parameters

Available Models

Configuration Examples

Output Schema

Define structured output using JSON Schema:

Supported Types

Output Examples

Without Schema

With Schema

Performance

LLM enrichment is expensive. Consider pre-computing extractions during indexing for frequently accessed data.

Common Pipeline Patterns

Search + Extract + Filter

Entity Extraction Pipeline

Writing Effective Prompts

Good Prompts

Poor Prompts

Be specific about what to extract and in what format. When using output_schema, the LLM will conform to the structure.

Multimodal Query Inputs

Pass images from your query inputs to the LLM alongside document content. This enables visual comparison, brand matching, and cross-modal analysis.

Parameters

How It Works

  1. Declare which INPUT fields carry multimodal content via multimodal_inputs
  2. At runtime, the stage extracts URLs from {{INPUT.field_name}}
  3. Images are sent to the LLM alongside the prompt and document content
  4. Works with providers that support vision (Google Gemini, OpenAI GPT-4o, Anthropic Claude)

Configuration Examples

Calling with Multimodal Inputs

When using multimodal_inputs, pass the image URLs in the retriever’s inputs:
If a declared multimodal input field is missing from the query inputs at runtime, the stage proceeds without it (text-only mode). No error is raised.

Bring Your Own Key (BYOK)

Use your own LLM API keys instead of Mixpeek’s default keys. This gives you control over costs, rate limits, and API usage.

Why Use BYOK?

Setup

1

Store your API key as a secret

Store your LLM provider API key in the organization secrets vault:
2

Reference the secret in your stage

Use the api_key parameter with template syntax:

BYOK Configuration Example

Supported Providers

When api_key is not specified, the stage uses Mixpeek’s default API keys and usage is charged to your Mixpeek account.

Custom Enrichment Model (BYO Plugin)

Use your own enrichment model deployed as a custom extractor instead of a hosted LLM provider. Set feature_uri to route enrichment through your extractor’s inference endpoint.

Parameters

Your plugin must accept {prompt: str, document: dict} and return {text: str}.

Configuration Example

Set inference_type: "generate" in your plugin’s manifest to declare compatibility with LLM stages.

Error Handling