REPO-GROUNDED · MAIN · 2026-09-10

Drawing intelligence with a hard boundary around the model.

CAD AI Agent accepts DXF, PDF, and conditionally DWG across desktop, command-line, web, and Claude Code surfaces. Models do not edit drawings. They return typed plans; deterministic Python validates, previews, applies, and saves the result as a new artifact.

System topology

Grounded in README.md · pyproject.toml
src/cad_dxf_agent/ · web/ · plugin/

Swipe sideways to inspect the full system →

Desktop

PySide6 main window and background pipeline worker

CLI

cad-analyze, cad-revision, desktop launcher

Web SPA

React + Vite drawing viewer, prompts, approvals

Claude plugin

Skill surface invokes the packaged command workflow

Ingress and sessions

FastAPI upload/plan/apply/revision APIs; local desktop and CLI enter below HTTP.

Objective + intent routing

Classifies what the user wants and why, then selects an ordered strategy.

Typed stage pipeline

Registered handlers execute in order. Every stage emits a gate; rejection stops downstream work.

Validation + approval gates

Pydantic schemas, protected-layer rules, previews, explicit approvals, bounded agent turns.

Drawing context

DXFReader, typed geometry, units, elevation, CRS, entity index.

Analysis families

Compliance, health, takeoff, Q&A, summaries, RFIs, zones, comparison.

Edit + revision engine

Validated operations only; ezdxf performs mutation and revision notes.

Local artifacts

Original input, preview renders, save-as DXF, changelog, overlays, bundles.

Model seam

Mock or BYOK model + compatible endpoint

ODA converter

Required for real DWG conversion

Cloud + OTel

Operator-owned hosting, persistence, telemetry

CAD AI Agent component and data-flow architecture Desktop, command-line, web, and Claude Code plugin surfaces converge on objective routing and a typed stage pipeline. Drawing context feeds deterministic analysis or a model planning seam. Validation and approval gates control the edit engine, which writes new local artifacts without overwriting the original. directcontexttyped resultplan()convert

Execution paths

Analysis stays deterministic

  • Intent routing selects compliance, health, takeoff, summary, RFI, zone, Q&A, or comparison handlers.
  • Extractors read the semantic drawing context and return typed response envelopes.
  • The mock provider allows the entire core and its tests to run without a network or key.

Edit requests cross explicit gates

  • A provider returns a structured ChangeSet, never raw DXF.
  • Validation rejects unsupported operations, invalid targets, and protected-layer edits.
  • The user previews and approves operations before EditEngine touches a copy.
  • Output is save-as DXF with optional deterministic revision notes.

Revision comparison is its own pipeline

  • Two drawings are canonicalized, aligned, matched, classified, and scored.
  • Reviewable revision operations can be approved individually.
  • Application produces a new DXF plus overlay, changelog, and downloadable bundle.

One core, four delivery surfaces

  • PySide6 provides the local desktop workflow.
  • Three console scripts expose analysis and revision automation.
  • FastAPI reuses the package for a React web application.
  • The Claude Code skill wraps the same command surface instead of duplicating the engine.

Trust boundaries

0raw DXF edits performed by an LLM
10maximum agent turns for complex tool use
25 MBshared web upload limit
3Python console entry points

Current reality, including the edges

What is structurally strong

  • The provider interface is deliberately small and model-agnostic.
  • Typed schemas separate probabilistic planning from deterministic mutation.
  • Original-file preservation, protected layers, and approval are first-class safeguards.
  • Unit, integration, web, eval, E2E, GUI, property, smoke, and benchmark suites cover the system.

Known product constraints

  • DWG input depends on a separately installed ODA File Converter; the fallback is not equivalent.
  • Elevation is preserved for supported entities, but the product is not a terrain or full 3D modeling system.
  • CRS support covers caller input, sidecar .prj, and supported DXF GEODATA; ambiguous metadata fails closed.
  • Cloud deployment is operator-owned; the accepted core architecture remains local-first.