Inspiration
CoStar keeps records on millions of buildings: what they're made of, how tall they are, who works inside. Over time those records drift. A tenant moves out, a retrofit gets finished, or the city lists a building as concrete while the record says masonry. Fixing that needs a person to go and look, and there will never be enough people to check every building by hand.
So we asked a simple question: what if checking a building was actually fun? After an earthquake, LA's inspectors walk up to buildings and tag them green, yellow or red. That already felt like a game. We built it, and put a real AI analyst behind it.
What it does
You play Bob, a building officer in downtown LA. Every building and open case on your desk comes from real CoStar data.
- Your analyst is an AI agent. It plans the day, sends out squads to pull each building's records, aerial photos, 3D scans and city retrofit lists, and highlights wherever the sources disagree.
- You go and look. You walk into the real building through its 3D scan and report what you see. Your report shifts the agent's odds, but it never decides on its own.
- Then a simulated quake hits. The agent proposes a safety tag and stops. It waits for you to approve it or overrule it.
- Dawn grades you both. The next morning the agent opens with what you taught it, like "Last shift Bob changed my yellow to red, and red was right."
Every call you make is saved as feedback: what the agent proposed, what you chose, and who turned out to be right. That's exactly the kind of data a model can later be trained on. We didn't train anything this weekend; for now, the agent learns from its own shift log.
How we built it
The heart of the project is a LangChain deep agent running on LangGraph, powered by Gemini on Vertex AI.
- An orchestrator writes a plan as a to-do list, then runs specialist subagents in parallel: one for building records, one for aerial imagery, one for the 3D interior, and one for city data.
- When it's time to tag a building, a human-in-the-loop interrupt pauses the whole graph until the player decides.
- At the end of the day, a critic subagent reviews every proposed correction before a person ever sees it.
- One rule shaped everything: the agent makes the choices, and code does the maths. The model never writes a number that a tool didn't give it.
Evidence works like weighing a case. Each possibility starts with a prior, and every check nudges it up or down, with photos and personal reports capped so no single piece of evidence can decide alone:
$$P(h) = \frac{\pi_h + \sum_i \Delta_{i,h}}{\sum_{h'} \left(\pi_{h'} + \sum_i \Delta_{i,h'}\right)}$$
Damage comes from published earthquake engineering methods: FEMA's screening and HAZUS fragility curves, run at the real shaking from the 1994 Northridge earthquake:
$$P(\text{serious damage}) = \Phi!\left(\frac{\ln(\text{shaking}/\text{median})}{\beta}\right)$$
The game itself is a 3D downtown LA built on real aerial imagery, where you can walk into actual building scans.
🧰 Built with
- 🦜 LangChain
deepagents+ LangGraph - ✨ Gemini on Vertex AI (planning, subagents, vision)
- 🏢 CoStar building records · 🛰️ Vexcel aerial imagery · 🏠 Matterport 3D scans
- 🗺️ LA City and County open data · 🌋 USGS ShakeMap · OpenStreetMap
- 🐍 Python (evidence engine and screening maths)
- ⚛️ Next.js, React and three.js
Challenges we ran into
- Keeping the AI honest. Early on the model loved to invent percentages. Moving every calculation into Python tools fixed it, and made the agent's reasoning easy to show on screen.
- Demoing a live model. Model calls sometimes stalled at the worst moment. We built a record-and-replay layer, so a demo plays back exactly what the agent did.
- Licensed data. CoStar, Vexcel and Matterport data never goes into the repo; everything is matched locally.
- Finding the right game. We started with a zombie night-shift game and pivoted halfway through to a daytime building office. It fit the real job much better, and it pushed the feedback loop to the centre of the game.
Accomplishments that we're proud of
- A deep agent that genuinely plans, delegates, pauses for a human and remembers, rather than a single chatbot call.
- Every number on screen traces back to code and published methods, and the agent shows its work.
- Overruling the AI, and then finding out at dawn whether you were right, turned out to be the most fun part of the game.
- Real buildings, real records and real scans, all in one walkable city.
What we learned
- Letting the agent choose while code calculates is what makes an AI agent trustworthy enough to put in front of people.
- A human-in-the-loop pause isn't friction. Done well, it's the most engaging moment in the product.
- Even simple memory, a log the agent reads each morning, makes it feel like it's learning from you.
What's next for Last Stand LA
- Use the feedback we collect to actually fine-tune the analyst.
- Add more neighbourhoods, more case types, and more cities.
- Connect the agent's corrections to a real review queue, so every game played makes the records a little better.
The quakes, aftershocks and safety tags in the game are simulated: a game outcome, not an engineering assessment.
Built With
- costar
- css
- deepagents
- gemini
- google-cloud
- javascript
- json
- la-open-data
- langchain
- langgraph
- next.js
- openstreetmap
- playwright
- pytest
- python
- three.js
- typescript
- usgs-shakemap
- uv
- vertex-ai
- vexcel