2 Commits

Author SHA1 Message Date
e31eb49d5a Add auto-cleanup of old unannotated events
🧹 New features:
- Background thread cleans up old events automatically
- Deletes unannotated events older than EVENT_EXPIRY_HOURS (default: 2h)
- Also removes associated snapshot files
- Runs every CLEANUP_INTERVAL_MINUTES (default: 5m)

📡 New endpoint:
- POST /cleanup - Manually trigger cleanup

⚙️ Config (env vars):
- EVENT_EXPIRY_HOURS: How long to keep unannotated events (default: 2.0)
- CLEANUP_INTERVAL_MINUTES: How often to run cleanup (default: 5.0)

Annotated events are kept forever 🦊
2025-12-16 19:40:44 -06:00
ae2bd94006 Add event collector and MCP query tools
🗄️ New collector/ component:
- collector.py: FastAPI service receiving events from cameras
- SQLite database for event storage
- Snapshot images saved to disk by date
- launchd setup script for macOS

🔍 New MCP tools in vision_mcp.py:
- vision_get_events(): Query events with filters
- vision_get_event_snapshot(): View event image inline
- vision_annotate_event(): Add meaning + tags to events
- vision_event_stats(): Database statistics

📡 Complete flow:
Pi detects motion → POST to collector → stored in DB
Vixy queries events → views snapshots → annotates

Ready to deploy! 🦊
2025-12-16 16:28:07 -06:00