DealClose — The Trust-Engineered Real Estate Workflow Platform

                        Built for the DevNetwork [API + Cloud + AI] Hackathon 2026

Inspiration

Real estate agents spend 4–5 hours on a single purchase offer. They open Zillow, copy a price, paste it into a PDF form, email it to a DocuSign template, and pray nothing was transposed. That workflow has not changed in 20 years.

When generative AI arrived, agents tried using ChatGPT to draft offers. It was faster — but it hallucinated escrow dates, invented tax figures, and fabricated seller concession percentages. In a legal contract, an AI hallucination is not a typo. It is a lawsuit.

The real problem was not that AI was too slow. It was that AI had no accountability layer. Every AI-generated legal document looked equally confident whether it was right or catastrophically wrong.

We built DealClose to solve the trust gap — not by removing AI from the process, but by engineering the exact moment where the human must step in.


What It Does

DealClose is a real estate deal workflow engine that converts a raw property address into a fully-drafted, human-authorized, legally-binding purchase offer PDF dispatched for e-signature — in under 60 seconds.

The workflow runs in five stages:

01 — Live Market Intelligence The buyer pastes any US residential address. DealClose queries SerpApi for live Google search comps, recent sale prices, and neighborhood market signals in real time. Zero mocked payloads. Zero hardcoded responses.

02 — AI Structuring with Confidence Scoring OpenRouter routes the raw market data through a cascading model chain (Liquid LFM 2.5 → MiniMax M2 → GLM 5.2) to produce a fully structured California Residential Purchase Agreement (CA-RPA) term sheet. Every field is scored with a confidence value:

$$\text{Confidence}(f) = 1 - \frac{\sigma_f^2}{\mu_f^2 + \epsilon}$$

Fields below the 85% threshold are automatically flagged for mandatory human review.

03 — The Human Review Gate *(The Core Innovation)* This is not a warning dialog. This is a hard architectural gate. Any field the AI is uncertain about is surfaced to the agent with the exact reason for uncertainty. The contract PDF cannot be compiled until every flagged field is explicitly authorized or overridden. The AI drafts. The human authorizes. The system enforces it — no code path around it.

For a $3,850,000 Pacific Heights listing:

  • contingency_financing flagged at 74% — Jumbo loan liquidity check required beyond conforming limit
  • seller_concessions flagged at 69% — Pacific Heights HOA reserves vary widely; market signal insufficient

High-confidence fields auto-confirm: offer price at 95%, inspection contingency at 96%, earnest deposit at 93%.

04 — Nutrient DWS PDF Compilation Once the agent authorizes all flagged terms, Nutrient DWS compiles a structurally compliant CA-RPA PDF with field coordinates mapped to legal clause anchors — server-side, no browser dependency.

05 — Foxit Fusion eSign Dispatch The compiled PDF is dispatched via Foxit Fusion API as an authenticated envelope transaction. DealClose issues a cryptographic JSON audit certificate with a SHA-256 fingerprint of every authorization event.

Metric Legacy Workflow DealClose
Time to Offer 4 hr 30 min 58 seconds

That is not a feature improvement. That is a workflow replacement.


How We Built It

The entire product was designed, built, and shipped in a single ~6-hour session using AI as a force multiplier.

Stack: | Layer | Technology | |---|---| | Frontend | Next.js 16.3 App Router — step-locking state machine | | Orchestration | Xano — relational state engine + immutable audit ledger | | Market Intelligence | SerpApi — live Google organic search comps | | AI Structuring | OpenRouter model chain with circuit-breaker + deterministic fallback | | PDF Generation | Nutrient DWS — server-side CA-RPA field compilation | | eSignature | Foxit Fusion API — authenticated envelope dispatch |

The hardest architectural decision: the fallback system.

A live hackathon demo cannot afford a 30-second spinner. We needed the demo to be 100% real and 100% reliable even if any single API degraded under load.

Solution: a two-layer strategy with no fake data at any layer.

  1. Primary path: OpenRouter model chain with strict 2.2s circuit-breaker timeouts.
  2. Instant fallback: On any 429/503 or timeout, the system drops to parseMarketSignal(address, rawSerpData) — a deterministic engine that extracts prices from live SerpApi snippet text (e.g. $3.85M, $18,995,000) and derives confidence scores from real estate heuristics: zip code competitiveness, valuation band, and historic structure age. Runs in <10ms.

Every field is always grounded in real market data — never invented, never hardcoded. The human sees a sub-second response; under the hood, three model endpoints may have already been tried and bypassed.

AI Tools Used:

  • Antigravity IDE (Google DeepMind) — primary coding agent for architecture, route building, and iterative product verification
  • Claude Sonnet — reasoning and product strategy

The agentic workflow compressed ~30+ hours of manual implementation into ~6 hours by parallelizing API integration, TypeScript type safety, and UI polish.


Challenges We Ran Into

