Project Info
Inspiration
By the time a building failure is visible to a resident, it's already been predictable in public data for months — 311 complaints that went unanswered, permits that expired without inspection, seismic risk that nobody acted on. That data is technically public, but it's buried across a dozen disconnected government databases in formats no normal person can read. A renter has no way of knowing that next year they could be dealing with water damage, foundation problems, or major repair disruptions—all because warning signs were buried in millions of rows of government permit, inspection, and infrastructure records that no one ever checks. The neighborhoods that pay the price for this gap are almost always the ones with the fewest resources to recover. Dwell exists to close it.
What it does
Enter an address and Dwell pulls real data from USGS, NWS/FEMA, USDA SSURGO, and DataSF — building permits, 311 history, soil quality, seismic and flood risk. It reasons across signals: a building with no soft-story retrofit, a cluster of water damage permits, and two open sewer complaints tells a different story than any one of those alone. The output is a plain-language safety report with color-coded risk findings, a prioritized roadmap, and realistic cost ranges. For renters, every finding maps to action — what a landlord is legally required to fix, how to file a 311 complaint that creates a paper trail.
How we built it
A Python data layer wraps four public APIs into clean, cacheable functions. A Claude-powered ReAct agent decides which tools to call, then passes results to a deterministic scoring rubric kept separate from the LLM so every grade is auditable, not a black box. A lightweight TF-IDF system grounds cost estimates in real public works data. Every API response is cached on first run so the demo is instant and Wi-Fi-resilient.
Challenges we ran into
We originally planned a trained ML failure predictor, but the available public data is current-state snapshots — not labeled failure events — so we pivoted to an auditable reasoning system instead. That turned out to be the stronger product: residents making real decisions need to trust the output, and a system that shows its work beats one that doesn't. We also hit a JSON truncation bug from an undersized token budget, and built graceful fallback handling after the SF 311 feed dropped mid-test — because a silent failure producing a falsely clean report is worse than an error.
What we learned
The hard part of public infrastructure data isn't access — it's synthesis across sources that were never designed to talk to each other. A transparent rubric paired with an LLM that explains its reasoning is more trustworthy than a black-box score, especially when the output affects where someone lives. No one should need to be a data engineer to find out if their building is safe.
Dwell
AI agent that turns scattered public government data into a city's early warning system, flagging which locations are at risk of infrastructure failure, why, and what to fix first, before residents feel it.
Demo video: https://www.youtube.com/watch?v=jGVV2ODN8nI
Dwell takes unstructured, disparate public data, soil reports, seismic records, weather and disaster history, building permits, complaint logs, and turns it into a structured infrastructure risk assessment: which hazards are active, how severe, on what general timeframe, and what to do about it. The goal is to surface infrastructure risk before it becomes failure, not by predicting exact failure dates, but by giving cities the structured, evidence based read they need to act early.
What it does
Give Dwell an address and it pulls real data from federal and municipal sources (soil and terrain, earthquake history, weather and FEMA disaster declarations, building permits and 311 complaints), scores the location across four hazard categories using a transparent, auditable rubric, grounds its recommendations in curated public works cost data, and produces:
- A plain language welfare summary of overall risk
- Four color coded hazard scores (green, orange, red): seismic, flood and ground, structural, infrastructure decay
- A prioritized, costed roadmap of concrete preventative actions
- Renter specific actions for people who do not own the property
- Honest disclosure of any data gaps encountered during the assessment
How it works
- Gather. A Claude powered ReAct agent calls four data tools as needed: USDA SSURGO soil data, USGS earthquake history, NWS weather alerts and FEMA disaster declarations, and DataSF building permits and 311 complaints.
- Score. A deterministic, hand built scoring rubric, not a trained model, turns that raw data into the four hazard grades. Every point is traceable to a specific data field, so a red grade always has a concrete, explainable reason.
- Ground. A lightweight retrieval system pulls relevant public works knowledge (typical retrofit costs, pipe replacement ranges) so the roadmap's cost estimates are grounded rather than invented.
- Report. The agent writes the final structured report using the rubric's grades as authoritative and the retrieved knowledge as its cost basis.
We deliberately did not train a predictive ML model. The available public data is current state snapshots, not labeled historical failure events, so a trained model would project false confidence it has not earned. An auditable rubric paired with an LLM that explains it is the more honest design, and it is what is running here.
Using the app
The frontend takes a street address, not a city or neighborhood name. Type a full address, for example 1 Dr Carlton B Goodlett Pl, San Francisco, CA, and click Analyze. The app geocodes the address, pulls the data, and generates the report.
Click + new in the sidebar to start a fresh report for a different address. Previous reports stay listed in the sidebar so you can revisit them without regenerating.
San Francisco only, for now
Soil, earthquake, and weather and FEMA data are national and will return results almost anywhere in the United States. Building permits and 311 complaints are currently scoped to San Francisco only, since that is the dataset we built and tested against for this hackathon. Addresses outside San Francisco will still generate a report, but the infrastructure decay and structural hazard scores will be based on partial data, and the report will say so explicitly in its coverage notes rather than presenting a falsely confident score. Adding another city means adding its open data sources to the building and infrastructure data module.
Setup
pip install -r requirements.txt
npm install
export ANTHROPIC_API_KEY=sk-ant-your-key-here
Run the backend and frontend in two terminals:
# Terminal 1
python3 api_server.py
# Terminal 2
npm run dev
Open the local URL Vite prints, typically http://127.0.0.1:5173.
Demo mode
Set DATAGENT_MODE=demo before starting api_server.py to serve cached responses for addresses you have already run once, instead of hitting live government APIs and the geocoder every time. Use DATAGENT_MODE=record once per address beforehand to populate that cache.
export DATAGENT_MODE=record
python3 api_server.py
# run your demo addresses once each, then:
export DATAGENT_MODE=demo
python3 api_server.py
# now those exact addresses load fast and without network dependency
Built with
Python, Anthropic Claude API, USGS Earthquake Catalog API, National Weather Service NWS Alerts API, FEMA OpenFEMA Disaster Declarations API, USDA SSURGO Soil Data Access API, DataSF Socrata Open Data API, FCC Census Block API, Census Geocoder API, React, Vite
Analysis
View
Metric
- 7
- 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
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
6 of 6 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
104 KB
Source files
18
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
Rik-Banerjee/dwell
23 files · 165 KB · @ 513fa1e
Structure
Interface
1 file · 4%Screens, components and styles rendered to the user.
Application logic
17 files · 74%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
- Python76%
- JavaScript10%
- CSS9%
- Markdown5%
- HTML0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 4- @vitejs/plugin-react
- react
- react-dom
- vite
requirements.txt
pypi · 2- anthropic
- requests
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.