> For the complete documentation index, see [llms.txt](https://docs.eyepop.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eyepop.ai/platform/temporal-context.md). Agents can also search and read this documentation through its [MCP server](https://docs.eyepop.ai/~gitbook/mcp).

# Temporal Context in Videos

Run cheap analysis on every frame and deep analysis only where it matters

A video is mostly repetition. A car crossing a drive-through lane is in view for a few hundred frames, and every one of them shows the same car. Asking a vision-language model for its make and model on each frame costs a large context and extensive token consumption for one answer — and most of those frames show the car blurred, half out of view, or from the wrong angle.

**Temporal context** splits a Pop's work in two:

1. **Efficient components run on every frame, in real time.** [Inferred](https://docs.eyepop.ai/platform/pop/pop-components/inference.md) classification, detection, and [tracking](https://docs.eyepop.ai/platform/pop/pop-components/tracking.md) are fast enough to keep up with a live stream. Together they build a running picture of what is in the scene, which object is which, how long each one has been there, and how well each frame shows it.
2. **Deep analysis runs only on the frames or snippets that are worth it.** EyePop manages that context and uses it to pick the most relevant moments. The expensive stages — a vision-language model, generating SOTA embeddings, OCR, action detection — run once on those moments instead of on every frame.

<figure><img src="https://1072321683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDoCvfjveqiJFmk0cnXCp%2Fuploads%2Fgit-blob-ad234ec5e4dc1b4ed803943d2f3e326e3c438596%2Ftemporal-context-diagram.svg?alt=media" alt="A live stream or video feeds a real-time pipeline that detects, tracks and classifies every frame and returns live predictions. The pipeline fills a temporal context of tracked objects over time, where each frame shows the object more or less clearly. A relevancy step picks each object&#x27;s best moment and sends only that to a deep analysis pipeline, such as a VLM or face-ID, which returns insights per object a little later."><figcaption><p>The real-time pipeline sees every frame; deep analysis sees only each object's best moment.</p></figcaption></figure>

The result is a Pop that watches all of a stream but pays for deep analysis per *object or event instance*, not per *frame*, and gets that analysis on the clearest view the stream offered.

Temporal context applies to **live streams** and **prerecorded videos** alike. A single image has no time axis, so there is nothing to select from.

### How it fits into a Pop

Nothing new is needed on the efficient side: it is the detector and `tracking` component a Pop already uses for video. The selection happens on the tracking component's [forward](https://docs.eyepop.ai/platform/pop/pop-forwarding.md), through a **select operator**. Whatever the operator forwards to is the deep analysis.

### Next steps

* [Select Operators](https://docs.eyepop.ai/platform/temporal-context/select-operators.md) — how a select operator picks a frame, and what comes back
* [Example: Make and Model Insights from Car Drive-Bys](https://docs.eyepop.ai/platform/temporal-context/example-car-make-and-model.md) — a custom VLM ability, once per car
* [Example: Best Face-ID Vector from Walk-Bys](https://docs.eyepop.ai/platform/temporal-context/example-face-id-from-walk-bys.md) — one face-ID vector per person


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eyepop.ai/platform/temporal-context.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
