Inspiration

Electrification runs through permitting. Every heat pump, EV charger and home battery in Massachusetts needs an electrical permit, and with the state hitting its 2025 heat pump goal a year early, the line keeps growing. For us it's close to home: Nikhil has no power in his bathroom right now because the fix is waiting on a permit.

We also compete on Boston University's debate team together, so we've been following the Bipartisan American Affordability and Jobs Act of 2026, a federal permitting overhaul that passed the Senate 62 to 33 on November 19. That bill only touches large federal projects. In Massachusetts, the permits most households need belong to the 351 cities and towns, each with its own office and queue. At the municipal level, what moves the line is faster tools.

Boston's Inspectional Services Department issues about 40,000 permits a year, with roughly 10 plan reviewers in its building review group and three plans examiners listed for the electrical division. The average wait for a first review is 35 days. An electrical review takes under five business days once the file is complete, but one missing number puts it on hold. The facts a reviewer needs are scattered across state code, city parcel records, manufacturer PDFs, and utility rules.

We want a future where a complete permit gets approved the same week it's filed. So we built a tool that reads the file, gathers every scattered fact into one place, runs the code checks, and puts a cited recommendation in front of the reviewer before they open it.

What it does

PermitPike uses AI to speed up residential electrical permits in Boston. To get there, we built our own MCP server over Boston's code and permit records and trained a risk model on the city's permit history, then wired both into a Mastra agent. It handles three job types: a heat pump with panel work, an EV charger, and a home battery.

An applicant fills out a short form and uploads their documents. Gemini reads those documents and pulls out the numbers a reviewer would otherwise copy by hand. Every value comes with a confidence score and the page it came from. When Gemini can't read a value, it marks the field as missing and the reviewer sees the gap.

The agent runs those numbers through a rule pack written for that job type, plus a load calculation under the Massachusetts electrical code. It then posts a recommendation to the reviewer's queue: approve, approve with conditions, or return for fixes. Each check links to the code section it rests on. The recommendation also carries an inspector checklist, a flag when the job will need an Eversource service upgrade, and a closure-risk score that estimates how likely the permit is to stall, based on Boston's permit history.

By the time a reviewer opens the application, the lookup, extraction and math are done, so a review takes minutes. They confirm the recommendation and sign off, a step required by state law. On the applicant side, the electrician and homeowner get a tracking code and a public status page that shows where the permit stands. While they wait, it lists clean-energy programs the household may qualify for.

How we built it

PermitPike is a TypeScript monorepo on Node.js 22, plus one Python service for machine learning. The web app is Next.js 15 with React 19 and Tailwind CSS 4, deployed on Vercel. Uploads go straight to Vercel Blob. Each application shows the property on a Leaflet map with OpenStreetMap tiles.

Mastra runs the review. The agent is a Mastra server with one POST /review route. Each request runs a typed Mastra workflow in four steps. Extract calls our Gemini extractor. Run-checks loads the rule pack for the job type, a TypeScript module holding that job's code requirements, Eversource upgrade triggers and clean-energy programs, and runs the shared load calculation. Recommend turns the results into a decision, conditions and an inspector checklist. The final step hands everything to a Mastra agent we call the permit reviewer, which has our compliance tools attached and writes the summary.

Gemini reads the documents. We call the Gemini API through Google's @google/genai SDK, using structured output on PDFs and photos. The fields come from each rule pack's schema. Gemini returns the source quote alongside every value. We scored it against synthetic spec sheets with an answer key.

Code lookup over MCP. We wrote a Model Context Protocol (MCP) server for Boston compliance. It searches the Massachusetts electrical code and its amendments, returns live excerpts with section-level citations, and answers parcel and zoning questions by querying the city's ArcGIS services. The permit reviewer calls it as a tool. It also reaches our copy of every permit the City of Boston has on record, so a reviewer can ask for the full permit history of any address or contractor.

One data layer. Most of our weekend went into pulling scattered sources into one place an agent can query. Tiger Data hosts our database on TimescaleDB, which runs on PostgreSQL, and we define every table with Drizzle ORM. From Analyze Boston, the city's open data portal, we loaded 477,776 permits into a TimescaleDB hypertable, then built 35,486 contractor histories on top. With all of it behind one schema, a single review answers questions that used to take a reviewer four tabs and a phone call.

Closure risk. We trained a LightGBM classifier with scikit-learn on that permit history. SHAP turns each score into its top three drivers, which the reviewer sees next to the risk band. A FastAPI service scores an application in about 10 milliseconds and falls back to citywide patterns when a contractor is new.

One contract. A shared Zod package defines every request and response, so the web app and the agent validate each other's data, and the Python service returns the same shapes.

GoDaddy gave us our domain, permitpike.us. Vultr was our target host for the agent and the risk service.

Challenges we ran into

Hosting was the hardest part of the weekend by far. On Vultr, SSH timed out, every port we opened timed out, and the web console wouldn't connect either. We rebuilt the server, worked through firewall settings, and fought to get the trained model file uploaded and loading on the box.

The interface took longer than we expected. A reviewer needs to see the recommendation, the evidence behind each check and the source document in one view without the screen turning into a wall of numbers. We redesigned the permit header and the review workspace several times before it read cleanly.

Reading real documents is messy. Spec sheets list a whole product family on one page, nameplates are photographed at an angle, and panel photos are blurry. We had to teach the extractor to identify which model applies and to flag what it can't read with confidence.

Accomplishments that we're proud of

In under a day, we went from an empty repo to three rule packs, a NEC load calculation, a working agent, a trained risk model and a public status page. We're proudest of how the pieces fit: adding a fourth job type now means writing one rule pack file, and the extractor, checks and reviewer screen pick it up on their own.

Most of all, we're proud that it's live at permitpike.us, and it's fast. Enter any address in Boston, file an application, and the agent reads the documents and lands a cited recommendation in the reviewer's queue in under a minute. And everything underneath runs on real city data, from the permit records to the parcel and zoning lookups.

What we learned

Permit review is mostly arithmetic and lookup. Models now read documents well enough that the bottleneck moves to data plumbing and deployment. We learned how much of a city's rulebook lives in PDFs and scanned forms, and how much work it takes to make it something software can query. Next time, we'll stand up servers before we write a line of product code.

What's next for PermitPike

For a real deployment, we would add the application fee, verify the electrician's state license before an application can be filed, connect to the city's existing permitting portal so reviewers work in one place, and draft the Eversource service request automatically for jobs that need more power. We would also add rooftop solar and whole-home electrification as job types, and run every rule pack past a licensed electrical inspector.

We would love to pilot PermitPike with Boston's Inspectional Services Department. Because every Massachusetts town works from the same state electrical code, the rule packs can travel to the next city with little change.

The state has set its climate goals, and much of the money for heat pumps, chargers and batteries is already on the table. What's left is a long line of small approvals, one house at a time, and each one waits on a person with a calculator and a stack of spec sheets. If PermitPike can give those reviewers back even a few hours a week, a family gets off oil a season sooner, and Nikhil gets his bathroom lights back on.

Built With

Share this project:

Updates

Submission history