> 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.

# MongoDB - Semantic video search

> This integration combines the TwelveLabs Embed API with MongoDB Atlas Vector Search to create an efficient semantic video search solution.

![](/_fern-img/2c372c190385ea9a6ee0956b73997e572cda2323c1379493505f5b4b44fe8033.webp)

**Summary**: This integration combines TwelveLabs' [Embed API](/docs/guides/create-embeddings) with MongoDB [Atlas Vector Search](https://www.mongodb.com/products/platform/atlas-vector-search) to create an efficient semantic video search solution. It captures rich video content as multimodal embeddings, enabling precise and relevant search results.

**Description**: The process of performing a semantic video search using TwelveLabs and MongoDB Atlas involves two main steps:

1. Create embeddings for your video content and query.
2. Use the embeddings to perform a vector search in MongoDB Atlas.

**Code explanation**: Our blog post, [Building Semantic Video Search with TwelveLabs Embed API and MongoDB Atlas](https://www.twelvelabs.io/blog/twelve-labs-and-mongodb), guides you through the process of creating a video search application, from setup to performing vector searches.

**Colab Notebook**: [TwelveLabs-EmbedAPI-MongoDB-Atlas](https://colab.research.google.com/drive/11f6LZVRtq2DpGuo6eWk4mbgjyNHfv-EY?usp=sharing)

# Integration with TwelveLabs

This section describes how you can use the [TwelveLabs Python SDK](https://github.com/twelvelabs-io/twelvelabs-python) to create embeddings for semantic video search. The integration involves creating two types of embeddings:

* Video embeddings from your video content
* Text embeddings from queries.

These embeddings form the basis for vector search operations.

## Video embeddings

The code below creates a video embedding task that handles the uploading and processing of a video. It periodically checks the status of the task and retrieves the embeddings upon completion:

**`Python`**

```python Python
# Create a video embedding task for the uploaded video
task = tl_client.embed.task.create(
    engine_name="Marengo-retrieval-2.7",
    video_url="your-video-url"
)
print(
    f"Created task: id={task.id} engine_name={task.engine_name} status={task.status}"
)

# Monitor the status of the video embedding task
def on_task_update(task: EmbeddingsTask):
    print(f"  Status={task.status}")

status = task.wait_for_done(
    sleep_interval=2,
    callback=on_task_update
)
print(f"Embedding done: {status}")

# Retrieve the video embeddings
task_result = tl_client.embed.task.retrieve(task.id)
```

For more details, see the [Video embeddings](/docs/guides/create-embeddings/at-scale/video) page.

## Text embeddings

The code below creates a text embedding for the query provided in the `text` parameter:

**`Python`**

```python Python
# Create a text embedding task for the text
embedding = tl_client.embed.create(
  engine_name="Marengo-retrieval-2.7",
  text="your-text"
)

print("Created a text embedding")
print(f" Engine: {embedding.engine_name}")
print(f" Embedding: {embedding.text_embedding.float}")
```

For more details, see the [Embed a query](/docs/guides/create-embeddings/query) page.

# Next steps

After reading this page, you have the following options:

* **Customize and use the example**: Use the [TwelveLabs-EmbedAPI-MongoDB-Atlas](https://colab.research.google.com/drive/11f6LZVRtq2DpGuo6eWk4mbgjyNHfv-EY?usp=sharing) notebook  to understand how the integration works. You can make changes and add more functionalities to suit your specific use case.
* **Explore further**: Try the [applications built by the community](/docs/resources/from-the-community) or our [sample applications](/docs/resources/sample-applications) to get more insights into the TwelveLabs Video Understanding Platform's diverse capabilities and learn more about integrating the platform into your applications.