1. The AI Hallucination Paradox The hardest challenge was not making the AI smart — it was making it safe. Generic AI confidence is binary: it answers or it doesn't. We needed field-level probabilistic scoring where each contract term carries its own uncertainty signal, derived from SerpApi signal density, market volatility for that zip code, and valuation band risk (conforming vs. Jumbo vs. ultra-luxury). Building that scoring model in a day required rejecting three simpler approaches that would have been defensible but wrong.

2. OpenRouter Latency vs. Demo Reliability Free-tier models on OpenRouter are excellent but rate-limited. We implemented a 2.2s circuit-breaker across three cascading model endpoints with instant deterministic fallback. The human sees a sub-second response. Under the hood, three endpoints may have already been tried, failed, and rerouted.

3. Nutrient DWS PDF Field Coordinate Mapping CA-RPA forms have legally mandated field positions. Mapping AI-generated term values to exact PDF field coordinates required precise positional coordinate injection — not a simple fillForm call. Each field had to be mapped to its legal clause anchor by position, not by label.

4. Foxit Fusion Authentication Flow Foxit Fusion uses a two-step client credentials OAuth flow before envelope dispatch. Building this correctly in Next.js server routes — without leaking credentials to the browser, under time pressure — required careful separation of server-only logic from client-side state.


Accomplishments We're Proud Of

The Trust Gate is technically provable, not merely described. The system physically cannot compile a PDF until every low-confidence field is human-authorized. There is no code path around it. A judge can try to click past it — the button simply does not unlock. This is not a UI restriction. It is an architectural invariant enforced at the compilation layer.

Every API call in the demo is live and verifiable. The /test endpoint exposes a real-time health check across all 5 sponsor APIs:

  • SerpApi → returns organic comps for the address
  • OpenRouter → returns structured JSON term sheet
  • Nutrient DWS → returns binary PDF buffer
  • Foxit Fusion → returns authenticated Transaction ID
  • Xano → returns deal state records

Every green checkmark is a real HTTP 200. Any judge can inspect network traffic.

Address-adaptive confidence scoring. The system produces genuinely different flagged fields for every property, not a static template:

Address Flagged Terms Reason
2646 Green St, SF ($3.85M) contingency_financing 74%, seller_concessions 69% Jumbo loan liquidity + HOA variance
10480 Sunset Blvd, LA ($18.5M) earnest_money 76%, closing_costs_seller 72% Measure ULA transfer tax on ultra-luxury
2100 Waverley St, Palo Alto ($4.95M) closing_days 75%, contingency_financing 78% Competitive tech zip, expedited timeline risk

Built and shipped in ~6 hours. Full end-to-end workflow, five live APIs, zero mocked data.


What We Learned

1. AI accountability is a product feature, not a safety afterthought. Every AI tool in production eventually needs a trust boundary. Ours was the Human Review Gate. The moment we framed it as a capability rather than a limitation, the product became coherent. AI drafts fast. Humans authorize once. Both are better together.

2. Deterministic fallback makes live products survivable. The worst demo failure is not a broken API — it is a silent fake. Our fallback always uses real SerpApi data, processed deterministically. No mocked JSON. No hardcoded responses. The product is live even when the AI layer is not.

3. Confidence scoring must be asymmetric by valuation band. An offer at $3,850,000 on a $4M comp scores 96% confidence. The same dollar delta on a $200,000 home scores 71% — because comp density is lower and relative deviation is larger. Linear confidence thresholds are wrong for real estate. We model confidence per valuation band, not per dollar delta.

4. Xano as an orchestration layer is severely underrated. Most teams use Xano as a CRUD backend. We used it as a stateful deal lifecycle manager and immutable audit vault. The combination of relational schema + API builder + workflow triggers allowed us to build what would have taken 2–3 days of custom Node.js backend work in a fraction of the time.


What's Next for DealClose

Short term:

  • Multi-state contract support: Texas TREC, Florida AS-IS, New York contracts of sale
  • Broker dashboard with deal pipeline tracking across active addresses
  • DocuSign and HelloSign envelope routing alongside Foxit for enterprise MLS integrations

Medium term:

  • Live MLS API integration (RETS / RESO Web API) for direct comp ingestion, replacing SerpApi
  • SHAP-based confidence explanation layer — the agent cites the exact SerpApi snippet each confidence score was derived from
  • Title company workflow integration: direct escrow order dispatch on deal authorization

Long term: The Trust Pipeline architecture is not specific to real estate. The same pattern — AI drafts structured fields with confidence scores, humans authorize uncertain ones, a compliance engine enforces the gate — applies to insurance underwriting, mortgage origination, and medical billing.

DealClose is the first working proof-of-concept for a provably accountable AI document engine.

The architecture generalizes. Real estate was the proof.

Built With

  • artificial-intelligence
  • audit-ledge
  • cloud-database
  • esignature
  • foxit-esign
  • legaltech
  • next.js
  • node.js
  • nutrient-dws
  • openrouter
  • pdf-lib
  • proptech
  • react
  • real-estate
  • rest-api
  • serpapi
  • turbopack
  • typescript
  • vercel
  • xano
Share this project:

Updates

Submission history