Vespa - Multivector video retrieval with TwelveLabs and Vespa
Summary: This integration combines TwelveLabs’ Generate and Embed APIs with Vespa to create an efficient solution for semantic video search. It captures rich video content as multimodal embeddings and utilizes Vespa’s robust indexing and hybrid ranking capabilities to deliver precise and relevant search results.
Description: The process of performing a semantic video search using TwelveLabs and Vespa involves three main steps:
- Create summaries and keywords using the Generate API.
- Create multimodal embeddings for your video content using the Embed API.
- Deploy a Vespa application to index these embeddings.
- Use the embeddings to perform vector searches with hybrid ranking.
- Review the results.
Step-by-step guide: Our blog post, Multivector Video Retrieval with TwelveLabs and Vespa, guides you through the process of building a semantic video search solution.
Colab Notebook: video_search_twelvelabs_cloud
Integration with TwelveLabs
This section shows how to use the Generate and Embed APIs for creating video embeddings and metadata, which facilitate the efficient retrieval of relevant video segments.
Generate summaries and keywords
The code below uploads videos to an index and monitors the processing status:
See the Upload videos section for details.
Once the videos are processed, you can generate rich metadata using the /summarize
and /generate
endpoints. This code creates summaries and lists of keywords for each video to enhance search capabilities:
See the Generate text from videos for details.
Create video embeddings
The code below creates multimodal embeddings for each video. These embeddings capture the temporal and contextual nuances of the video content:
See the Create video embeddings section for details.
Create text emeddings
The code below generates an embedding for your text query:
See the Create text embeddings section for details.
Perform hybrid searches
The code below uses Vespa’s approximate nearest neighbor (ANN) search capabilities to combine lexical search (BM25) with vector similarity ranking. The query retrieves the top hit based on hybrid ranking:
Next steps
After reading this page, you have the following options:
- Customize and use the example: Use the video_search_twelvelabs_cloud notebook to understand how the integration works. You can make changes and add functionalities to suit your specific use case.
- Explore further: Try the applications built by the community or our 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.