Skip to main content
TwelveLabsTools enable an Agent to understand and search video using TwelveLabs. The toolkit exposes two capabilities: analyze_video, which answers a natural-language question about a video using the Pegasus video understanding model, and embed_text, which generates a multimodal embedding with the Marengo model that lives in the same latent space as TwelveLabs video, audio and image embeddings (useful for searching a video corpus by text).

Prerequisites

You need to install the twelvelabs library and an API key which can be obtained from the TwelveLabs dashboard.
Set the TWELVELABS_API_KEY and OPENAI_API_KEY environment variables.

Example

The following agent will use TwelveLabs to answer a question about a video and to generate a text embedding.
cookbook/91_tools/twelvelabs_tools.py

Toolkit Params

Toolkit Functions

Developer Resources