The Problem
Evaluating an Early Warning Notice (EWN) or Compensation Event under a construction contract rarely fails because the individual facts don’t exist—it fails because those facts live in separate silos. Contract clauses sit in the commercial pack, drawing revisions live in the CDE, and critical-path float sits inside the programme.
Handing that problem to a general-purpose LLM produces fluent summaries, but commercial teams cannot rely on probabilistic guesses for time-bars or Extension of Time entitlement. Change management needs deterministic multi-hop reasoning with an auditable trail back to exact source records.
How It Works (Architecture & Stack)
ProjectGraph models a construction project in Neo4j as connected entities—Project, ContractClause, Drawing, Activity, and EWN—and runs a deterministic Python rules engine in FastAPI rather than letting an LLM guess commercial entitlement.
[EWN] ──REFERENCES──► [Drawing Rev B] ──SUPERSEDES──► [Baseline Rev A]
│ │
│ CITES │ IMPACTS
▼ ▼
[ContractClause] [Programme Activity]
(CL-60.1(1) / CL-61.3) (critical path + total float)
│
▼
┌────────────────────────────────────────────────────────┐
│ Deterministic Rules Engine (Python) │
│ 1. Baseline scope change (post-baseline revision) │
│ 2. CL-61.3 56-day notification time-bar check │
│ 3. Critical-path / total float EoT calculation │
└──────────────────────────┬─────────────────────────────┘
▼
Verdict + Rule-by-Rule Math + Traversed Subgraph + Verbatim Citations
- Deterministic Evaluation Rules: Every EWN is evaluated against three explicit checks: whether a post-baseline drawing revision changes Scope (
CL-60.1(1)), whether notification landed within the 56-day time-bar (CL-61.3), and whether estimated delay exceeds activity float—returningENTITLED_TIME_AND_COST,ENTITLED_COST_ONLY,TIME_BARRED, orINSUFFICIENT_DATA. - Full Auditability: Each verdict returns a rule-by-rule pass/fail breakdown with exact day calculations, verbatim source clause and drawing citations, and the Cypher-traversed subgraph rendered in the UI.
- Tech Stack: Neo4j 5.x (Docker Compose), Python 3.11+ / FastAPI / Pydantic v2, React (Vite + TypeScript + Tailwind CSS), plus a synthetic NEC4 project dataset generator covering all three commercial outcomes.
What I Learned
- Keep deterministic logic out of the LLM: Separating graph traversal and contract rules from language generation eliminates hallucination where commercial certainty matters most.
- Provenance builds trust immediately: Showing the exact traversed subgraph alongside verbatim clause text and float arithmetic makes the verdict verifiable in seconds during commercial review.
- Synthetic boundary scenarios sharpen the schema: Testing three concrete EWN outcomes—valid time & cost, procedural time-bar failure, and float-absorbed cost-only—exposes missing graph relationships early.