Onics

  • AI multi-agent system that transforms CAD building plans into FKS-compliant fire department orientation plans in minutes, not weeks.

Links

 Presentation

Video

Repositories

Architecture Diagram

Live Demo URL

Inspiration

Every year, firefighters enter buildings blind. In Switzerland alone, over 150,000 commercial buildings require fire department orientation plans — and the new FKS national standard (August 2024) just raised the quality bar for the first time across all cantons. Yet creating these plans is still a brutal manual process: CAD technicians spend 2–4 weeks per building stripping furniture, dimensions, and annotations from architect plans, manually adding fire safety symbols, color-coding escape routes, and generating legends. Each building costs CHF 1,000–6,000. Biennial reviews multiply the pain.

We looked at this and saw a paradox: the process follows clear, deterministic rules — yet thousands of skilled hours are wasted on mechanical work. The FKS guideline tells you exactly what colors to use, what symbols to place, what to remove. This is precisely the kind of structured transformation where AI agents excel. When we discovered that no existing solution — not FireQuest, not PLANX!, not any AI floor plan company — automates this end-to-end, we knew we had found a genuine blue-ocean opportunity at the intersection of computational geometry and generative AI.

The Siemens challenge gave us the perfect frame: take raw CAD plans and produce fire-department-ready output. We decided to go further — not just automate the conversion, but build an intelligent fire safety platform with real-time simulation, voice-controlled copilot, and collaborative editing. Because fire safety isn't just about compliance documents. It's about saving lives.

What it does

ONICS transforms raw CAD building plans (DWG/DXF) into complete, FKS-compliant fire department orientation plans using 8 specialized AI agents — in minutes instead of weeks.

Upload a floor plan and watch it happen in real-time:

The system parses DXF geometry, classifies CAD layers using semantic AI understanding (handling the chaos of "A-WALL-INT" vs "Wände_200mm" vs "ARCH_W"), detects room boundaries through computational geometry, and classifies each room's function — office, corridor, stairwell, storage — using geometric features combined with Gemini 3.1 Pro reasoning. The output is a fully standards-compliant orientation plan with dark green escape routes, proper VKF symbols, detector group color coding, legend, cover sheet, and scale bars — all per the Swiss FKS guideline.

But ONICS doesn't stop at document generation:

  • Fire spread simulation — click any room to ignite a virtual fire and watch it propagate through the building in real-time using cellular automata. Fire doors resist based on their T30/T90 rating. Evacuation paths light up green with animated occupant dots flowing toward exits. A countdown shows: "Floor 2 evacuation complete: 2 min 34 sec."
  • Voice-controlled AI copilot — powered by Gemini Live API with native audio, fire commanders can ask questions hands-free: "Show me the nearest exit from room 204." The floor plan highlights the path while the AI speaks directions. Function calling triggers real actions on the plan mid-conversation.
  • 3D building visualization — programmatic extrusion of 2D floor plans into interactive Three.js 3D models, color-coded by fire compartment with animated evacuation route paths.
  • Real-time collaborative editing — multiple fire officers annotate the same plan simultaneously with Figma-like cursors and role labels, powered by Yrs (Rust CRDT) synchronization.
  • Automated compliance reports — AI-generated PDF reports with per-room risk scores, compliance status, and executive summaries citing specific FKS guideline sections.
  • Map-based portfolio view — all buildings on an interactive map with Google Photorealistic 3D Tiles, showing compliance status at a glance.

How we built it

Frontend: Next.js with Bun runtime, TypeScript, and CSS Modules. Geist variable font for typography. All icons are custom SVG components — zero icon library dependencies. Three.js for 3D building visualization. React-konva for the fire simulation canvas.

Backend: Rust for maximum performance on real-time communication. WebSockets for bidirectional frontend data streaming. gRPC for high-speed internal communication between the Rust backend and the Python AI service. WebRTC for peer-to-peer collaborative editing. Webhooks for event triggers on pipeline completion.

