Komşu — the Agent Upstairs Neighbor

Komşu — the Agent Upstairs Neighbor

An AI agent that turns any ordinary CCTV camera into a watchful neighbor. It sees the scene, reasons about what matters, and acts on its own to keep you informed — in Turkish, over WhatsApp, Telegram and the web.


Why it's an agent, not just a camera app

Most "smart camera" tools are passive — they record, maybe run a fixed detector. Komşu closes the full perceive → reason → act loop and holds standing goals on your behalf:

The watch feature is the clearest expression of agency: the operator hands over a goal in plain language, and the system autonomously pursues it until it's met or expires — no rules to configure, no dashboards to watch.


What it does


Architecture

One Gemini call per scene does triple duty — description + danger detection + watch evaluation — through a single structured-output schema, keeping free-tier quota under control while the agent stays responsive.

``` RTSP camera ─ffmpeg─▶ MJPEG ─▶ motion (grid diff) ─▶ [cooldown] ─▶ one Gemini call │ ┌─────────────────────┬──────────────────┴────────────────┐ ▼ ▼ ▼ scene description danger alerts watch matches (SQLite event log) (WhatsApp template) (notify the requester)

web (live MJPEG + chat) · WhatsApp Cloud API (webhook) · Telegram (long-poll) └─ shared chat(): Q&A, image requests, watch commands ```


Engineering highlights


Privacy by design

The assistant is instructed to never identify individuals, describe faces, or read plates — referring to people only in general terms ("two people", "a person with a bicycle"). This keeps it aligned with KVKK/GDPR expectations for camera data; footage in the demo is used with the owner's permission.


Tech stack

Node.js · Express · Google Gemini (vision) · ffmpeg / RTSP · SQLite · WhatsApp Cloud API · Telegram Bot API · AWS EC2 · Caddy / Let's Encrypt

GitHub