> This page is for version v1.3 (default).
> For other versions, use one of these documentation indexes:
> - v1.3 (default): https://docs.twelvelabs.io/v1.3/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server.

# Embeddings for indexed videos

> Retrieve embeddings from previously indexed videos.

This guide shows how to retrieve the embeddings that the platform generated when you indexed your videos. This method returns existing embeddings; it does not create new ones.

The platform creates these embeddings with video scene detection, which divides a video into segments at scene boundaries. A scene is a series of frames showing a continuous action or theme. Each segment is between 2 and 10 seconds.

# Prerequisites

Your video must be indexed with the Marengo video understanding model. This method supports Marengo 3.0 and older versions. For details on enabling this model for an index, see the [Create an index](/v1.3/docs/concepts/indexes#create-an-index) page.

# Complete example

Copy and paste the code below, replacing the placeholders surrounded by `<>` with your values.

**`Python`**

```python Python maxlines=12
from twelvelabs import TwelveLabs

client = TwelveLabs(api_key="<YOUR_API_KEY>")

# 1. Retrieve the embeddings
video = client.indexes.indexed_assets.retrieve(
    index_id="<YOUR_INDEX_ID>", indexed_asset_id="<YOUR_INDEXED_ASSET_ID>", embedding_option=["visual", "audio", "transcription"])

# 2. Process the results
segments = video.embedding.video_embedding.segments
print(f"\n{'='*80}")
print(f"EMBEDDINGS SUMMARY: {len(segments)} total embeddings")
print(f"{'='*80}\n")

for idx, segment in enumerate(segments, 1):
    print(f"[{idx}/{len(segments)}] {segment.embedding_option.upper()} | {segment.embedding_scope.upper()}")
    print(
        f"├─ Time range: {segment.start_offset_sec}s - {segment.end_offset_sec}s")
    print(f"├─ Dimensions: {len(segment.float_)}")
    print(f"└─ First 10 values: {segment.float_[:10]}")
    print()
```

**`Node.js`**

```javascript Node.js maxlines=12
import { TwelveLabs } from "twelvelabs-js";

const client = new TwelveLabs({ apiKey: "<YOUR_API_KEY>" });

// 1. Retrieve the embeddings
const video = await client.indexes.indexedAssets.retrieve("<YOUR_INDEX_ID>", "<YOUR_INDEXED_ASSET_ID>", {
    embeddingOption: ["visual", "audio", "transcription"]
})

// 2. Process the results
const segments = video.embedding.videoEmbedding.segments;
console.log(`\n${"=".repeat(80)}`);
console.log(`EMBEDDINGS SUMMARY: ${segments.length} total embeddings`);
console.log(`${"=".repeat(80)}\n`);

segments.forEach((segment, index) => {
    console.log(`[${index + 1}/${segments.length}] ${segment.embeddingOption.toUpperCase()} | ${segment.embeddingScope.toUpperCase()}`);
    console.log(`├─ Time range: ${segment.startOffsetSec}s - ${segment.endOffsetSec}s`);
    console.log(`├─ Dimensions: ${segment.float.length}`);
    console.log(`└─ First 10 values: ${segment.float.slice(0, 10)}`);
    console.log();
});
```

# Code explanation

#### Python

#### Retrieve the embeddings

Retrieve the embeddings for an indexed video.\

**Function call**: You call the [`indexes.indexed_assets.retrieve`](/v1.3/sdk-reference/python/index-content#retrieve-an-indexed-asset) function.\

**Parameters**:

* `index_id`: The unique identifier of the index containing your video.
* `indexed_asset_id`: The unique identifier of your indexed video.
* `embedding_option`: The types of embeddings to retrieve. Valid values are `visual`, `audio`, and `transcription`. You can specify multiple values. This example uses `["visual", "audio", "transcription"]`.

  See the [Embedding options](/v1.3/docs/concepts/modalities#embedding-options) section for details.\


**Return value**: The response contains, among other information, an object named `embedding` that contains the embedding data for your video. The `embedding.video_embedding.segments` field is a list of segment objects. Each segment object includes:

* `float_`: The embedding vector (a list of floats).
* `embedding_option`: The type of embedding (`visual`, `audio`, or `transcription`).
* `embedding_scope`: The scope of the embedding (`clip`).
* `start_offset_sec`: The start time of the segment in seconds.
* `end_offset_sec`: The end time of the segment in seconds.

#### Process the results

This example iterates through the embeddings in the `segments` field and prints the embedding type, scope, time range, dimensions, and the first 10 vector values for each segment.

#### Node.js

#### Retrieve the embeddings

Retrieve the embeddings for an indexed video.\

**Function call**: You call the [`indexes.indexedAssets.retrieve`](/v1.3/sdk-reference/node-js/index-content#retrieve-an-indexed-asset) function.\

**Parameters**:

* `indexId`: The unique identifier of the index containing your video.
* `indexedAssetId`: The unique identifier of your indexed video.
* `embeddingOption`: The types of embeddings to retrieve. Valid values are `visual`, `audio`, and `transcription`. You can specify multiple values. This example uses `["visual", "audio", "transcription"]`.

  See the [Embedding options](/v1.3/docs/concepts/modalities#embedding-options) section for details.\


**Return value**: The response contains, among other information, an object named `embedding` that contains the embedding data for your video. The `embedding.videoEmbedding.segments` field is a list of segment objects. Each segment object includes:

* `float`: The embedding vector (a list of floats).
* `embeddingOption`: The type of embedding (`visual`, `audio`, or `transcription`).
* `embeddingScope`: The scope of the embedding (`clip`).
* `startOffsetSec`: The start time of the segment in seconds.
* `endOffsetSec`: The end time of the segment in seconds.

#### Process the results

This example iterates through the embeddings in the `segments` field and prints the embedding type, scope, time range, dimensions, and the first 10 vector values for each segment.