Sign in →
CloudLab Works emblem: Waku the orca ringed by CloudLab and WorksCLOUDLAB WORKScrossed whale bones, one end a wrenchCloud City, headwaters of the agentic cloud revolution! Waku, the orca wearing a headset Ask Me

Invisible Wires: Agentic Cloud

Give an agent a camera without giving it a picture

· By Alex Alvord

Most questions you would put to a camera at a bench do not need a picture. Is anyone at the desk? Did something on the shelf move? Is the camera still alive? A person detector and a coarse depth map answer all three. A video feed answers them too, and also hands over everything else in the frame.

That is the idea behind oak-events: an agent should know what a camera sees without ever being handed a picture. It works with Luxonis OAK cameras, and it is open source under the MIT licence. CloudLab Works maintains it.

The whole system

An OAK camera has a chip that can run a neural network and compute stereo depth. oak-events uses that. The detecting, the tracking and the depth measuring all happen on the camera. The host receives detections and a depth map, turns them into events, and appends one JSON line per event to a file. A second process, an MCP server, reads those files and answers questions about them. Any MCP client can ask: Claude, OpenClaw, Home Assistant, or something you wrote.

oak-events system: camera, host events, JSON-lines files, MCP tools, agent
oak-events system: camera, host events, JSON-lines files, MCP tools, agent

Five stages, top to bottom in the order data moves:

  1. The camera runs person detection and tracking, and stereo depth, on its own chip.
  2. oak-events run on the host turns detections into person events per named zone, and the depth map into a depth-change grid. It also records camera health.
  3. JSON-lines files, one per local day, written with owner-only permissions.
  4. oak-events mcp, a stdio MCP server with three tools: recent_events, zone_state and camera_health. Each returns JSON text.
  5. Any MCP client or agent.

The MCP server only reads the files. It never opens the camera, so an agent that misbehaves cannot reach the device, and stopping the camera process does not take the question-answering side down.

What an event looks like

Every line has a timestamp, a kind and a few fields:

{"ts": "2026-10-11T09:14:03-07:00", "kind": "person_enter", "zone": "doorway", "count": 1, "nearest_mm": 1840}
KindWhat it says
person_enterA person was seen in three consecutive frames in a zone, with the distance to the nearest one
person_exitNobody seen for ten seconds, with how long they were there (dwell_s)
depth_baselineA baseline depth grid was built; noisy cells are marked and ignored
depth_changeA cell of the grid has been more than 15% closer or farther for a minute while nobody was present
cameraLifecycle: up, not found, error, reconnect, stopped
aliveA heartbeat with detection rate and whether the zone is occupied

Zones are named regions of the image, optionally limited by distance. Each zone gets its own tracker and its own depth grid. Depth-change detection pauses while a person is in the zone, because people are not scenery.

The privacy boundary

The second diagram shows what crosses each line, and what never does.

oak-events privacy boundary: what crosses from camera to host to agent, and what stays on the camera
oak-events privacy boundary: what crosses from camera to host to agent, and what stays on the camera

The defaults, stated so you can check them against the code:

Events still say something. They record when someone was present, for how long, how far from the camera, and when an object moved. Treat the event files as sensitive and keep them local.

When the cable comes out

A camera on a network drops sometimes. The tool finds the device by its id rather than an address, so a network change does not lose it. It keeps retrying discovery for a few minutes and asks the SDK to reconnect if the link drops, and the supervisor you run it under restarts it if it gives up. Every state change shows up as a camera event, so camera_health can tell an agent the difference between "quiet room" and "camera gone".

In a test, a pulled network cable recovered on its own in under a minute, without restarting the process.

What it does not do

oak-events is an independent community project. It is not affiliated with or endorsed by Luxonis. OAK and DepthAI are Luxonis trademarks, used to say which hardware and SDK it works with.

Try it

It is not on PyPI yet. Install from the GitHub repository:

uv tool install 'oak-events[camera,mcp] @ git+https://github.com/cloudlabworks/oak-events'

oak-events doctor

oak-events doctor checks the setup and works without a camera attached. Then fetch a detection model once, run the camera, and point an MCP client at the events directory. The README walks through each step, with a zones file and a client config.

If you try it with a camera, I'd like to hear what it did on your hardware. Issues and pull requests are open.

Comments

  1. Loading comments…

Comments are read by Alex before they appear. No email address needed; your name shows as you type it. See privacy.

← All posts

Ask Waku