Skip to the page
Tecyfy

Search Video by Meaning with Amazon Nova Multimodal Embeddings

How multimodal embeddings let you find a video clip, image or sound by describing it, how Amazon Nova Multimodal Embeddings works on Bedrock (purposes, dimensions, 30-second limit and segmentation), a search pipeline on AWS, and what AWS's own test of 170 creative assets found.

Tecyfy · Published · Updated · 7 min read

A multimodal EmbeddingEmbeddingA list of numbers that stands for the meaning of a piece of text, an image or other data. Things with similar meaning get similar numbers, so a computer can find them. model turns text, images, audio and video into vectors in one shared space, so a sentence and a video clip that mean the same thing end up close together. That lets you search a video library by describing what happens in a clip, with no tags at all. Amazon Nova Multimodal Embeddings, on Amazon Bedrock, is one such model: one model for text, documents, images, video and audio.

This guide explains how the approach works, how to call Nova for indexing and for queries, how to handle long videos, and what AWS's own test of it found.

Why tags stop working

A creative team with tens of thousands of video ads finds clips through tags someone typed. Tags are inconsistent between people and languages, and they only answer the questions the tagger thought of. Nobody tagged "a hand drags the character off screen" or "upbeat synth music", so those clips cannot be found.

Generating tags with a Large Language ModelLarge Language ModelA model trained on a huge amount of text to predict the next token. Further training turns it into an assistant that follows instructions. helps with consistency, but still fixes in advance what can be searched. Embeddings move the work from describing content to representing it: every clip becomes a vector, and any question, asked later in any words, becomes a vector to compare with it.

How a shared space works

Older systems used one model for text and another for images, with no common ground between them. A Multimodal ModelMultimodal ModelA model that works with more than one kind of input or output, such as text and images, or text, sound and video, instead of text alone. trained on paired content maps every type into the same vector space. The text "racing car at night" lands near video segments of racing cars at night, whatever words were (or were not) attached to them. That makes three kinds of search possible with one index:

  • text to video or image: describe the scene you need;
  • image to video: upload a still and find clips that look like it;
  • audio to video: find scenes with a similar sound.

Matching is Vector SearchVector SearchFinding the stored items whose embeddings are closest to a query's embedding, so a search matches meaning rather than exact words.: compare the query's vector with the stored ones, usually by Cosine SimilarityCosine SimilarityA measure of how closely 2 vectors point the same way, from 1 for the same direction to −1 for opposite; with embeddings, a higher score means closer in meaning., and return the nearest.

Calling Nova: index and query are different

Nova asks you to say what each embedding is for, through embeddingPurpose. This is the detail that matters most:

  • Embed the content you store with GENERIC_INDEX, whatever its type.
  • Embed the user's query with the retrieval purpose that matches what is in the index: VIDEO_RETRIEVAL for an index of video, IMAGE_RETRIEVAL for images, GENERIC_RETRIEVAL for a mix.

(CLASSIFICATION and CLUSTERING exist for those jobs.)

A query is short, so it uses the synchronous API:

import json, boto3

bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")

body = {
    "taskType": "SINGLE_EMBEDDING",
    "singleEmbeddingParams": {
        "embeddingPurpose": "VIDEO_RETRIEVAL",
        "embeddingDimension": 1024,
        "text": {"truncationMode": "END", "value": "a hand drags the character off screen"},
    },
}
response = bedrock.invoke_model(
    modelId="amazon.nova-2-multimodal-embeddings-v1:0",
    body=json.dumps(body),
    contentType="application/json",
    accept="application/json",
)
query_vector = json.loads(response["body"].read())["embeddings"][0]["embedding"]

Long videos: segment them

One synchronous call takes at most 30 seconds of video or audio (or 8K tokens of text). For anything longer, use the asynchronous API with SEGMENTED_EMBEDDING: Nova cuts the file into segments of the length you choose and returns one vector per segment, written to S3. Search then finds the moment in a long video, not just the file.

job = bedrock.start_async_invoke(
    modelId="amazon.nova-2-multimodal-embeddings-v1:0",
    modelInput={
        "taskType": "SEGMENTED_EMBEDDING",
        "segmentedEmbeddingParams": {
            "embeddingPurpose": "GENERIC_INDEX",
            "embeddingDimension": 1024,
            "video": {
                "format": "mp4",
                "embeddingMode": "AUDIO_VIDEO_COMBINED",
                "source": {"s3Location": {"uri": "s3://my-assets/ads/ad-0142.mp4"}},
                "segmentationConfig": {"durationSeconds": 5},
            },
        },
    },
    outputDataConfig={"s3OutputDataConfig": {"s3Uri": "s3://my-embeddings/"}},
)
# Poll with get_async_invoke(invocationArn=job["invocationArn"]); results land in S3.