AI (the core): Python with Google Agent Development Kit (ADK) orchestrating 8 specialized agents:

  • Floor Plan Analyzer (Gemini 3.1 Pro vision) — multimodal analysis of DXF data + rendered images simultaneously
  • Fire Safety Code Agent (Gemini 3 Flash + RAG) — compliance validation against FKS/VKF Swiss standards
  • Risk Assessment Agent (Gemini 3.1 Pro) — room-by-room hazard classification and fire load scoring
  • Report Generator (Gemini 3 Flash) — AI-written compliance narratives per room
  • Voice Copilot (Gemini Live native audio) — real-time voice Q&A with function calling
  • Image Generator (Imagen 4 Ultra) — photorealistic building renders for reports
  • Video Generator (Veo 3.1) — AI evacuation walkthrough videos with native audio
  • Quick Visualizer (Nano Banana 2) — fast annotation overlays and image editing

ADK's ParallelAgent runs independent analyses concurrently while SequentialAgent chains dependent steps. The agent pipeline progress is visible in the UI during processing — judges and users can see which agent is working and what it found.

CAD processing: Python ezdxf for DXF parsing and output generation. Shapely for computational geometry — polygonize() is the workhorse that converts wall segments into room polygons. NetworkX for room adjacency graphs and escape route validation via Dijkstra.

Database: PostgreSQL with a Rust data layer for plans, rooms, projects, and user data.

Infrastructure: Docker with per-repo Dockerfiles and a root docker-compose.yml. Terraform for infrastructure-as-code. Every repo has its own .env.example for security.

Collaborative editing: Excalidraw with Yjs integration. The secret weapon: Yrs (the Rust port of Yjs) runs natively in our Rust backend, handling CRDT synchronization over WebSockets via yrs-warp. This gives us Figma-level real-time editing performance.

Challenges we ran into

The layer naming chaos. DXF files from different architects have wildly inconsistent layer structures. One architect uses "A-WALL-INT-200", another uses "Wände_200mm", a third puts everything on "Layer 0." Regex matching handles common patterns, but we needed Gemini's semantic understanding as a fallback for the long tail of creative naming conventions. Building a robust classification chain — regex → embedding similarity → LLM reasoning → user override — took significant iteration.

Door gaps break everything. Shapely's polygonize() only returns closed polygons. Doors create gaps in wall lines, so rooms don't close. Our solution: identify door entities by block name patterns and geometric analysis, temporarily extend wall lines across door openings before polygonization, then restore the gaps in the output. Tuning the snap tolerance (0.1 drawing units) to handle CAD drafting imprecision without creating false connections was tricky.

Orchestrating 8 agents with different latencies. Gemini 3.1 Pro vision calls take 3–5 seconds. Gemini 3 Flash returns in under a second. The voice copilot needs sub-200ms responses. Designing the ADK agent graph to maximize parallelism while respecting data dependencies — and showing meaningful progress to the user throughout — required careful architecture. We ended up streaming partial results via WebSockets as each agent completes.

Making fire simulation feel real without real physics. Our cellular automata model runs in the browser at 60fps, but tuning spread probabilities, fire door resistance timing, and evacuation flow rates to produce visually convincing results took dozens of iterations. We validated against SFPE evacuation timing formulas to ensure our countdown timers are in the right ballpark.

The FKS color rules are surprisingly complex. No detector group color may repeat on a single plan sheet. This is essentially a graph coloring problem that depends on which detector groups share a sheet — not a simple lookup table. We implemented a greedy coloring algorithm on the detector group adjacency graph.

Accomplishments that we're proud of

8 distinct AI model deployments across five modalities — vision, text reasoning, native audio, image generation, and video generation — working together in a coherent multi-agent pipeline. This isn't a chatbot wrapper. Each agent has a specific role, and the orchestration is visible in real-time.

The voice copilot is magic. Saying "Show me the nearest exit from room 204" and watching the floor plan highlight a green path while the AI speaks turn-by-turn directions — with the ability to interrupt mid-sentence and ask a follow-up — feels like science fiction. Gemini Live API's native audio with function calling makes this possible without stitching together separate STT/TTS services.

