How Amazon Quick’s Adjudicated Query lets compliance teams prove every lease was checked

How Amazon Quick’s Adjudicated Query lets compliance teams prove every lease was checked

According to Artificial Intelligence, checking tens of thousands of apartment leases against constantly changing state landlord‑tenant laws has been beyond most compliance teams—until a new design pattern paired generative AI with a deterministic rules engine.

Compliance officers now have a way to ask natural‑language questions in a chat interface while keeping the actual pass/fail decision in a provably complete, auditable engine. The change matters because it restores defensibility to large‑scale compliance sweeps without sacrificing the convenience of conversational access.

The compliance problem at scale

A portfolio operator that holds 50,000 leases across multiple states must react whenever a statute changes – for example, a new cap on late fees in Texas. Small teams can have a paralegal read each lease, but that stops being feasible once the number of documents climbs into the tens of thousands. The usual software approach replaces the human with a black‑box query that returns a single number. Two properties become critical:

  • Provable completeness – the team must be able to demonstrate that every lease was evaluated. A claim like “we checked all 22,910 Texas leases” must be backed by an invariant that can be inspected.
  • Defensibility – regulators or courts may later ask which version of which rule was applied, on what date, and by whom. The audit trail must include the rule text, its citation, and the exact comparison that led to a breach determination.

Standard enterprise search tools, even retrieval‑augmented generation (RAG) that pulls relevant clauses into a prompt, cannot guarantee either property. RAG returns a ranked sample; similarity search has no threshold that guarantees inclusion of every document; and text‑to‑SQL can hallucinate a predicate that silently narrows the population.

The Adjudicated Query pattern explained

The pattern introduces a bounded conversational layer over a deterministic rules engine. The generative model in Amazon Quick does only two things:

  1. Translate a user’s natural‑language question into a call on a fixed set of typed operations (the MCP – Model Context Protocol – tools).
  2. Narrate the result that the rules engine returns.

At no point does the model generate raw SQL, modify the population, or make a compliance determination. All logic lives in a rules engine where:

  • Rules are versioned rows in a database, not hard‑coded branches.
  • Operators are limited to generic comparisons (gte, lte, equals, exists).
  • A sweep produces a completeness receipt – an invariant that compliant + in‑breach + ambiguous + unreadable = scanned. The receipt is asserted before any data is persisted, guaranteeing that no lease is silently skipped.

The user sees two surfaces in Amazon Quick:

  • A chat agent that returns counts, the receipt, and a small labeled sample.
  • An Amazon QuickSight dashboard that displays the full result set, drillable to the individual lease level.

Both surfaces read from the same Aurora Serverless v2 database, so the receipt is a single source of truth.

How it stacks up against other approaches

Approach Population coverage Proven completeness Defensibility
Semantic retrieval (RAG) A ranked sample Structurally impossible Partial
Generated queries (text‑to‑SQL) Claimed but unprovable Silent narrowing risk If modeled
Rules engine + BI (no chat) Exact and proven Yes Yes
Adjudicated Query Exact and proven Yes Yes

The table mirrors the source’s comparison and shows why the pattern is the only option that retains both completeness and defensibility while adding conversational convenience.

What actually changes for your compliance team

  • No more guesswork about coverage – The completeness receipt forces the system to account for every lease. If a record cannot be parsed, it ends up in an “unreadable” bucket that is reported rather than omitted.
  • Audit trails become automatic – Each rule change is a row edit; the engine records the rule version, citation, and the exact comparison used. When a finding is exported to the dashboard, the underlying data already contains everything needed for a legal defense.
  • Model risk is isolated – The generative model only formats the answer. In practice, the team observed two failure modes: the model stripped a citation tag and invented a statute, and it extrapolated a population‑wide range from a 20‑row preview. The pattern mitigates these by (1) using bracketed suffixes that survive paraphrase, (2) feeding the model the exact aggregates instead of letting it guess, and (3) repeating mode labels at multiple payload levels.
  • Operational overhead shifts – Instead of writing and maintaining custom SQL generators, the team maintains a rulebook table. Adding a new jurisdictional rule is a data‑entry task, not a code deployment, which reduces change‑management friction.
  • Cost profile changes – The heavy lifting (full‑population sweeps) runs in Aurora Serverless, which charges per compute second and storage. The generative model (Amazon Titan embeddings and Claude Sonnet) is only invoked for exploratory clause searches, keeping model‑inference spend low and predictable.

Teams that already use a BI dashboard for compliance will notice that the only new component is the chat‑to‑MCP layer. If your organization values conversational interfaces for non‑technical users, the added benefit outweighs the modest increase in infrastructure complexity.

Getting started today

  1. Clone the reference implementation – The GitHub repo contains synthetic lease data and a full CDK stack. git clone https://github.com/aws-samples/adjudicated-query-pattern.git.
  2. Verify Bedrock model access – In the AWS console, confirm that Amazon Titan Text Embeddings V2 and Anthropic Claude Sonnet 5 are enabled in your region (us‑east‑1 for the sample).
  3. Deploy the stack – With the AWS CLI configured, run cdk deploy. The deployment creates an Aurora Serverless v2 instance, Lambda functions, API Gateway, Cognito app client, and QuickSight datasource.
  4. Run a test sweep – Use the provided CLI command npm run sweep -- --date 2024-09-30 to execute a compliance sweep against the synthetic leases. After it finishes, open the QuickSight dashboard; you should see the completeness receipt confirming that all 10,800 test rows were accounted for.
  5. Try a natural‑language query – In Amazon Quick, ask “How many leases in California exceed the security‑deposit limit as of today?” The chat agent will translate the request, invoke the sweep_compliance tool, and return the count along with a link to the dashboard for drill‑down.

By following these steps you can validate the pattern on a small dataset, then replace the synthetic leases with your own CSV or database export. The same safeguards—receipts, versioned rulebook, bounded tool set—apply unchanged, giving you a provably complete compliance sweep without writing a single line of custom SQL.


Sources

Read next

We count page views without cookies — no identifier, nothing stored on your device. Accept to allow cookies for analytics.

How Amazon Quick’s Adjudicated Query lets compliance teams prove every lease was checked — practicalainotes