How 2dydgh/agentic-fall-detection-system works
This is a real-time, multi-zone fall-detection and response system with a FastAPI backend and Next.js monitoring dashboard. Its main workflow ingests video and synchronized audio, detects falls, enriches incidents with scene context, assigns severity through one of four decision modes, and records or acts on the result. Medium- and high-severity incidents can also be dispatched to an asynchronous escalation agent. The graph preserves documented dashboard, ontology, and fusion capabilities; some links for unsampled API and UI details are supported only by the README.
Main entry points: graph.py Workflow Graph · page.tsx Monitoring Dashboard · main.py Stream Worker · decision_ontology.py Ontology Decision
Components 31
Input and Perception
- Stream Worker
api/main.py - Audio Extraction
agentic/audio/extractor.py - Pose Perception
agentic/nodes/perception.py - Audio Analysis
agentic/nodes/audio.py
Detection and Reasoning
- Scene Analysis
agentic/nodes/analysis.py - Workflow Graph
agentic/graph.py - Incident State
agentic/state.py - Rule and Attention
agentic/nodes/decision.py - LLM Decision
agentic/nodes/decision_llm.py - Ontology Decision
agentic/nodes/decision_ontology.py - Fact Mapping
agentic/ontology/facts.py - Rule Inference
agentic/ontology/engine.py - Incident History
agentic/ontology/history.py - Fusion Features
agentic/fusion/feature.py - Attention Model
agentic/fusion/model.py - Fusion Dataset
agentic/fusion/dataset.py - Fusion Training
agentic/fusion/train.py
Incident Response
- Response Actions
agentic/nodes/action.py - Async Dispatcher
agentic/agent/runner.py - Escalation Agent
agentic/agent/escalation_agent.py - Agent Tools
agentic/agent/tools.py
API and Persistence
- Incident Store
agentic/tools/db.py - HTTP API
api/main.py
Monitoring Dashboard
- Monitoring Dashboard
frontend/src/app/page.tsx - Camera Grid
frontend/src/components/CameraGrid.tsx - Incident Views
frontend/src/components/IncidentsPage.tsx - Analytics View
frontend/src/components/AnalyticsPage.tsx - Ontology Simulator
frontend/src/components/OntologyPage.tsx - Pipeline View
frontend/src/components/ArchitecturePage.tsx
Other components
- Video and Audio
- Care Operator
Connections 35
- Video and Audio → Stream Worker: supplies frames
README.md - Stream Worker → Audio Extraction: extracts audio
api/main.py - Stream Worker → Workflow Graph: invokes per frame
api/main.py - Audio Extraction → Audio Analysis: provides chunks
agentic/audio/extractor.py - Workflow Graph → Pose Perception: runs first
agentic/graph.py - Workflow Graph → Audio Analysis: runs next
agentic/graph.py - Workflow Graph → Scene Analysis: routes fall context
agentic/graph.py - Workflow Graph → Rule and Attention: selects mode
agentic/graph.py - Workflow Graph → LLM Decision: selects mode
agentic/graph.py - Workflow Graph → Ontology Decision: selects mode
agentic/graph.py - Workflow Graph → Response Actions: runs response
agentic/graph.py - Ontology Decision → Fact Mapping: maps state
agentic/nodes/decision_ontology.py - Ontology Decision → Rule Inference: requests inference
agentic/nodes/decision_ontology.py - Ontology Decision → Incident History: reads history
agentic/nodes/decision_ontology.py - Incident History → Incident Store: queries incidents
agentic/ontology/history.py - Rule and Attention → Fusion Features: extracts features
agentic/nodes/decision.py - Rule and Attention → Attention Model: predicts severity
agentic/nodes/decision.py - Attention Model → Fusion Features: uses features
agentic/fusion/model.py - Fusion Training → Fusion Dataset: loads data
agentic/fusion/train.py - Fusion Training → Attention Model: trains model
agentic/fusion/train.py - Response Actions → Incident Store: records incident
agentic/nodes/action.py - Response Actions → Async Dispatcher: dispatches escalation
agentic/nodes/action.py - Async Dispatcher → Escalation Agent: runs asynchronously
agentic/agent/runner.py - Escalation Agent → Agent Tools: calls tools
agentic/agent/escalation_agent.py - Stream Worker → HTTP API: serves streams
api/main.py - HTTP API → Incident Store: serves incident data
api/main.py - Care Operator → Monitoring Dashboard: monitors incidents
README.md - Monitoring Dashboard → HTTP API: requests monitoring data
README.md - Monitoring Dashboard → Camera Grid: renders cameras
frontend/src/components/CameraGrid.tsx - Camera Grid → HTTP API: loads video
- Monitoring Dashboard → Incident Views: shows incident records
README.md - Monitoring Dashboard → Analytics View: shows analytics
README.md - Monitoring Dashboard → Ontology Simulator: offers simulation
README.md - Monitoring Dashboard → Pipeline View: visualizes pipeline
README.md - Workflow Graph → Incident State: passes state
agentic/graph.py