All work

Case studyIndustry Tool2025

An AI expert for the National Electrical Code

Built for people standing in front of a panel, grounded in the current code text.

  • 0answers drawn from the model's own memory of the code
  • 625the NEC article the retrieval was tested hardest against
Context
Engineers and electricians need fast, defensible answers from a dense, cross-referenced code book, and manual lookup does not scale to fieldwork.
What I built
A standalone AI application that retrieves directly from the National Electrical Code and returns cited interpretations.
Headline result
Instant, accurate code interpretations, live and in public use at nec-commander.com.

Specification

Role
Independent creator
Timeline
2025
Stack
Vector DB, retrieval, Python
Status
Live at nec-commander.com

The problem

The National Electrical Code is dense, heavily cross-referenced, and updated by edition, which makes manual lookup slow for the people who need answers fastest. Engineers and electricians often need a specific interpretation in the middle of a job, not a full afternoon with the code book, and getting that interpretation wrong carries real safety and compliance consequences.

The tool had to answer quickly without sacrificing accuracy, and be trustworthy enough that a working electrician would rely on it instead of falling back to a printed copy. That ruled out any approach where a model’s own trained knowledge of the code could quietly substitute for the actual text.

The approach

I chose retrieval over a model’s trained knowledge. The NEC gets revised every three years, and stale training data fails silently. Grounding every answer in passages retrieved from the current code text keeps interpretations traceable to an actual article.

I scoped the tool to the NEC specifically rather than the broader NFPA catalog. Narrowing the corpus kept retrieval precision high, since different code bodies vary in structure, and mixing them would have diluted the index across formats that do not compare cleanly. A narrower, more precise tool for one code beat a broader one that hedged across several.

I tested the retrieval pipeline hardest against the articles I already knew closely, particularly Article 625, since EV charging infrastructure overlaps with my own doctoral research. That gave me a way to check interpretations against sections where I could personally verify the answer was right, not just plausible, before trusting it on articles I could not check by hand as carefully.

I shipped it as a standalone, public application rather than a portfolio demo. The people who needed it, engineers and electricians in the field, needed something they could open and use, so it had to run as a real product with real uptime. That decision shaped everything downstream, from how carefully I scoped the corpus to how much I invested in making it fast enough to use standing in front of a panel.

  1. 01

    Code question

    Asked in the field, in plain language, mid-job.

  2. 02

    Current text only

    Retrieval runs against the indexed NEC, not against what the model remembers of it.

  3. 03

    Cited interpretation

    The answer points back at the article that backs it.

Fig. 01 The retrieval flow. A code question is matched against indexed NEC articles and returned as a cited interpretation, never as a recollection.

Code editions change. A model trained on older text will confidently cite the wrong section.

The outcome

NEC Commander gives engineers and electricians instant code interpretations instead of a manual search through a dense reference text. The value shows up most in the moments a lookup used to cost real time, mid-job, mid-review, mid-decision, and now takes as long as typing the question.

It remains live and publicly accessible, which is its own signal: a tool built for field use only holds up if it keeps working after the initial build. It is also the most demo-able thing I have built, since anyone can open it and test it against a code question of their own instead of trusting my description of it.

Open NEC Commander

What I would do differently

Add source-level citation transparency earlier, so users could see exactly which article and section backed an answer from day one instead of after early feedback asked for it. Build a structured feedback loop for professional users sooner, rather than treating it as a later addition.

Open line

Building on top of a corpus? I like this problem.