> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Video Agent

> Build an agent that operates the Video Datalake in natural language — with the lake as its long-term video memory.

A **Video Agent** is an LLM agent that operates the [Video Datalake](/datalake/quickstart) through the [MCP Server](/mcp-server). The **Datalake is its long-term video memory** — the agent ingests and indexes video, then searches and reads any moment on demand, in plain natural language, with no glue code.

<div style={{display:'flex',flexDirection:'column',alignItems:'center',gap:'0',margin:'24px 0 8px'}}>
  <div style={{width:'100%',maxWidth:'340px',padding:'11px 16px',borderRadius:'13px',border:'1px solid rgba(128,128,128,0.28)',textAlign:'center'}}>
    <div style={{fontWeight:600,fontSize:'14px'}}>Your agent</div>
    <div style={{fontSize:'11.5px',opacity:0.55,marginTop:'2px'}}>Claude · Cursor · your own LLM app</div>
  </div>

  <div style={{display:'flex',alignItems:'center',gap:'7px',fontSize:'11px',opacity:0.5,padding:'7px 0'}}><span style={{fontSize:'15px',opacity:0.7}}>↓</span> MCP Server · natural language → tools</div>

  <div style={{width:'100%',maxWidth:'340px',padding:'12px 16px',borderRadius:'13px',border:'1.5px solid rgba(79,107,230,0.5)',background:'linear-gradient(90deg,rgba(155,224,127,0.16),rgba(86,196,192,0.16),rgba(79,107,230,0.16),rgba(107,63,160,0.16))',textAlign:'center'}}>
    <div style={{fontWeight:700,fontSize:'14.5px'}}>Video Datalake — memory</div>
    <div style={{fontSize:'11.5px',opacity:0.62,marginTop:'2px'}}>index · search · read any moment</div>
  </div>
</div>

## Why the Datalake is the agent's memory

The Datalake turns raw video into **queryable derived content** — embeddings, captions, transcripts, entities, safety events. Instead of re-watching a video every turn, the agent **asks the lake in natural language and gets the exact moments back** — persistent, searchable memory that survives across sessions.

## What a Video Agent can do

<CardGroup cols={2}>
  <Card title="Build & query a library" icon="database">
    Ingest video → index → *"find where the forklift enters the aisle"* → read the caption and clip. `upload_video` → `wait_for_operation` → `search_moments` → `get_moment`.
  </Card>

  <Card title="Watch & alert on live" icon="signal-stream">
    Attach a live stream and fire when something matters — a goal, a safety event. `open_stream` + `list_events`.
  </Card>

  <Card title="Investigate what happened" icon="magnifying-glass">
    Combine moment search, the face library, and safety events to answer *"who was in the store at 2pm and what did they do?"*.
  </Card>

  <Card title="Summarize & extract" icon="list-check">
    Pull titles, summaries, speakers, and transcripts from any moment for reports or downstream models. `get_moment` with the fields you need.
  </Card>
</CardGroup>

## Build one

<Steps>
  <Step title="Connect the MCP Server">
    Add the [MCP Server](/mcp-server) to your agent (Claude Code, Codex, Cursor, or your own client) — sign in via the browser and the Datalake tools appear.
  </Step>

  <Step title="Give it a goal">
    Prompt in natural language. The agent picks and **chains** tools — e.g. `search_moments` → `get_moment`, or `upload_video` → `wait_for_operation` → `search_moments`.
  </Step>

  <Step title="Let the Datalake remember">
    Anything you `upload_video` stays indexed and searchable, so later turns (and later sessions) can `search_moments` without re-processing.
  </Step>
</Steps>

## Example

> *"Ingest yesterday's store-cam footage, then tell me every time someone entered the stockroom and clip those moments."*

The agent runs: `upload_video` → `wait_for_operation` → `search_moments` (query: *"person enters the stockroom"*) → `get_moment` (with `clip`) for each hit — and returns the clips.

## Bring your own framework

Not using MCP? Every capability is a plain REST call — point any agent framework at the [Datalake API](/overview) directly (`curl` / Python). The Datalake-as-memory pattern is the same: index once, search and read forever.
