Multimodal search using Amazon Nova Multimodal Embeddings
This tutorial shows you how to search text, images, video, and audio using the Amazon Nova Multimodal Embeddings model (amazon.nova-2-multimodal-embeddings-v1:0) on Amazon Bedrock. The model embeds all of these content types into a single semantic space, so you can search across modalities, such as finding videos using a text description. Optionally, you can use the search results as context for retrieval-augmented generation (RAG). For more information about multimodal search, see Multimodal search.
In this tutorial, you’ll use the following OpenSearch components:
The steps in this tutorial use self-managed OpenSearch 3.3 or later, with AWS access keys in the connector credentials. If you use OpenSearch Service, see Using Amazon OpenSearch Service.
Replace the placeholders beginning with the prefix your_ with your own values.
Considerations for using Nova Multimodal Embeddings
Note the following considerations when using Nova Multimodal Embeddings with OpenSearch:
- Each Nova Multimodal Embeddings request accepts exactly one input type, so this tutorial creates a separate connector and model for text, images, video, and audio. Each connector uses a modality-specific pre-processing function. Alternatively, you can use a single unified connector. For more information, see the Nova Multimodal Embeddings connector blueprint.
- The Nova Multimodal Embeddings pre-processing functions use only the first input they receive, so use a separate
text_embeddingprocessor for each field. Thetext_image_embeddingprocessor sends text and an image together: with a text model, the processor ignores the image, and with an image model, the request fails. - In a neural query, pass Base64-encoded images, video, or audio in the
query_textfield. The per-modality connectors don’t support thequery_imagefield. - Each connector specifies one media format (for example,
jpegfor images), and the model rejects input whose format doesn’t match. If your content uses multiple formats, create one model per format or convert your media to a single format before ingestion. - AWS recommends using the
GENERIC_INDEXembedding purpose for content that you index and a retrieval purpose (for example,VIDEO_RETRIEVAL) for queries. Because a neural query uses the model’s configured parameters, you’ll register separate query models in Step 2. - The connectors in this tutorial call the synchronous Nova Multimodal Embeddings API, which accepts up to 30 seconds of video or audio and up to 25 MB of inline content per request, measured after Base64 encoding. For longer files, split them before ingestion or use the asynchronous API. For more information, see the Nova Multimodal Embeddings request schema.
Step 1: Register the embedding models
Register one model for each modality. Each connector sets the embeddingPurpose parameter to GENERIC_INDEX and uses it in the request body, so you can create query models in the next step by changing only this parameter. Setting deploy=true registers and deploys each model in one step.
Step 1.1: Register a text embedding model
Register the text embedding model:
POST /_plugins/_ml/models/_register?deploy=true
{
"name": "Amazon Nova Multimodal Embeddings: text",
"function_name": "remote",
"description": "Nova text embedding model",
"connector": {
"name": "Amazon Bedrock connector: Nova text embedding",
"description": "Connector to the Amazon Nova Multimodal Embeddings model for text",
"version": 1,
"protocol": "aws_sigv4",
"credential": {
"access_key": "your_aws_access_key",
"secret_key": "your_aws_secret_key",
"session_token": "your_aws_session_token"
},
"parameters": {
"region": "your_aws_region",
"service_name": "bedrock",
"model": "amazon.nova-2-multimodal-embeddings-v1:0",
"input_docs_processed_step_size": 1,
"dimensions": 1024,
"normalize": true,
"embeddingTypes": ["float"],
"embeddingPurpose": "GENERIC_INDEX",
"truncationMode": "END"
},
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "https://bedrock-runtime.${parameters.region}.amazonaws.com/model/${parameters.model}/invoke",
"headers": {
"content-type": "application/json",
"x-amz-content-sha256": "required"
},
"request_body": "{ \"taskType\": \"SINGLE_EMBEDDING\", \"singleEmbeddingParams\": { \"embeddingPurpose\": \"${parameters.embeddingPurpose}\", \"embeddingDimension\": ${parameters.dimensions}, \"text\": { \"truncationMode\": \"${parameters.truncationMode}\", \"value\": \"${parameters.inputText}\" } } }",
"pre_process_function": "connector.pre_process.bedrock.nova.text_embedding",
"post_process_function": "connector.post_process.bedrock.nova.embedding"
}
]
}
}
The response contains the model ID:
{
"task_id": "kl5fM6IBZzypD1MT4HdU",
"status": "CREATED",
"model_id": "k15fM6IBZzypD1MT4Hej"
}
Note the model_id because you’ll use it in the following steps. If the response doesn’t contain a model_id, retrieve it using the Get Task API with the returned task_id.
Test the model:
POST /_plugins/_ml/models/your_text_model_id/_predict
{
"parameters": {
"inputText": "a red bike"
}
}
The response contains a 1,024-dimensional embedding:
{
"inference_results": [
{
"output": [
{
"name": "sentence_embedding",
"data_type": "FLOAT32",
"shape": [1024],
"data": [
0.010949663,
0.04203495,
-0.034539204,
...
]
}
],
"status_code": 200
}
]
}
Step 1.2: Register an image embedding model
Register the image embedding model. Set imageFormat to the format of your images (png, jpeg, gif, or webp). For images of documents, such as scanned pages, set detailLevel to DOCUMENT_IMAGE:
POST /_plugins/_ml/models/_register?deploy=true
{
"name": "Amazon Nova Multimodal Embeddings: image",
"function_name": "remote",
"description": "Nova image embedding model",
"connector": {
"name": "Amazon Bedrock connector: Nova image embedding",
"description": "Connector to the Amazon Nova Multimodal Embeddings model for images",
"version": 1,
"protocol": "aws_sigv4",
"credential": {
"access_key": "your_aws_access_key",
"secret_key": "your_aws_secret_key",
"session_token": "your_aws_session_token"
},
"parameters": {
"region": "your_aws_region",
"service_name": "bedrock",
"model": "amazon.nova-2-multimodal-embeddings-v1:0",
"input_docs_processed_step_size": 1,
"dimensions": 1024,
"normalize": true,
"embeddingTypes": ["float"],
"embeddingPurpose": "GENERIC_INDEX",
"imageFormat": "jpeg",
"detailLevel": "STANDARD_IMAGE"
},
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "https://bedrock-runtime.${parameters.region}.amazonaws.com/model/${parameters.model}/invoke",
"headers": {
"content-type": "application/json",
"x-amz-content-sha256": "required"
},
"request_body": "{ \"taskType\": \"SINGLE_EMBEDDING\", \"singleEmbeddingParams\": { \"embeddingPurpose\": \"${parameters.embeddingPurpose}\", \"embeddingDimension\": ${parameters.dimensions}, \"image\": { \"format\": \"${parameters.imageFormat}\", \"detailLevel\": \"${parameters.detailLevel}\", \"source\": { \"bytes\": \"${parameters.inputImage}\" } } } }",
"pre_process_function": "connector.pre_process.bedrock.nova.image_embedding",
"post_process_function": "connector.post_process.bedrock.nova.embedding"
}
]
}
}
To test the model, provide a Base64-encoded image:
POST /_plugins/_ml/models/your_image_model_id/_predict
{
"parameters": {
"inputImage": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
}
Step 1.3: Register a video embedding model
Register the video embedding model. The AUDIO_VIDEO_COMBINED embedding mode produces a single embedding that represents both the visual and audio content of the video:
POST /_plugins/_ml/models/_register?deploy=true
{
"name": "Amazon Nova Multimodal Embeddings: video",
"function_name": "remote",
"description": "Nova video embedding model",
"connector": {
"name": "Amazon Bedrock connector: Nova video embedding",
"description": "Connector to the Amazon Nova Multimodal Embeddings model for video",
"version": 1,
"protocol": "aws_sigv4",
"credential": {
"access_key": "your_aws_access_key",
"secret_key": "your_aws_secret_key",
"session_token": "your_aws_session_token"
},
"parameters": {
"region": "your_aws_region",
"service_name": "bedrock",
"model": "amazon.nova-2-multimodal-embeddings-v1:0",
"input_docs_processed_step_size": 1,
"dimensions": 1024,
"normalize": true,
"embeddingTypes": ["float"],
"embeddingPurpose": "GENERIC_INDEX",
"videoFormat": "mp4",
"embeddingMode": "AUDIO_VIDEO_COMBINED"
},
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "https://bedrock-runtime.${parameters.region}.amazonaws.com/model/${parameters.model}/invoke",
"headers": {
"content-type": "application/json",
"x-amz-content-sha256": "required"
},
"request_body": "{ \"taskType\": \"SINGLE_EMBEDDING\", \"singleEmbeddingParams\": { \"embeddingPurpose\": \"${parameters.embeddingPurpose}\", \"embeddingDimension\": ${parameters.dimensions}, \"video\": { \"format\": \"${parameters.videoFormat}\", \"embeddingMode\": \"${parameters.embeddingMode}\", \"source\": { \"bytes\": \"${parameters.inputVideo}\" } } } }",
"pre_process_function": "connector.pre_process.bedrock.nova.video_embedding",
"post_process_function": "connector.post_process.bedrock.nova.embedding"
}
]
}
}
To test the model, provide a Base64-encoded video:
POST /_plugins/_ml/models/your_video_model_id/_predict
{
"parameters": {
"inputVideo": "AAAAHGZ0eXBtcDQy..."
}
}
Step 1.4: Register an audio embedding model
Register the audio embedding model:
POST /_plugins/_ml/models/_register?deploy=true
{
"name": "Amazon Nova Multimodal Embeddings: audio",
"function_name": "remote",
"description": "Nova audio embedding model",
"connector": {
"name": "Amazon Bedrock connector: Nova audio embedding",
"description": "Connector to the Amazon Nova Multimodal Embeddings model for audio",
"version": 1,
"protocol": "aws_sigv4",
"credential": {
"access_key": "your_aws_access_key",
"secret_key": "your_aws_secret_key",
"session_token": "your_aws_session_token"
},
"parameters": {
"region": "your_aws_region",
"service_name": "bedrock",
"model": "amazon.nova-2-multimodal-embeddings-v1:0",
"input_docs_processed_step_size": 1,
"dimensions": 1024,
"normalize": true,
"embeddingTypes": ["float"],
"embeddingPurpose": "GENERIC_INDEX",
"audioFormat": "mp3"
},
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "https://bedrock-runtime.${parameters.region}.amazonaws.com/model/${parameters.model}/invoke",
"headers": {
"content-type": "application/json",
"x-amz-content-sha256": "required"
},
"request_body": "{ \"taskType\": \"SINGLE_EMBEDDING\", \"singleEmbeddingParams\": { \"embeddingPurpose\": \"${parameters.embeddingPurpose}\", \"embeddingDimension\": ${parameters.dimensions}, \"audio\": { \"format\": \"${parameters.audioFormat}\", \"source\": { \"bytes\": \"${parameters.inputAudio}\" } } } }",
"pre_process_function": "connector.pre_process.bedrock.nova.audio_embedding",
"post_process_function": "connector.post_process.bedrock.nova.embedding"
}
]
}
}
To test the model, provide a Base64-encoded audio file:
POST /_plugins/_ml/models/your_audio_model_id/_predict
{
"parameters": {
"inputAudio": "//vQZAAG9qVou9GP..."
}
}
Step 2: Register query models
Register a query model for each combination of query type and vector field that you plan to search. Each query model uses the same request as the embedding model on which it’s based, with a different name and embeddingPurpose. This tutorial uses the following query models.
| Model ID | Based on | embeddingPurpose | Searches |
|---|---|---|---|
your_text_query_model_id | Text embedding model | TEXT_RETRIEVAL | Text embeddings using a text query |
your_image_query_model_id | Image embedding model | IMAGE_RETRIEVAL | Image embeddings using an image query |
your_text_to_image_query_model_id | Text embedding model | IMAGE_RETRIEVAL | Image embeddings using a text query |
your_text_to_video_query_model_id | Text embedding model | VIDEO_RETRIEVAL | Video embeddings using a text query |
For example, the following request registers the text-to-video query model:
POST /_plugins/_ml/models/_register?deploy=true
{
"name": "Amazon Nova Multimodal Embeddings: text-to-video query",
"function_name": "remote",
"description": "Nova text embedding model for queries that search video embeddings",
"connector": {
"name": "Amazon Bedrock connector: Nova text-to-video query embedding",
"description": "Connector to the Amazon Nova Multimodal Embeddings model for text queries that search videos",
"version": 1,
"protocol": "aws_sigv4",
"credential": {
"access_key": "your_aws_access_key",
"secret_key": "your_aws_secret_key",
"session_token": "your_aws_session_token"
},
"parameters": {
"region": "your_aws_region",
"service_name": "bedrock",
"model": "amazon.nova-2-multimodal-embeddings-v1:0",
"input_docs_processed_step_size": 1,
"dimensions": 1024,
"normalize": true,
"embeddingTypes": ["float"],
"embeddingPurpose": "VIDEO_RETRIEVAL",
"truncationMode": "END"
},
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "https://bedrock-runtime.${parameters.region}.amazonaws.com/model/${parameters.model}/invoke",
"headers": {
"content-type": "application/json",
"x-amz-content-sha256": "required"
},
"request_body": "{ \"taskType\": \"SINGLE_EMBEDDING\", \"singleEmbeddingParams\": { \"embeddingPurpose\": \"${parameters.embeddingPurpose}\", \"embeddingDimension\": ${parameters.dimensions}, \"text\": { \"truncationMode\": \"${parameters.truncationMode}\", \"value\": \"${parameters.inputText}\" } } }",
"pre_process_function": "connector.pre_process.bedrock.nova.text_embedding",
"post_process_function": "connector.post_process.bedrock.nova.embedding"
}
]
}
}
Step 3: Create an ingest pipeline
Create an ingest pipeline that generates embeddings for each modality. Each text_embedding processor sends one field to the corresponding model and stores the result in a vector field. A processor skips documents that don’t contain its field. The final remove processor deletes the Base64-encoded media so that it isn’t stored in the index:
PUT /_ingest/pipeline/nova-multimodal-pipeline
{
"description": "Generates Nova embeddings for text, images, video, and audio",
"processors": [
{
"text_embedding": {
"model_id": "your_text_model_id",
"field_map": {
"description": "description_embedding"
}
}
},
{
"text_embedding": {
"model_id": "your_image_model_id",
"field_map": {
"image": "image_embedding"
}
}
},
{
"text_embedding": {
"model_id": "your_video_model_id",
"field_map": {
"video": "video_embedding"
}
}
},
{
"text_embedding": {
"model_id": "your_audio_model_id",
"field_map": {
"audio": "audio_embedding"
}
}
},
{
"remove": {
"field": ["image", "video", "audio"],
"ignore_missing": true
}
}
]
}
Step 4: Create an index
Create a vector index that uses the ingest pipeline by default. All the models produce 1,024-dimensional embeddings in the same semantic space, so you can search any vector field using a query of a different modality:
PUT /nova-multimodal-index
{
"settings": {
"index.knn": true,
"default_pipeline": "nova-multimodal-pipeline"
},
"mappings": {
"properties": {
"description": { "type": "text" },
"image": { "type": "binary" },
"video": { "type": "binary" },
"audio": { "type": "binary" },
"description_embedding": { "type": "knn_vector", "dimension": 1024 },
"image_embedding": { "type": "knn_vector", "dimension": 1024 },
"video_embedding": { "type": "knn_vector", "dimension": 1024 },
"audio_embedding": { "type": "knn_vector", "dimension": 1024 }
}
}
}
Step 5: Ingest data
Ingest documents that contain a text description and a Base64-encoded image, video, or audio field. The following request ingests product images, short videos, and audio clips. The Base64 strings are truncated in this example:
POST /_bulk
{ "index": { "_index": "nova-multimodal-index", "_id": "hat1" } }
{ "description": "Product photo of a hat", "image": "/9j/4AAQSkZJRgABAQAAAQABAAD..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "bike1" } }
{ "description": "Product photo of a bike", "image": "/9j/4AAQSkZJRgABAQAAAQABAAD..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "bike_frame1" } }
{ "description": "Product photo of a bike frame", "image": "/9j/4AAQSkZJRgABAQAAAQABAAD..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "video1" } }
{ "description": "Video of the sea", "video": "AAAAHGZ0eXBtcDQy..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "video2" } }
{ "description": "Video of a conch shell", "video": "AAAAHGZ0eXBtcDQy..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "video3" } }
{ "description": "Video of a running car", "video": "AAAAHGZ0eXBtcDQy..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "video4" } }
{ "description": "Video of a police car", "video": "AAAAHGZ0eXBtcDQy..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "audio1" } }
{ "description": "Audio clip of a guitar", "audio": "//vQZAAG9qVou9GP..." }
{ "index": { "_index": "nova-multimodal-index", "_id": "audio2" } }
{ "description": "Audio clip of a vehicle", "audio": "//vUZAAABjVFQJ1j..." }
Base64-encoded video and audio can make bulk requests large. Ensure that each bulk request doesn’t exceed the maximum HTTP request size of your cluster (http.max_content_length), and ingest large files in smaller batches.
Step 6: Search the index
Use a neural query with the query model that matches the query type and the vector field that you’re searching. To search using an image, video, or audio file, pass the Base64-encoded file in the query_text field.
Searching videos using text
The following request searches the video embeddings using a text description. The video_embedding field contains only video embeddings, so the ranking reflects only the video content. The response includes the description field to identify each result:
GET /nova-multimodal-index/_search
{
"size": 3,
"_source": ["description"],
"query": {
"neural": {
"video_embedding": {
"query_text": "emergency vehicle",
"model_id": "your_text_to_video_query_model_id",
"k": 3
}
}
}
}
The response contains the matching videos:
{
"took": 393,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 3,
"relation": "eq"
},
"max_score": 0.406824,
"hits": [
{
"_index": "nova-multimodal-index",
"_id": "video4",
"_score": 0.406824,
"_source": {
"description": "Video of a police car"
}
},
{
"_index": "nova-multimodal-index",
"_id": "video3",
"_score": 0.37978896,
"_source": {
"description": "Video of a running car"
}
},
{
"_index": "nova-multimodal-index",
"_id": "video1",
"_score": 0.33471328,
"_source": {
"description": "Video of the sea"
}
}
]
}
}
Searching images using an image
The following request searches the image embeddings using a Base64-encoded image:
GET /nova-multimodal-index/_search
{
"size": 3,
"_source": ["description"],
"query": {
"neural": {
"image_embedding": {
"query_text": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"model_id": "your_image_query_model_id",
"k": 3
}
}
}
}
Searching multiple modalities
To search several vector fields in one request, combine neural queries in a bool query. The following request searches descriptions, images, and videos using the text “bike”:
GET /nova-multimodal-index/_search
{
"size": 5,
"_source": ["description"],
"query": {
"bool": {
"should": [
{
"neural": {
"description_embedding": {
"query_text": "bike",
"model_id": "your_text_query_model_id",
"k": 5
}
}
},
{
"neural": {
"image_embedding": {
"query_text": "bike",
"model_id": "your_text_to_image_query_model_id",
"k": 5
}
}
},
{
"neural": {
"video_embedding": {
"query_text": "bike",
"model_id": "your_text_to_video_query_model_id",
"k": 5
}
}
}
]
}
}
}
Step 7 (Optional): Generate answers using RAG
You can use the search results as context for a large language model (LLM). In this step, you’ll use Anthropic Claude Haiku 4.5 on Amazon Bedrock using the Converse API.
Step 7.1: Register an LLM
Register the LLM:
POST /_plugins/_ml/models/_register?deploy=true
{
"name": "Anthropic Claude Haiku 4.5 on Amazon Bedrock",
"function_name": "remote",
"description": "LLM for multimodal RAG",
"connector": {
"name": "Amazon Bedrock Converse connector: Claude Haiku 4.5",
"description": "Connector to Anthropic Claude Haiku 4.5 through the Amazon Bedrock Converse API",
"version": 1,
"protocol": "aws_sigv4",
"credential": {
"access_key": "your_aws_access_key",
"secret_key": "your_aws_secret_key",
"session_token": "your_aws_session_token"
},
"parameters": {
"region": "your_aws_region",
"service_name": "bedrock",
"model": "us.anthropic.claude-haiku-4-5-20251001-v1:0"
},
"actions": [
{
"action_type": "predict",
"method": "POST",
"url": "https://bedrock-runtime.${parameters.region}.amazonaws.com/model/${parameters.model}/converse",
"headers": {
"content-type": "application/json"
},
"request_body": "{ \"messages\": ${parameters.messages} }"
}
]
}
}
The us.anthropic.claude-haiku-4-5-20251001-v1:0 model ID is a cross-Region inference profile for US Regions. If your Region is outside the US, use the corresponding inference profile for your geography.
Step 7.2: Create a search pipeline
Create a search pipeline containing a retrieval_augmented_generation processor. The processor sends the fields listed in context_field_list to the LLM as context. Because the ingest pipeline removes the media, use a text field, such as a description or transcript, as context:
PUT /_search/pipeline/nova-rag-pipeline
{
"response_processors": [
{
"retrieval_augmented_generation": {
"tag": "nova_multimodal_rag",
"description": "Multimodal RAG pipeline",
"model_id": "your_llm_model_id",
"context_field_list": ["description"],
"user_instructions": "Answer the question using only the provided context, which describes images, videos, and audio clips."
}
}
]
}
Step 7.3: Search and generate an answer
Send a neural query with the search pipeline and provide the question in generative_qa_parameters. The bedrock-converse/ prefix in llm_model specifies that the processor formats the request for the Converse API:
GET /nova-multimodal-index/_search?search_pipeline=nova-rag-pipeline
{
"size": 3,
"_source": ["description"],
"query": {
"neural": {
"video_embedding": {
"query_text": "emergency vehicle",
"model_id": "your_text_to_video_query_model_id",
"k": 3
}
}
},
"ext": {
"generative_qa_parameters": {
"llm_model": "bedrock-converse/us.anthropic.claude-haiku-4-5-20251001-v1:0",
"llm_question": "Which video shows an emergency vehicle?",
"context_size": 3,
"timeout": 30
}
}
}
The response contains the search results and the generated answer in ext.retrieval_augmented_generation.answer:
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 3,
"relation": "eq"
},
"max_score": 0.406824,
"hits": [
{
"_index": "nova-multimodal-index",
"_id": "video4",
"_score": 0.406824,
"_source": {
"description": "Video of a police car"
}
},
{
"_index": "nova-multimodal-index",
"_id": "video3",
"_score": 0.37978896,
"_source": {
"description": "Video of a running car"
}
},
{
"_index": "nova-multimodal-index",
"_id": "video1",
"_score": 0.33471328,
"_source": {
"description": "Video of the sea"
}
}
]
},
"ext": {
"retrieval_augmented_generation": {
"answer": "Based on the provided context, **Search Result 1** shows an emergency vehicle, as it is described as a \"Video of a police car.\" A police car is an emergency vehicle."
}
}
}
Using Amazon OpenSearch Service
In Amazon OpenSearch Service, connectors use an AWS Identity and Access Management (IAM) role to invoke models on Amazon Bedrock. The steps in this tutorial are the same, with the following changes:
- Use Amazon OpenSearch Service 2.17 or later. To use the dedicated
audio_embeddingpre-processing function, use version 3.3 or later. In earlier versions, useconnector.pre_process.bedrock.nova.video_embeddingin the audio connector and useinputVideoinstead ofinputAudioin both the connector request body and the_predictrequest. - Create an IAM role that allows Amazon OpenSearch Service to invoke Nova Multimodal Embeddings and the LLM. For instructions, see Amazon OpenSearch Service connectors for AWS services.
- In each connector, replace the access keys with the IAM role Amazon Resource Name (ARN):
"credential": {
"roleArn": "your_iam_role_arn"
}