# SpatialTwin

- **Event:** [Gemini 4 Argon SF Hackathon](https://cerebralvalley.ai/e/gemini-4-argon-sf)
- **When:** Sun, Oct 25 at 9:00 AM – 10:00 PM (PDT)
- **Where:** San Francisco, CA
- **Team:** [Yahya Alhinai](https://cerebralvalley.ai/u/yhinai), [Charlie Gillet](https://cerebralvalley.ai/u/charlie_gillet)
- **GitHub:** https://github.com/charliegillet/SpatialTwin
- **Demo video:** https://drive.google.com/drive/folders/1VIInVhbEUeQziL6CCBjjv2Jmd3s0v239?dmr=1&ec=wgc-drive-%5Bmodule%5D-goto
- **Gallery:** https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/77

SpatialTwin: turn any building into a live evacuation twin in about a minute

Public deployed link: https://spatialtwin.alhinai.dev/

In an emergency, the posted evacuation map is fixed: it can’t tell you that the lobby is on fire and you should use the stairwell instead. SpatialTwin turns that map, or just a quick phone video of a space, into a live 3D digital twin that re-plans the way out the moment something goes wrong. People can then see the safe routes, and which doors to open or close.

1 · Build. You show SpatialTwin a building in one of four ways: a photo of the posted evacuation map, a hand-drawn sketch, a PDF floor plan, or a walkthrough video filmed on your phone. Gemini 4 Argon reads it live, and you watch its reasoning stream in. A map becomes rooms, doors and exits. A video becomes an estimated 3D model of the space: walls, glass partitions, open atriums, railings, doors, windows and every piece of furniture, coloured to match the video. A deterministic local compiler then turns the reading into a building our planner can use, and graph checks verify it: every room must reach an exit, every door must sit on a shared wall, every exit on an outside wall. If a drawn map fails the checks, Argon gets one critique round to fix its own reading. You review the evidence (the overlay on your photo, or the video’s keyframes), optionally rearrange the furniture, mark up to three doors as motorized, and press Accept.

2 · Break it. Drop fire, smoke, gas, chemical or water anywhere in the building. Doors next to the hazard close to entry, exits inside it turn red, and the routes re-plan instantly. A local door planner tries every state of the motorized doors, solves and checks each one, and picks the best checked plan. It also writes a plain-language announcement for responders. Judges can join from their own phones: scanning a QR code turns a phone into a live exit sign that flips between a green arrow and a red X, and another QR code lets anyone drop hazards from their phone.

3 · Agents, checker, approval. A team of Gemini managed agents stress-tests the plan in Google’s cloud. A strategist proposes improvements while a robustness agent runs our solver kit in a network-disabled sandbox, trying faults like a jammed door. Every number an agent claims is re-run by our local checker before it’s shown. Only a person’s Approve moves a door, and a door only counts as open when its endpoint confirms it. If a door jams, the twin falls back to the checked backup plan.

Why you can trust it. AI proposes, a local checker decides, and a person approves anything that changes state. Every source is labelled (live Gemini, saved run, local solver or simulated), and a failed live call never quietly becomes canned data. Every occupant is accounted for in every frame of every plan. The figures are modeled crossings of simulated occupants, never survival claims.

What we verified live. Argon read photos of the venue’s own posted evacuation maps (its critique round took one reading from 16 check errors to 0 before Accept). It turned a lobby walkthrough video into a two-room model with a glass partition, an atrium and furniture in under a minute. The two-agent team re-ran its claims through the checker and reproduced all of them.

Built with. Gemini 4 Argon (Interactions API, structured output, multimodal photo, PDF and video understanding, streamed thought summaries), Gemini managed agents, FastAPI and SQLite, React 19 with three.js / React Three Fiber, Shapely and ffmpeg.

## More from Gemini 4 Argon SF Hackathon

- [Plot Twist](https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/74)
- [eagle.](https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/75)
- [Berkeley Bunch](https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/76)
- [WaymoWorld](https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/78)
- [Simcity_Builtit_Agent](https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/79)
- [Veritas](https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/80)

---

Markdown version of https://cerebralvalley.ai/e/gemini-4-argon-sf/hackathon/gallery/77. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
