Inspiration

The inspiration originated from Elliot's personal experience: his father wanted to build a garage but quickly discovered the absolute nightmare of municipal regulations and infrastructure connections. He realized that if a homeowner struggles with scattered local zoning by-laws and basic pipe tie-ins, professional civil engineering and planning firms must face a catastrophic operational ceiling. This sparked the vision for a tool to instantly parse rigid local codes and eliminate the manual research bottleneck for both property developers and civil engineers.


What it does

CoCivil operates as a Site Servicing Feasibility Copilot for civil engineers and property developers. It transforms a plain-English development query into a structured and source-backed analyze package. The system seamlessly combines deterministic zoning compliance, 3D massing visualization, and infrastructure policy checks. It specifically helps civil engineers instantly validate municipal water system restrictions and pipe regulations to drastically accelerate the creation of early-stage Functional Servicing Reports (FSR).


How we built it

We engineered a deterministic compliance engine to ensure absolute reproducibility without relying on AI for physical rule generation. We constrained the AI using strict grounding instructions to only cite sources explicitly provided within the context. The architecture utilizes PostGIS for complex spatial queries. This allows us to resolve parcel boundaries against municipal water systems and infrastructure overlays in milliseconds. We integrated MapLibre GL for the 3D map environment and Konva for the rapid 2D site editor. We also deployed Celery asynchronous pipelines to handle intensive plan generation tasks without risking request timeouts.


Challenges we ran into

Our primary strategic challenge was identifying the true industry pain point: the core problem is not merely saving research hours, but rather fixing the dangerously high error rate in feasibility models built manually in Excel. Furthermore, we encountered severe technical hurdles when scraping data from government sites. We had to build resilient ingestion tasks to pull from the Toronto Open Data CKAN API for building permits, Committee of Adjustment applications, and water infrastructure policies after facing aggressive access blocks.


Accomplishments that we're proud of

We successfully mapped the complex policy stack of the Greater Toronto Area into deterministic rules. This now includes rigid municipal water system policies and pipe connection regulations alongside recent provincial legislation like Bills 23, 185, and 60. We are incredibly proud of our integrated environment. Civil engineers can now instantly validate site servicing feasibility and catch regulatory violations before ever opening AutoCAD to design physical pipes.


What we learned

We learned that generative AI is fundamentally unsuited for regulatory and engineering compliance if left unconstrained. Compliance is not an opinion: it requires absolute deterministic reproducibility. We realized that enforcing strict safety preambles and citation verifiers is mandatory to prevent hallucinations. This is the only way to establish an audit trail that engineering professionals can actually defend in formal municipal submissions.


What's next for CoCivil

The immediate next step is integrating live APIs for the Application Information Centre, Ontario Land Tribunal, and CanLII to automate precedent research entirely. We also plan to expand our data ingestion to cover deeper civil engineering heuristics across multiple jurisdictions. Finally, we will finalize a governance-stamped PDF export feature so engineering consultants can instantly download audit-ready Functional Servicing Reports and compliance packages.

Tools & Libraries

Artificial Intelligence & LLMs

  • Google Antigravity: Autonomous AI agent used as a pair-programmer to rapidly build out the codebase, translate civil/zoning policies into structured skills, and orchestrate the full-stack architecture.
  • Google Gemini API: Core inference engine powering multimodal document analysis (reading CAD/DXF pipelines, PDF site plans, and dense municipal by-laws) and civil engineering calculations (e.g., Hazen-Williams flow rates and structural risk assessments).
  • RAG Infrastructure: Built to ingest and retrieve context from Ontario planning legislation, Toronto ECS (Engineering & Construction Services) standards, OPSS, and AWWA manuals.

Frontend & Rendering (Client-Side)

  • React 19: Core UI framework.
  • Vite: Extremely fast frontend build tool.
  • Three.js / React-Three-Fiber / React-Three-Drei: For the immersive 3D WebGL/WebXR environment to visualize underground pipeline geometry and above-ground building massing/shadows directly in the browser.
  • MapLibre GL JS: High-performance, WebGL-based vector map rendering for the geospatial parcel and infrastructure viewers.
  • Konva / React-Konva: Used for the 2D HTML5 canvas rendering (e.g., interactive floor plan editors and vector manipulation).
  • Auth0 (react-auth0): Enterprise-grade identity management, handling secure JWT authentication and role-based access control (RBAC).

Backend & APIs (Server-Side)

  • FastAPI: High-performance async Python web framework used for the core API server.
  • Uvicorn: ASGI web server implementation for Python.
  • SQLAlchemy 2.0 (Asyncio): Core ORM handling database models and asynchronous connections.
  • PyMuPDF & ezdxf: Powerful parsing libraries used to extract spatial metadata from uploaded PDF site plans and civil CAD/DXF files.
  • Pydantic: Data validation and settings management tailored for the API schemas.

Database & Geospatial Infrastructure

  • PostgreSQL: The core relational database engine.
  • PostGIS & GeoAlchemy2: Advanced geospatial extensions to store, query, and manipulate 2D and 3D geometries (lot footprints, pipeline networks).
  • pgvector: Postgres extension used to store high-dimensional embeddings generated by Gemini for fast semantic retrieval of zoning and civil policies.
  • Asyncpg: High-performance async database driver for Python.
  • Alembic: Database migration tool used alongside SQLAlchemy.

Cloud & DevOps

  • Docker & Docker Compose: Containerization of the API, databases, and worker queues to ensure parity between local development and production.
  • Redis: In-memory data store used for caching and managing async background tasks.
  • Neon Serverless Postgres: Scalable, serverless Postgres platform used for hosting the heavy geospatial database.
  • Railway: Platform-as-a-Service (PaaS) used to host and deploy the backend containerized workloads.

* Amazon Web Services (AWS / Boto3): S3 used for secure storage of uploaded client CAD and PDF files.

Built With

Share this project:

Updates