Project Info
[OpenAI] Artificial Intelligence Track ([1st] Lunch with OpenAI engineers at the office + 1 year of ChatGPT Pro [2nd] 1 year of ChatGPT Pro [3rd] OpenAI swag)
ContainOS
Inspiration
The first three hours of a wildfire, the initial attack, are the most critical in determining whether the wildfire can be rapidly contained with minimal damage or whether a massive, multi-day operation is needed. Incident commanders on the ground must rapidly assess a fire, decide where to deploy crews and aircraft, and issue evacuation warnings as conditions evolve. Despite unprecedented access to satellite imagery, low earth orbit data, drone feeds, and AI-enabled cameras, responders still lack a unified system that synthesizes this information into actionable, real-time guidance. We built ContainOS to provide real-time, physics-grounded decision support for firefighters en route, reducing cognitive friction during high-pressure moments.
What it does
ContainOS transforms fragmented wildfire data into a unified decision-support platform for containment operations. It ingests wind, terrain, infrastructure, topography, and population data to generate structured insights and prioritized alerts about present and impending risks, enabling rapid triage decisions by incident commanders. Historical fire data is incorporated to surface relevant precedents and escalation patterns from past incidents. Beyond presenting base data through a streamlined, low-friction interface optimized for tablet use in the field, ContainOS generates prioritized alerts tied directly to the fire’s interaction with its surroundings. The system supports both online and offline operation and integrates proactive text-based alerting for first responders in low-connectivity environments, flagging immediate hazards such as downed powerlines or significant wind shifts.
How we built it
ContainOS combines deterministic wildfire physics with a feedback-aware multi-agent AI system. The system uses four coordinated GPT-4o reasoning agents that operate as a structured agent graph for fire behavior, risk assessment, notifications, and recommendations, alongside a Gemini-powered historical context component. All outputs pass through a deterministic validation layer. Before agent reasoning, the backend computes a deterministic physics state, conceptually forming a physics graph over the fire perimeter and nearby communities, from time-indexed environmental snapshots (wind, terrain, vegetation, infrastructure, fire perimeter, and population data). This includes: Baseline spread velocity Slope and fuel multipliers A deterministic threat level Community exposure using distance thresholds The frontend visualizes these dynamics per segment, rendering fast, moderate, and slow spread zones. On top of this physics baseline, the GPT-4o agents generate: Fire behavior analysis Infrastructure risk assessment A small, prioritized set of tactical alerts (1–5) A top containment recommendation with a 0–100 confidence score All outputs are validated against deterministic constraints. If an agent contradicts the physics baseline, the system injects structured feedback and re-runs the affected agents. The system allows up to three total attempts (initial generation plus two retries). If consistency cannot be achieved, it safely falls back with a confidence score of 0. Together, the physics state and agent reasoning form a constrained two-layer architecture, where probabilistic inference is bounded deterministically. This architecture prevents generative reasoning from overriding physical reality, converting AI into a bounded, constraint-validated system for high-stakes decision support. Challenges A core challenge was architecting a system where a deterministic physics pipeline and a multi-agent reasoning graph operate in lockstep. The physics layer establishes a non-negotiable baseline, while probabilistic agents generate structured assessments on top of it. Ensuring these layers remained aligned required explicit validation, constraint enforcement, and bounded retries. Rather than functioning as a linear AI pipeline, the system continuously reconciles agent outputs with computed physical state to preserve reliability under rapidly changing conditions. Another challenge was deploying AI into real operational workflows without introducing misplaced trust. In wildfire containment, recommendations affect evacuation timing, crew deployment, and infrastructure protection. We had to design the system so that AI assistance augments situational awareness without projecting unwarranted certainty, remaining transparent, bounded, and clearly subordinate to human judgment. Accomplishments We iterated directly with former CalFire leadership to refine alert prioritization, evacuation logic, and interface clarity based on real operational workflows. We built a feedback-aware, physics-constrained multi-agent system that enforces physically consistent, self-correcting reasoning in a high-stakes environment. By validating probabilistic agent outputs against a deterministic physics baseline and enforcing bounded retries with safe fallback behavior, the system prevents generative outputs from contradicting physical reality. This ensures recommendations remain consistent, explainable, and grounded in computed state. Most importantly, we demonstrated a practical framework for responsible AI in life-critical domains: generative reasoning explicitly constrained by deterministic physical models, structured validation loops, visible uncertainty through confidence scoring, and clear preservation of human authority in decision-making. This approach shows how AI systems can augment rather than replace expert judgment in safety-critical contexts.
What we learned
We learned that high-stakes AI systems must be explicitly bounded by deterministic constraints; generative outputs cannot be trusted without formal validation against physical reality. This is especially true in wildfire containment, where lives are at stake and operational decisions must remain grounded in computed state. We also learned the importance of iteratively reviewing our product with real users, for not only initial insights on user pain points but continuous alignment and redirection as needed. This project reinforced how modern AI systems can responsibly support public sector decision-making when deliberately constrained and purpose-built.
What's next
Ensuring ContainOS is useful in the field will require direct feedback from incident commanders. We hope to work with CalFIRE to extensively test and update this tool for eventual rollout across California and beyond, for real application in containing wildfires right when they start.
ContainOS
AI-Powered Wildfire Intelligence & Command System
A real-time multi-agent decision support system for wildfire incident command, combining deterministic physics calculations with coordinated AI agents to provide tactical recommendations, threat assessments, and automated alerts.
Quick Start
# 1. Setup environment
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY and GEMINI_API_KEY
# 2. Start backend (Terminal 1)
cd backend
python -m pip install -r requirements.txt
python main.py
# 3. Start frontend (Terminal 2)
cd frontend
npm install
npm run dev
# 4. Open http://localhost:5173
Prerequisites
- Node.js 18+ and npm
- Python 3.10+
- OpenAI API Key - Get one here
- Google Gemini API Key - Get one here
Overview
Command-and-control platform for wildfire incident commanders combining deterministic physics with coordinated AI agents.
Core Capabilities:
- Physics-grounded AI - Deterministic calculations validate all AI outputs; violations trigger automatic replanning
- Geographic historical memory - Gemini analyzes past fires from the same region to inform tactics
- Multi-agent orchestration - 7 coordinated components (physics + GPT-4o + Gemini + validator) analyze risk in real-time
- Closed-loop validation - Failed physics checks force agent replanning (max 2 retries)
- Interactive mapping - Leaflet visualization with fire perimeters, terrain, infrastructure
- Offline-first - Works without connectivity using cached data and IndexedDB
Architecture
Multi-Agent Pipeline
Live Fire Data
|
v
Graph Physics Engine
(deterministic calculations)
|
+---------------+---------------+
| |
v v
Historical Memory Physics Data
(Gemini 1.5 Pro) (spread, threat)
Finds regional fires |
| |
+---------------+---------------+
|
v
+---------------+---------------+
| |
v v
Fire Behavior Agent Risk Analysis Agent
(GPT-4o) (GPT-4o)
Physics + History Physics + History
| |
+---------------+---------------+
|
v
+---------------+---------------+
| |
v v
Notification Agent Recommendation Agent
(GPT-4o) (GPT-4o)
1-5 factual alerts 1 tactical action
| |
+---------------+---------------+
|
v
Validator
(physics constraint check + multi-turn retry loop)
|
v
Frontend Output
Agent Roles:
- Graph Physics Engine - Computes spread velocity, threat levels using deterministic formulas
- Historical Memory (Gemini) - Finds past fires in same region, provides learned tactics
- Fire Behavior (GPT-4o) - Analyzes spread patterns using physics + historical context
- Risk Analysis (GPT-4o) - Identifies threatened infrastructure using physics + history
- Notification (GPT-4o) - Generates 1-5 concise alerts (≤10 words each)
- Recommendation (GPT-4o) - Provides 1 tactical action (≤12 words), rationale, and confidence
- Validator - Enforces physics constraints; triggers replanning if violated (max 2 retries)
API Reference
Main Endpoint
POST /api/process-live-data/{time_index}- Process timestamped fire data (index: 1-5)- Returns: notifications + recommendation + computed physics + history summary
Data Endpoints
GET /api/data/all- Static map data (fire perimeter, terrain, infrastructure)GET /api/data/live/{time_index}- Timestamped live data (index: 1-5)GET /api/notifications?limit=20&offset=0- Agent-generated notificationsGET /api/recommendations/latest- Most recent recommendationGET /api/recommendations/all- All recommendationsGET /api/status- Notification/recommendation system statusPOST /api/reset-notifications- Clear notifications/recommendations in memoryPOST /api/analyze- Direct full analysis endpoint (request body required)GET /health- Health checkWebSocket ws://localhost:8000/ws- Real-time agent status streaming
Full docs: http://localhost:8000/docs
How It Works
Historical Context Integration
Geographic-first matching:
- System loads past fires from
historical_fires.json(behavior, tactics, resources) - Gemini prioritizes same region (e.g., Northern California), then matches wind/slope/vegetation
- Generates 3-sentence summary of how those regional fires behaved
- Context provided to Fire Behavior & Risk Analysis agents for informed predictions
Example output:
"The 2022 Canyon Creek Fire in Northern California exhibited rapid uphill spread through chaparral under 25mph NE winds on 30° slopes, requiring defensive positioning ahead of the fire front. Resources escalated 5x when fire reached chaparral belt, with dozer lines on ridgetops proving most effective."
Closed-Loop Validation
Physics engine establishes ground truth; AI outputs must comply or trigger replanning:
# Deterministic baseline
if slope > 20: threat = "CRITICAL"
if town_distance < 5km: threat = "CRITICAL"
# AI outputs "ELEVATED" → Validator rejects
# System forces replan:
# "Physics violation: deterministic calculates CRITICAL but you output ELEVATED. You MUST escalate."
# AI retries → outputs "CRITICAL" → Approved
Result: No AI hallucinations. All recommendations grounded in fire physics.
📁 Project Structure
containment/
├── backend/
│ ├── agents/
│ │ ├── orchestrator.py # Multi-agent coordination + physics engine
│ │ └── historical_memory.py # Gemini geographic matching
│ ├── data/ # Fire perimeter, terrain, historical fires (JSON)
│ ├── main.py # FastAPI endpoints + WebSocket
│ └── notification_manager.py # Stores agent outputs
├── frontend/
│ ├── src/
│ │ ├── components/ # FireMap (Leaflet), LayerControls
│ │ ├── services/ # API client
│ │ ├── offline/ # IndexedDB + Service Worker
│ │ └── App.jsx # Main UI
│ └── package.json
└── README.md
Environment Variables
Create .env in the project root for backend keys:
# Required
OPENAI_API_KEY=your_key_here # Multi-agent system (GPT-4o)
GEMINI_API_KEY=your_key_here # Historical memory (Gemini 1.5 Pro)
Optional frontend override in frontend/.env.local:
VITE_API_URL=http://localhost:8000
Tech Stack
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 19 + Vite + Leaflet | UI + interactive maps |
| Backend | FastAPI + Uvicorn | API server |
| AI Agents | GPT-4o + Gemini 1.5 Pro | Multi-agent reasoning + historical memory |
| Validation | Pydantic + Physics Engine | Type safety + constraint checks |
| Real-time | WebSockets | Live agent status streaming |
| Offline | IndexedDB + Service Worker | Network-first caching |
Development
Backend (http://localhost:8000)
cd backend && python main.py
# API docs: /docs | WebSocket: ws://localhost:8000/ws
Frontend (http://localhost:5173)
cd frontend && npm run dev
# Build: npm run build | Preview: npm run preview
Testing
# Health check
curl http://localhost:8000/health
# Process timestamped fire data (1-5)
curl -X POST http://localhost:8000/api/process-live-data/1
# Frontend: Verify map shows fire perimeter, notifications appear in sidebar
Offline-First Support
Features:
- Real-time connectivity detection with visual banner
- IndexedDB cache (network-first strategy with fallback)
- Service worker caches app shell + map tiles
- Write queue for offline requests (auto-replay on reconnect)
Test offline mode:
- Load app online, navigate map to cache tiles
- DevTools > Network > Enable "Offline"
- Verify offline banner appears, cached tiles still render
- Disable "Offline" → "Back online" toast appears
Contributing
Built for TreeHacks. Open issues for questions or bugs.
Resources: FastAPI | OpenAI Structured Outputs | Gemini API | Leaflet | NWCG Fire Behavior
Analysis
View
Metric
- 8
- 6
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- OpenAIIn code
- PythonIn code
- ReactIn code
- Google GeminiClaimed
- Node.jsClaimed
- VercelClaimed
8 of 11 appear in the indexed code. 3 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
190 KB
Source files
33
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
maanitg/containment
52 files · 315 KB · @ 97b52fe
Structure
Interface
5 files · 10%Screens, components and styles rendered to the user.
API & routing
1 file · 2%Request entry points: routes, handlers and controllers.
Application logic
28 files · 54%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- JavaScript55%
- Python18%
- Markdown15%
- CSS10%
- HTML2%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
frontend/package.json
npm · 14- @anthropic-ai/sdk
- leaflet
- react
- react-dom
- react-leaflet
- +9 more
backend/requirements.txt
pypi · 6- fastapi
- google-generativeai
- openai
- pydantic
- python-dotenv
- uvicorn[standard]
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.