Define persistent spatial rules backed by DuckDB SELECT queries. When conditions are met — assets entering a hazard zone, sensor readings exceeding thresholds, or resource counts dropping below minimums — the system fires CoT broadcast alerts automatically at configurable intervals.
Tactical AI DuckDB's Proactive Alert Service continuously evaluates user-defined spatial rules against the live DuckDB data store. Each rule is a SELECT-only DuckDB query that returns rows when a condition is triggered. When results are found, a CoT broadcast is fired and the alert is logged.
An incident commander defines a rule: “Alert me if any tracked vehicle enters within 500 meters of the active fire perimeter.” The rule is stored in DuckDB and evaluated every 5 minutes using DuckDB Spatial's ST_DWithin function. The first vehicle breach automatically fires a CoT alert to all ATAK clients on the network.
Alert rules are stored in the proactive_alert_rules DuckDB table. Each rule has a name, a SELECT-only SQL query, an evaluation interval, and a CoT type. Rules can be created, listed, triggered manually, and deleted via the AI agent or the widget UI.
All alert rule queries are validated by the SELECT-only guard in the DuckDB service before persistence. Queries containing INSERT, UPDATE, DELETE, DROP, CREATE, ALTER, or ATTACH statements are rejected. This prevents accidental or malicious data modification through the alert rule system.
| Rule Example | Data Source | Alert Type |
|---|---|---|
| Fire perimeter within 2km of community | nifc_fire_perimeters + census_places | Evacuation warning |
| Gauge reading exceeds flood stage | usgs_gauge_readings | Flood alert |
| Available resources drops below 10 | ics_resource_status | Resource request |
| Vehicle tracks in restricted area | track_data + restricted_zones | Intrusion alert |
manage_alert_ruleAlert rules can be created and managed entirely through the AI agent. Operators describe conditions in natural language; the agent composes the DuckDB SQL query, sets appropriate parameters, and registers the rule.