Track entities across videos
This recipe shows you how to follow a subject across multiple videos and build a chronological timeline of appearances. The response includes timestamps, video references, locations, and context for each sighting, ready for your tracking dashboard or analysis pipeline.
Note
Cross-video entity tracking is in research preview. Behavior and accuracy may change as the feature develops.
Use cases:
- Security investigations: Track a person across multiple camera angles or footage sources
- Timeline construction: Build a chronological record of a subject’s appearances
- Content auditing: Identify every moment where a specific entity appears in a collection
Key concepts
- 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.
- Instructions: Additional guidance that shapes Jockey’s behavior for a specific domain or task.
- Structured output: A JSON schema you provide with your request. Jockey constrains its output to match your schema, so you retrieve machine-readable results instead of plain text. For a guide on designing schemas and parsing responses, see the Structured output page.
Workflow
This recipe combines three elements: a JSON schema that defines the appearance data structure, instructions that give Jockey a specific role and domain guidance, and a prompt that describes the subject to track. Jockey reasons across your knowledge store and returns structured tracking results. You can then continue the conversation using the session identifier from the response. For example, drill into a specific appearance or ask about the surrounding context. You can adapt this recipe to track different subjects or focus on different appearance details.
Prerequisites
- You’ve already created a knowledge store with at least one item in
readystatus. See the Quickstart page for details. - You’re familiar with the request and response format. See the Create a response page for details.
Complete example
Copy and paste the code below, replacing the placeholders surrounded by <> with your values.
Code explanation
Python
Node.js
Track the subject
Search the collection for the subject and return a structured timeline of appearances.
Function call: You call the responses.create method with tracking instructions, a prompt, and a text parameter that describes your timeline schema.
Parameters:
knowledge_store_id: The unique identifier of the knowledge store to search.input: An array of input items. Each item is a message you send to Jockey. This example describes the subject to track and requests a chronological timeline.instructions: A per-request system prompt that shapes Jockey’s behavior for a domain or task. This example uses a security analyst role that prioritizes temporal accuracy.text: An object that specifies the response format. To return structured JSON, set theformatfield: itsschema_field defines the structure the output must match, and itsnamefield identifies the schema. Design the schema to fit your use case; the inline comments in the example describe each field. For the schema rules, see the Structured output page.
Return value: An object of type ResponseObject. Read the session_id field to continue the conversation, and the output items for the timeline. The response also includes id, status, and usage.
Process the results
The text field of each content part in a message item of the output array is a JSON string that matches your schema. Parse it with json.loads(), then iterate the timeline array to read each appearance.
Refine with a follow-up turn
Continue the conversation with the session_id from the first response. Jockey retains the full context from the previous turn, so you can drill into a specific appearance without repeating the original prompt.
Function call: You call the responses.create method again with the session_id.
Parameters:
knowledge_store_id: The unique identifier of the knowledge store. Must match the store from the first request.session_id: The session identifier from the first response.input: An array of input items. Each item is a message you send to Jockey. This example asks for more detail about a specific timestamp.
Return value: An object of type ResponseObject. This turn omits the text parameter, so the text field of each content part in a message item is plain text. Read it directly.
Example response
The text field inside each content part is a JSON string that matches your schema. After parsing, a typical result looks like this:
Notes
- The
video_referencefield contains the asset identifier of the knowledge store item. - The
timestampfield is a range inMM:SS-MM:SSformat indicating when the appearance starts and ends. - If Jockey cannot find the subject in the collection (for example, because the footage does not contain a match or the subject description is ambiguous), it returns an empty array named
timelineand explains the result in thesummaryfield. - Jockey identifies subjects visually and does not match by voice.
- Each request tracks one subject. To track multiple subjects, make separate requests.
- Tracking accuracy depends on video quality, camera angles, lighting, and how distinctive the subject appears.
Variations
Change the instructions and prompt to adapt this recipe for different tracking scenarios.
- Change the analytical perspective: Set the
instructionsparameter to “documentary researcher” or “video editor” for different emphasis. - Track objects instead of people: Change the prompt to track a vehicle, branded object, or recurring visual element.
- Multi-episode tracking: Track a recurring character or subject across an episode series.
See also
- Extract entities - list all entities before deciding which to track
- Structured output - more on JSON Schema responses
- Multi-turn sessions - more on continuing conversations
- Create a response - API reference for the Responses endpoint