How cosmo-wander-ai/cosmo-edge works
CosmoEdge is a C++ edge-video AI engine and application layer for deploying detection, VLM, and event workflows across Sophon, Rockchip, and x86. The principal workflow is configuring a task, running video through a platform-specific inference path, and exposing detections and alarms through application interfaces. The graph also retains model management, face-library queries, MQTT, storage cleanup, and observability as documented or tree-visible capabilities. Several runtime links are dashed because their connecting implementation was not sampled.
Main entry points: ApiRouterRoutes.cc API Routes · MessageFaceLibHandler_Query.cc Face Queries · TaskServiceQuery.cc Task Service · detection_pipeline.cc Detection Pipeline
Components 19
Application
- Web Console
src/web/src/main.js - API Routes
src/api/ApiRouterRoutes.cc - Face Queries
src/api/MessageFaceLibHandler_Query.cc
Video Workflows
- Task Service
src/service/task/impl/TaskServiceQuery.cc - Task & Channel
- Logic Evaluation
src/flow/logical/LogicCalcEngine.cc - Video Ingest
AI Inference
- Detection Pipeline
src/nn/pipeline/detection_pipeline.cc - Advanced Pipelines
src/nn/pipeline/advanced_pipeline.cc - Inference Backends
src/infer/RkllmVlmBackend.cc
Services & Events
- Model Management
src/service/model/impl/ModelServiceImpl_Query.cc - Face Library
src/flow/face/FaceManager.cc - Alarm Records
- MQTT Client
src/network/mqtt/MqttClient.cc - Person Persistence
src/db/PersonDaoQuery.cc
Operations
- Inference Metrics
src/nn/core/inference_pipeline_metrics.cc - Preview Metrics
src/media/PreviewPipelineMetrics.cc - Storage Cleanup
src/service/infra/impl/StorageSpace.cc
Other components
- Operator
Connections 19
- Operator → Web Console: configures · Inferred; not shown in the code that was read.
- Web Console → API Routes: sends requests · Inferred; not shown in the code that was read.
- API Routes → Task Service: dispatches tasks · Inferred; not shown in the code that was read.
- Task Service → Task & Channel: reads channels
src/service/task/impl/TaskServiceQuery.cc - Task Service → Alarm Records: queries alarms · Inferred; not shown in the code that was read.
- Task & Channel → Video Ingest: processes video · Inferred; not shown in the code that was read.
- Task & Channel → Detection Pipeline: runs inference · Inferred; not shown in the code that was read.
- Task & Channel → Advanced Pipelines: runs VLM · Inferred; not shown in the code that was read.
- Detection Pipeline → Inference Backends: uses backend · Inferred; not shown in the code that was read.
- Advanced Pipelines → Inference Backends: uses backend · Inferred; not shown in the code that was read.
- Task & Channel → Logic Evaluation: evaluates rules · Inferred; not shown in the code that was read.
- Logic Evaluation → Alarm Records: raises alarms · Inferred; not shown in the code that was read.
- API Routes → Face Queries: routes queries · Inferred; not shown in the code that was read.
- Face Queries → Face Library: queries libraries
src/api/MessageFaceLibHandler_Query.cc - Face Queries → Person Persistence: queries people
src/api/MessageFaceLibHandler_Query.cc - Task & Channel → MQTT Client: delivers events · Inferred; not shown in the code that was read.
- Detection Pipeline → Inference Metrics: records metrics · Inferred; not shown in the code that was read.
- Video Ingest → Preview Metrics: records preview stats · Inferred; not shown in the code that was read.
- Storage Cleanup → Alarm Records: queries records
src/service/infra/impl/StorageSpace.cc