Open-source visual memory

Give agents the scene, not the whole stream.

Sight Cache turns RTSP camera history into compact contact sheets and short video segments, then lets AI agents inspect the exact evidence they need through protected MCP tools.

Self-hosted on your Cloudflare account

One hour becomes six quick, inspectable contact sheets.

From camera to context

Keep the evidence. Reduce the looking.

Agents start with a compact hour-level overview, narrow in on a suspicious minute, compare the frames that stand out, and retrieve an original or short video only when it adds useful evidence.

  1. 01

    Capture near the camera

    One FFmpeg process turns one RTSP input into five-second JPEG samples and approximately 30-second H.264 MP4 segments; source GOP and bitrate settings must keep each segment within 60 seconds and 64 MiB.

  2. 02

    Store originals at the edge

    The Ingest Worker authenticates each device and streams raw JPEG or MP4 uploads to R2 after validating their metadata.

  3. 03

    Summarize complete windows

    A scheduled queue builds hourly sheets; minute sheets are built on demand after a five-minute finalization delay.

  4. 04

    Inspect through MCP

    The Image Worker exposes protected frame tools and five-minute signed URLs for short video playback ranges.

Seven core tools, one optional

Move from overview to exact evidence.

The inspection path stays deliberate. Scan contact sheets, find exact frames, compare what matters, then request metadata or five-minute URLs for only the short video ranges you need.

  • list_devicesFind active cameras and time zones
  • get_contact_sheetReview a minute or hour
  • list_framesLocate exact captures
  • list_video_segmentsPage through up to one hour of video metadata
  • get_video_segmentsPlay a range of up to 30 seconds
  • get_frame_comparison_sheetCompare 2–10 frames side by side
  • get_original_frameRetrieve unmodified evidence
  • create_original_frame_downloadsShare up to 20 originals when enabled
// No inline MP4 or key field; the signed URL contains the object path
{
  "deviceName": "front-entry",
  "beginAt": "2026-09-13T10:42:00Z",
  "endAt": "2026-09-13T10:42:20Z",
  "expiresAt": "2026-09-13T10:47:30Z",
  "count": 1,
  "segments": [
    {
      "startedAt": "2026-09-13T10:41:58Z",
      "endedAt": "2026-09-13T10:42:28Z",
      "videoCodec": "h264",
      "audioCodec": "aac",
      "playbackUrl": "https://signed-r2-url.example/..."
    }
  ]
}

A small, separated system

Each service does one clear job.

Capture stays close to the camera. Storage and processing run on Cloudflare. Inspection remains behind your Access policy.

At the camera

One RTSP connection and FFmpeg process spool decoded JPEG samples and packet-copied H.264 segments.

  • Node.js
  • FFmpeg
  • Docker

On Cloudflare

Three Workers authenticate, store original frames and video, summarize frames, schedule, and serve camera history.

  • Workers
  • D1
  • R2
  • Images
  • Queues
  • Cron

With the agent

Any compatible MCP client can inspect frames and short video ranges through a stateless endpoint.

  • MCP
  • Managed OAuth

Private footage stays deliberate

Protection is part of the pipeline.

Sight Cache provides the controls, while you retain ownership of the account, Access policies, storage lifecycle, and every camera credential.

  • Protect admin and MCP routes with matching Cloudflare Access applications.
  • Store token hashes only; complete collector tokens appear once when issued.
  • Use three-day R2 lifecycle rules for frames, video segments, and contact sheets.
  • Treat signed URLs as bearer credentials; they expose the R2 bucket/object path; video links expire after five minutes, while optional frame downloads expire after 30.

Bring one camera online

Start with the repository and a clear retention plan.

Provision the Cloudflare resources, deploy the three Workers, then run one collector near each RTSP camera. The guides document every binding and environment value.

  • Node.js 24.19+
  • FFmpeg or Docker
  • Cloudflare Workers Paid

Clone the project

git clone https://github.com/catwithlover/sight-cache.git

  1. 1
    Provision D1, R2, Queues, Images, and two Access applications.
  2. 2
    Configure and deploy the Admin, Ingest, and Image Workers.
  3. 3
    Create a device, save its one-time token, and start the collector.