2026 · ACTIVE · BUILD
ContextGuard
A webcam that reasons about context instead of shouting at motion
- Python
- YOLO26n
- ByteTrack
- SQLite
- FastAPI
- Streamlit
- SmolLM2
- Docker
ContextGuard turns an ordinary laptop webcam into a context-aware physical-security sensor. It detects and tracks people, reasons about where they are and how long they linger, scores the situation with an explainable risk engine, records structured events to a local SQLite store, and writes a grounded natural-language narrative for each one.
The design is built on three commitments. Context over detection: an alert is a function of zone, time of day, dwell time, repeat visits and transition patterns, not just the existence of a bounding box. Explainable, evaluable risk: three risk approaches share one feature set and one output shape so they can be compared fairly against three naive baselines. Privacy by construction: anonymous tracking is the default, no cloud LLM sits in the default path, and retention is actually enforced.
It is scoped honestly — a dorm room, a server rack, a home office. Not a surveillance product.
Problem
Most "AI security camera" projects stop at *a person is on screen* and fire an alert. That is noisy, context-free, and — because it usually ships frames to a cloud model — a privacy problem.
Question
Can a single laptop webcam produce alerts that a human could independently verify with a clock and a stopwatch, without a GPU, without the cloud, and without retaining video?
Approach
Separate detection from judgement. Detection is a tracker. Judgement is a swappable risk engine over verifiable context signals — which zone, what time, how long, how often, which transition. The narrator then describes the event in plain English and a hallucination checker refuses any sentence the event record does not support.
System
Open any stage to see what it does.
Demo
Streamlit dashboard runs the live camera view, zone editor, and event feed. The FastAPI service exposes the same event stream for integration. Both run from a single machine with no GPU.
Result
- Runs CPU-only. No GPU and no mandatory cloud dependency on the default path.
- Anonymous tracking by default; no thumbnails stored unless explicitly opted into; retention enforced by a scheduled purge.
- The repository reports 81 passing tests and CI running on every push.
- Project status is declared alpha by its own README — a research and small-deployment tool, not a product.
81 tests passing — Reported by the repository CI badge and test suite.
CPU-only inference — Stated hardware constraint of the project; no CUDA path exists.
Lesson
The hallucination checker was the part I expected to be a formality and it was not. Writing a checker forces you to define what the system is actually entitled to claim — and it turned out the honest answer was much narrower than the first draft of the prose. The narrator got quieter and the project got more trustworthy.
Source
Connected
- CausalGuard — Both are AI and SYSTEMS work, and both are built with Python, FastAPI, Docker.
- CodeRelay — Connected through AI and SYSTEMS.
- TeleFlow — Both are SECURITY and SYSTEMS work, and both are built with FastAPI, Docker.
- Epistemic Guard — Connected through AI and SYSTEMS.