AI Building-Code Compliance & Permit-Review SaaS
GPT-4o + RAG - 200+ code checks across five disciplines, every finding cited to a real FBC/IBC/NFPA section. Days of manual review cut to supervised hours.
An AI-powered construction compliance platform that automates drawing reviews, verifies building codes, and generates audit-ready engineering reports with accurate citations.
GPT-4o + RAG - 200+ code checks across five disciplines, every finding cited to a real FBC/IBC/NFPA section. Days of manual review cut to supervised hours.
Permit review means reading hundreds of pages of construction drawings against hundreds of code rules by hand. For AEC firms and Florida code-engineering practices, that process takes days per project, requires deep discipline expertise across Architectural, Structural, Mechanical, Electrical, and Plumbing trades, and leaves no structured audit trail for the permit file.
This platform cuts that from days to hours - and, critically, makes the AI auditable. Every finding the system raises is grounded in a real code passage retrieved by ChromaDB vector search from indexed FBC, IBC, and NFPA standards. The AI cannot invent a rule: it cites, it does not guess. Reviewers verify reasoning instead of trusting a black box, and the output is a fully cited, permit-ready compliance report in both PDF and JSON.
Built on FastAPI + Celery + PostgreSQL backend, Next.js 15 frontend, and a six-stage transparent processing pipeline with live progress, per-stage cost display, and a hard billing ceiling per document. Live in production for a Florida building-code engineering firm.
The platform ingests construction PDF drawings, runs AWS Textract OCR and GPT-4o per-page extraction, retrieves the exact relevant code passage via ChromaDB vector search (RAG), and runs 200+ checks per discipline across five trades: Architectural, Structural, Mechanical, Electrical, and Plumbing, plus NFPA fire and life-safety codes (NFPA 1, 70, 72, 101).
Every finding links to a real citation - for example, FBC Plumbing 2023, Section 712.1 - so the AI cannot hallucinate a rule. It must reference an indexed passage from the FBC, IBC, or NFPA standards stored in ChromaDB. The output is a fully cited, audit-ready compliance report in PDF for the permit file and JSON for BIM/PM tooling, with every page traceable to the source drawing.
The system is cost-aware by design: page, OCR, and LLM cost is estimated up front with a hard ceiling per document to prevent runaway spend. Reviewers operate in a full human-in-the-loop workflow - they can edit any extracted field and re-run checks before accepting the final report.
Seven problems, seven pivots
Every challenge on the left became a shipped capability on the right.
Manual permit review takes days per project - reading hundreds of pages of construction drawings against hundreds of code rules by hand is the standard process at AEC firms and code-engineering practices. A single project review can take two to five days of senior engineer time, with no structured tracking of which rules were checked or why a finding was raised.
Documents move through a fully visible pipeline: Queued → OCR (AWS Textract) → Schedule Detection → Table Extraction → Equipment Parsing → Ready-for-Verification. Each stage shows live progress and its own cost, so reviewers always know exactly where processing is and what it is costing.
No audit trail for the permit file - traditional review produces a marked-up PDF or a handwritten checklist, neither of which gives the permit office a structured, traceable record of which code sections were checked, which passed, and which failed. When a drawing is revised, the review process starts from scratch with no reference to what was previously verified.
Every report exports as a printable PDF for the permit file and a complete JSON record for BIM and PM tooling. Every finding links to its source drawing page, the extracted field, and the specific code citation - creating a full traceable chain from drawing to code section.
AI hallucination makes LLMs unusable for compliance without RAG - off-the-shelf LLMs cannot be trusted for code compliance because they generate plausible-sounding but unverified code citations. A building official cannot accept 'AI says this complies' without a reference to the actual code section. Without grounding every finding in a retrieved passage from an indexed code corpus, AI is a liability rather than an asset in permit review.
Every finding is grounded in a real code passage retrieved by ChromaDB vector search from indexed FBC, IBC, and NFPA standards. The AI cannot invent a rule; it must cite an indexed passage before raising any flag. This makes the output permit-ready and professionally defensible, not just a plausible LLM response.
Five disciplines require different expertise and rule sets - Architectural, Structural, Mechanical, Electrical, and Plumbing reviews each require a different body of knowledge, different sections of the FBC, IBC, and NFPA standards, and different extraction logic from construction drawings. A single generic AI cannot handle all five trades without discipline-specific prompts, rule sets, and structured output schemas.
Each discipline (Architectural, Structural, Mechanical, Electrical, Plumbing) gets its own prompts, extraction logic, rule set, and check library. Plumbing checks drainage slope, backflow prevention, and venting. Structural checks load paths, framing, and foundations. Electrical checks NEC compliance. Every check is traceable to a specific code section.
Large PDF processing is expensive and unpredictable - construction drawing sets can be hundreds of pages and hundreds of megabytes. Sending entire documents to an LLM is cost-prohibitive, technically unreliable, and produces unstructured outputs that cannot be audited. Without per-page processing, cost control, and structured JSON extraction, AI-assisted review is not viable at production scale.
Construction drawing PDFs are streamed to disk in 5 MB chunks with magic-byte validation and SHA-256 content hashing. Duplicate submissions are detected and rejected before any processing begins - preventing double-billing on resubmitted drawings and ensuring storage integrity.
No human-in-the-loop means no professional accountability - code-compliance decisions carry professional and legal liability. A system that produces a report without allowing a licensed engineer to review, edit, and approve every extracted field and finding is not usable in a regulated permit-review workflow. Reviewers need to verify AI reasoning, not accept its output as final.
GPT-4o processes each page individually and outputs typed JSON with confidence scores for every extracted field. Reviewers can inspect, edit, and approve extraction results before checks run - full human-in-the-loop at the data layer, not just the output layer.
Billing surprises kill production AI tool adoption - AEC firms and code-engineering practices cannot adopt an AI tool that runs unpredictable LLM costs per document. Without up-front cost estimates, live per-stage cost display, and a hard ceiling per document, the tool is a financial risk rather than a productivity gain.
Page count, OCR cost, and LLM token cost are estimated up front before any processing begins. A hard cost ceiling per document prevents runaway spend. Live cost display per stage and per page gives practices complete financial visibility into every review job.
The Platform Modules - Six-Stage Pipeline, Five Disciplines, Zero Hallucination
Streaming upload handler for PDFs up to 500 MB. Files streamed to disk in 5 MB chunks with magic-byte validation, MIME sniffing, and SHA-256 content hashing for deduplication. Duplicate submissions rejected before any processing or billing begins.
AWS Textract processes each page and returns structured blocks (lines, words, tables, key-value pairs). Output stored as JSONB in PostgreSQL per page for downstream extraction. Textract cost tracked and displayed per page in the pipeline UI.
Dedicated stage detects title blocks, revision schedules, and data tables in the OCR output. Schedule data is extracted into structured records for cross-referencing during code checks. Table rows are parsed into typed JSON for equipment and specification tables.
Parses mechanical schedules, panel schedules, fixture schedules, and structural member tables into typed equipment records. Each record includes extracted values, confidence scores, and the source page reference for traceability.
Indexes FBC (Florida Building Code), IBC (International Building Code), and NFPA 1/70/72/101 standards as vector embeddings. At check time, the relevant code passage is retrieved before GPT-4o generates any finding - grounding every flag in a real cited text.
Runs 200+ discipline-specific checks across Architectural, Structural, Mechanical, Electrical, and Plumbing trades. Each check retrieves its code passage from ChromaDB, runs GPT-4o against the extracted drawing data, and records the finding with citation, confidence, and source reference.
Reviewers inspect per-page extraction results, edit any field, override confidence scores, and approve or reject individual findings before the final report is generated. Every edit is logged with timestamp and reviewer identity for the audit trail.
Generates a printable branded PDF compliance report for the permit file and a complete structured JSON export for BIM/PM tooling. Every finding links to its source page, extracted value, and cited code section. Built with ReportLab and FastAPI background tasks.
Estimates page count, OCR cost, and LLM token cost before processing begins. Tracks actual spend per stage in real time and enforces a configurable hard ceiling per document. Live cost display on the pipeline progress UI prevents billing surprises.
Six-stage pipeline progress view (Queued / OCR / Schedule Detection / Table Extraction / Equipment Parsing / Ready) with per-stage status, timing, and cost. Built on TanStack Query with polling for live updates during async Celery processing.
The web console, end to end
Upload & Process Flow
- Reviewer uploads drawing PDF
- streaming validation runs
- SHA-256 dedup check
- cost estimate displayed
- reviewer confirms
- Celery job queued
- Textract OCR runs per page
- Schedule Detection
- Table Extraction
- Equipment Parsing
- status shown live on pipeline UI
Review & Verify Flow
- Processing complete
- reviewer opens per-page extraction results
- inspects GPT-4o fields and confidence scores
- edits any incorrect value
- approves extraction
- compliance checks run against corrected data
- findings displayed with ChromaDB-retrieved citations
Report Generation Flow
- Reviewer approves findings
- overrides any false positive or false negative
- adds reviewer comments
- generates final report
- branded PDF rendered by ReportLab
- JSON export created
- both stored in S3 with signed URL download links for the permit file
The office's command center
Everything back-office in one console — with role-based access drawn as a hard line, not a suggestion.
Meet the AI Layer
An AI processing engine embedded in the platform's pipeline (not a conversational chatbot). Primary Model: OpenAI GPT-4o (vision + structured output). Structured Outputs: PydanticAI validates every GPT-4o response before any database write. RAG Engine: ChromaDB vector search over indexed FBC, IBC, and NFPA 1/70/72/101 standards. Embeddings: OpenAI text-embedding-3-small for ChromaDB indexing. OCR Layer: AWS Textract (per-page blocks, tables, key-value pairs). Hallucination Prevention: every finding requires a ChromaDB-retrieved citation before GPT-4o output is accepted. Human-in-the-Loop: per-page extraction review and per-finding approval before report generation.
- Per-page structured extraction: GPT-4o outputs typed JSON with confidence scores for every field on every drawing page
- RAG-grounded compliance checks: ChromaDB retrieves the exact code passage before GPT-4o generates any finding
- 200+ discipline-specific checks across Architectural, Structural, Mechanical, Electrical, and Plumbing trades
- NFPA fire and life-safety checks: NFPA 1 (Fire Code), NFPA 70 (NEC), NFPA 72 (Fire Alarm), NFPA 101 (Life Safety Code)
- Schedule and table detection: identifies title blocks, revision schedules, and data tables in OCR output
- Equipment parsing: extracts mechanical, panel, fixture, and structural member schedules into typed records
- Confidence scoring on every extracted field - low-confidence fields flagged for mandatory human review
- Human-in-the-loop edits: reviewers correct any extraction result and re-run checks against corrected data
- Zero-hallucination guarantee: every finding must cite a ChromaDB-retrieved code passage - no citation, no finding
- PydanticAI structured output validation on every GPT-4o response before database write
How it all fits together
Three layers, read top to bottom — the applications people use, the services that power them, and the infrastructure they run on.
The rulebook under the hood
Everything inside
8 capability groups, laid out as an uneven mosaic — not a wall of identical cards.
Built with a grounded AI stack
- Next.js 15 + React 19 - reviewer console
- TypeScript - end-to-end type safety
- Tailwind CSS - styling
- TanStack Query - live pipeline polling
- Sentry - client-side error tracking
- FastAPI on Python 3.11 - async API with uvicorn + gunicorn
- Pydantic v2 - typed schemas and validation
- PydanticAI - structured LLM outputs
- async SQLAlchemy + asyncpg + Alembic - ORM and migrations
- Celery - six-stage document pipeline as task chains
- Redis - broker and result backend
- Horizontal Celery scaling - throughput on demand
- Per-stage progress and cost tracking
- AWS Textract - per-page OCR blocks, tables and key-value pairs
- Per-page JSONB storage in PostgreSQL
- Structured extraction with confidence scores
- OpenAI GPT-4o - vision and structured output per page
- PydanticAI - model routing and output validation
- OpenAI text-embedding-3-small - embeddings for retrieval
- ChromaDB - FBC, IBC and NFPA 1/70/72/101 embeddings
- OpenAI Embeddings - code-passage indexing
- Top-k retrieval per compliance check - every finding cited
- PostgreSQL - primary store
- JSONB columns - OCR blocks, extractions and findings
- asyncpg + Alembic - async driver and migrations
- AWS S3 - PDFs, OCR outputs and reports
- Pre-signed multipart upload - 500 MB streaming
- Signed-URL access control with configurable expiry
- Per-reviewer audit logging
- Sentry - error tracking across backend and frontend
- structlog - JSON logs with trace IDs
- Per-stage cost logging to PostgreSQL
- ReportLab - branded compliance report PDFs
- Docker - containerised builds
- GitHub Actions - CI/CD
- Coolify on DigitalOcean - managed Docker Compose
- Traefik - reverse proxy
- Cloudflare + Let’s Encrypt - DNS and TLS
What actually changed
Engineering outcomes beneath the headline numbers.



