"LLMs for Ambiguity, Deterministic Agents for Policy: Multi-Agent Contract Compliance"

python dev.to

There's a quietly important reference architecture in Google Cloud's contract-compliance-pipeline sample, built on one sharp principle: LLMs are useful for ambiguity; deterministic agents should enforce hard policy.

That fixes the most common failure in enterprise AI. Most "AI compliance" demos let a model both read the contract and decide whether it passes — so the same document can pass on Monday and fail on Tuesday, and no auditor accepts "the model said so." The sample draws the line correctly: LLM for the fuzzy part (extracting messy facts), deterministic code for the exact part (does this violate policy?).

The pipeline

  • Python + ADK (orchestrator) — FastAPI service using Google's Agent Development Kit handles intake, extraction, and risk assessment.
  • A2A handoff — a RemoteA2aAgent does an Agent2Agent handshake, discovers the second service via its agent card (/.well-known/agent.json), and sends extracted data as a JSON-RPC 2.0 message.
  • Go compliance agent (enforcer) — validates facts against thresholds (value caps, term limits, insurance minimums) with synchronous, repeatable checks. No LLM in this step.
  • Auditable verdict — structured pass/fail with specific violations; the orchestrator renders a compliance certificate; traces are logged.

Two ideas worth stealing

  1. The ambiguity/determinism split. Anything that must be consistent, explainable, and auditable — a compliance verdict, a payment rule, an eligibility check — belongs in deterministic code, not a model's head. The LLM handles the mess at the edges and hands clean structured data to the rule engine.
  2. A2A as the interoperability layer. The Python and Go agents don't share a codebase — they speak a standard protocol with discoverable agent cards. Specialized agents can be written in the best language for the job and scaled or swapped independently. The microservices lesson, applied to agents.

Why it lands in real estate

Leases, vendor agreements, purchase-and-sale, insurance certificates — all carry hard rules ideal for deterministic enforcement: term caps, rent escalation limits, insurance minimums, required clauses. LLM extracts; deterministic agent enforces; you get an auditable certificate at portfolio scale.

Honest caveats: extraction is still the weak link (a mis-read clause gets faithfully enforced on wrong facts — needs its own evals and human review on low-confidence cases); it's a reference sample, not a product; and deterministic enforcement is only as good as the rule library you maintain.

The discipline is the takeaway: let the model handle ambiguity, let deterministic agents enforce policy, and make them interoperate over open protocols. That's how you get agentic systems an auditor will trust.


Full real-estate breakdown on the VSBD blog. Source: Google Cloud ADK + A2A sample.

Source: dev.to

arrow_back Back to Tutorials