AUDIO_VIDEO_COMBINED gives one vector per segment for picture and sound together; AUDIO_VIDEO_SEPARATE gives one for each, if you want to search sound and picture apart. Short segments (AWS recommends 5 seconds for advertising creative) find precise moments but make more vectors to store; long ones are cheaper but blur several actions together.

Choosing a dimension

Nova offers 256, 384, 1,024 and 3,072 numbers per vector (3,072 if you do not say). More numbers keep more detail but cost more to store and search: see Embedding DimensionEmbedding DimensionNumber of elements in an embedding vector.. AWS's test shows the trade-off clearly:

DimensionEnglish scoreChinese score
3,07289.378.2
1,02485.768.3

AWS recommends 1,024 for most uses. Note the language gap, though: queries in Chinese scored about 11 points lower at full size and 17 at 1,024. If your users search in more than one language, test with their real queries before choosing the smaller size.

A search pipeline on AWS

AWS's reference build uses managed services end to end:

  1. Upload a file to Amazon S3; the upload triggers an AWS Lambda function.
  2. Embed it with a Nova asynchronous job, segmented for video.
  3. Store each segment's vector in Amazon OpenSearch Service, the Vector DatabaseVector DatabaseA database built to store embeddings and quickly find the ones closest to a query, which is how AI apps search by meaning., with the file name, start time and any filters you need (campaign, date, language).
  4. Search: a worker Lambda embeds the query, then OpenSearch runs a k-nearest-neighbour search (HNSW, an Approximate Nearest Neighbor SearchApproximate Nearest Neighbor SearchFinding the stored vectors closest to a query without comparing it with every one, by using an index that may now and then miss the true closest in exchange for far faster searches. index) by cosine similarity, combined with ordinary filters.
  5. Queue searches through Amazon SQS and keep results in Amazon DynamoDB so the web page can poll for them.

Keep the file path and segment start time with every vector: the answer the user wants is "ad-0142, from 0:35", not a vector.

What AWS's test found

AWS tested the build with gaming-industry partners on 170 assets (130 videos and 40 images) with 30 queries:

  • 96.7% of queries (29 of 30) found the target asset;
  • 73.3% (22 of 30) had it in the top two results.

That is a small test, run by the model's maker, so treat it as a sign the approach works rather than a benchmark. Run your own: take 30 to 50 real requests from your team, note the clip each should find, and measure how often it comes back in the top 1, top 5 and top 10, at each dimension you are considering.

To estimate what embedding a library costs with different models, use our embedding cost calculator.

Tecyfy Takeaway

  • Multimodal embeddings put text, images, audio and video in one vector space, so you can search media by describing it, without tags.
  • With Nova, index content with GENERIC_INDEX and embed queries with the matching retrieval purpose, such as VIDEO_RETRIEVAL.
  • Synchronous calls take up to 30 seconds of video or audio; use the asynchronous API to segment longer videos so search finds the moment, not just the file.
  • Start at 1,024 dimensions, but test in every language your users search in: AWS's own figures show a large drop for Chinese.

Questions

What is a multimodal embedding model?
A model that turns text, images, audio and video into vectors in one shared space, so a sentence and a clip that mean the same thing end up close together. That lets you search a video library by describing a scene, with no tags.
What is Amazon Nova Multimodal Embeddings?
An embedding model on Amazon Bedrock that handles text, documents, images, video and audio in one model, with vectors of 256, 384, 1,024 or 3,072 numbers. Its model id is amazon.nova-2-multimodal-embeddings-v1:0.
What embeddingPurpose should I use with Nova?
Embed the content you store with GENERIC_INDEX, whatever its type. Embed the user's query with the retrieval purpose that matches the index: VIDEO_RETRIEVAL for video, IMAGE_RETRIEVAL for images, GENERIC_RETRIEVAL for a mix.
How do I embed long videos with Nova?
A synchronous call takes at most 30 seconds of video or audio. For longer files use the asynchronous API with SEGMENTED_EMBEDDING: Nova cuts the video into segments of the length you choose and writes one vector per segment to S3, so search finds the moment, not just the file.
Which embedding dimension should I choose for Nova?
AWS recommends 1,024 for most uses. In its test, English scores fell from 89.3 at 3,072 to 85.7 at 1,024, but Chinese fell from 78.2 to 68.3, so test with real queries in every language your users search in.