Fire spread simulation creates genuine emotional impact. Clicking a room and watching fire consume a building floor while animated dots (people) race toward exits with a countdown timer — this viscerally communicates why fire safety matters. It's not just a feature; it changes how people think about the buildings they work in.

Shapely's polygonize() working on real-world CAD plans. The preprocessing pipeline (snap → node → close door gaps → polygonize → filter slivers) reliably extracts room polygons from messy, real-world DXF files. This deterministic geometry foundation means our room detection doesn't hallucinate.

Rust + Yrs CRDT backend delivering Figma-like collaborative editing performance. Multiple users see each other's cursors with role labels, editing the same fire plan in real-time with zero perceptible lag.

The full stack coherence. Next.js → Rust WebSockets → Python ADK agents → 5 Google AI models → PostgreSQL → Docker → Terraform. Every layer has a reason. Nothing is duct-taped. The real-time architecture means every user action streams through the entire stack in milliseconds.

What we learned

Multi-agent architectures are genuinely powerful — not just buzzwords. Google ADK's ParallelAgent and SequentialAgent abstractions handle complex workflows elegantly. The key insight: each agent should do one thing well with a specific model choice, not try to be a generalist. Gemini 3.1 Pro for deep reasoning, Gemini 3 Flash for fast routing, Gemini Live for voice — specialization beats a single model doing everything.

Computational geometry + LLM reasoning is a potent combination. Shapely handles the precision work (exact polygon coordinates, area calculations, adjacency detection). Gemini handles the judgment calls (is this long narrow space a corridor or a hallway? does this room's proximity to a stairwell make it an escape route?). Neither alone is sufficient. Together, they're unstoppable.

Real-time architecture changes everything about UX. Streaming agent progress via WebSockets — showing "Floor Plan Analyzer: detecting 47 wall segments..." then "Risk Assessment Agent: room 2.04 classified as high fire load (storage)" — transforms a black-box AI call into a transparent, trustworthy process. Users don't wonder what's happening; they watch it happen.

Voice interfaces for field operations aren't a gimmick. Fire commanders wear heavy gloves, carry equipment, operate in smoke. A voice-controlled AI that can query building data and trigger visual actions on a tablet screen isn't a nice-to-have — it's the only interface that works in the field. The Gemini Live API's native audio with function calling makes this practical for the first time.

Swiss fire safety regulations are more nuanced than they appear. The FKS guideline has rules within rules: color codes depend on function, which depends on classification, which depends on geometry AND usage AND adjacency AND fire alarm system programming. RAG over the guideline text was essential — no amount of prompt engineering replaces grounding in the actual standard.

What's next for ONICS

Siemens Building X integration. Connect to Siemens' Fire Apps and Fire API for live sensor data from Cerberus PRO and Desigo Fire Safety systems. Real-time smoke detector status, heat sensor temperatures, and sprinkler pressure feeding directly into the digital twin.

IFC/BIM model support. Move beyond DWG/DXF to accept Industry Foundation Classes (IFC) models, unlocking the full 3D building information model with material properties, structural data, and MEP systems — dramatically improving fire load assessment accuracy.

International standards. Extend beyond Swiss FKS to support DIN 14095 (Germany), NFPA (US), and BS 5588 (UK). The multi-agent architecture makes this modular — swap the compliance agent's RAG corpus and the rules adapt.

Multi-language support. German, French, and Italian for all Swiss cantons. The voice copilot should understand and respond in all three national languages.

AR field overlay. Using WebAR, fire departments point a phone camera at a room marker and see 3D fire safety information overlaid on the real world — exit arrows, equipment locations, hazard classifications.

AI-powered safety recommendations. Move from reactive compliance checking to proactive suggestions: "Adding a fire door between room 2.04 and the corridor would reduce evacuation time by 40 seconds and create a compliant fire compartment."

Building portfolio analytics. Dashboard showing fire safety compliance across hundreds of buildings for property management companies and municipal fire departments — with AI-prioritized renovation recommendations.

Share this project:

Updates