Create a response
Research preview
Jockey is in research preview. Availability, limits, and API surface may change before general availability.
This guide shows how to upload videos and images, build a knowledge store, and generate an overview of your content. You can also extract and track entities, search your content, and organize it by theme.
Key concepts
This section explains the key concepts and terminology used in this guide:
- Asset: Your uploaded content. Once created, you can reference the same asset across multiple operations without uploading the file again.
- Knowledge store: A persistent store of your videos and images plus the understanding the platform derives from them — spatiotemporal context, a typed ontology, and embeddings — that together enable corpus-level reasoning.
- Knowledge store item: An asset added to a knowledge store. The platform processes each item asynchronously. When processing finishes, the item is ready for downstream tasks.
Workflow
Upload your videos and images as assets, then create a knowledge store. Add the assets to the knowledge store. The platform indexes the content asynchronously. When the items reach the ready status, generate a response from the knowledge store.
Prerequisites
-
To use the platform, you need an API key:
-
Depending on the programming language you are using, install the TwelveLabs SDK by entering one of the following commands:
-
Publicly accessible video or image URLs that point directly to media files. This quickstart demonstrates the URL upload method. For local file uploads, see the Upload content page.
-
Upload limits: Public video URLs up to 4 GB, local video files up to 200 MB, or images up to 32 MB. For local files up to 5 GB, see the Upload content page.
Starter code
Copy and paste the code below, replacing the placeholders surrounded by <> with your values. Adapt the query to match your content and what you want to learn from it.
Code explanation
Import the SDK and initialize the client
Create a client instance with your API key to interact with the platform.
Upload a video or an image
Upload a video or an image using a publicly accessible URL to create an asset. The same call handles both.
Check the status of the asset
Asset processing is asynchronous. Poll the status of the asset until it is ready before you use it.
Create a knowledge store
Create a knowledge store. You add the asset to it in the next step, and the platform indexes it.
Add the asset to the knowledge store
Add the asset to the knowledge store. This creates a knowledge store item that the platform indexes. Set the asset_type parameter to image when the asset is an image. It defaults to video.
Check the status of the knowledge store item
Check the status of the knowledge store item until it reaches the ready status. Indexing runs asynchronously and usually takes longer than the asset processing in step 3.
Generate a response
Generate a response from your videos and images through the Responses API. This example requests an overview of the main themes, key subjects, and patterns across your content. The platform searches, tracks entities, and reasons across the knowledge store, then returns a response, which this example prints to the standard output.
Next steps
- Create a response - the complete guide: generate responses from a knowledge store, customize Jockey’s behavior with instructions, and inspect its intermediate outputs
- Streaming - receive tokens in real time instead of waiting for the full response
- Structured output - receive typed JSON by providing a schema
- Multi-turn sessions - maintain conversation context across requests