The Adjudicated Query Pattern: AI Compliance Sweeps You Can Prove Are Complete
AWS shows how to let users ask compliance questions in chat while a deterministic rules engine makes every pass/fail call, and every sweep must account for each record in a computed receipt.

A portfolio operator manages 50,000 apartment leases spread across several states. One state changes its late-fee cap or statutory notice period, and suddenly the compliance team has a difficult operational problem: identify every lease affected by the change, determine which agreements are now out of compliance and produce evidence that the entire relevant portfolio was examined.
Finding a few potentially problematic contracts is not enough. The team needs to know that every relevant lease was assessed, that the correct version of the applicable rule was used and that no document silently disappeared from the process because it was unreadable or ambiguous. Months later, during an audit or legal dispute, the organisation must be able to reconstruct what happened and demonstrate how each determination was reached.
This is a very different requirement from asking an AI assistant to search a document collection and summarise what it finds.
AWS has introduced a design pattern for this problem called Adjudicated Query, accompanied by a working reference implementation built around Amazon Quick [1] [2]. Its central idea is to let users interact with compliance systems through natural-language chat while keeping the actual compliance decisions outside the language model.
The model translates user requests into calls to a fixed set of approved operations and explains the results. A deterministic rules engine evaluates the records, while a separate completeness mechanism ensures that every record in an official sweep receives an accounted-for outcome.
The distinction is fundamental: AI provides the interface, but deterministic software makes the decisions and establishes the evidence.
The pattern is relevant beyond property management. Similar requirements arise in sanctions screening, insurance claims adjudication, export control and other high-stakes processes where a missed record can create legal, financial or operational consequences.
Why it matters
Compliance work is fundamentally different from ordinary information retrieval. A search system is designed to find relevant information, whereas a compliance process must establish what happened to every record within a defined population.
Two properties separate compliance from search [1:1].
Provable completeness.
Suppose a compliance team is asked to examine all 22,910 leases associated with a particular state. It is not sufficient to return a collection of documents that appear relevant or a list of contracts that match a search query.
The organisation needs to demonstrate that all 22,910 records were considered.
This means the system must distinguish between records that were assessed and records that were not. A lease that cannot be read, a document containing ambiguous language or a record that could not be evaluated must remain visible in the results.
If a document disappears from the processing pipeline because an extraction step failed, the system must not quietly treat the remaining records as the complete population.
This is the difference between producing a useful search result and producing an auditable compliance result.
A search engine can return the most relevant documents it finds. A compliance engine must account for the entire population it was instructed to examine, including documents that could not be conclusively evaluated.
Defensibility.
Completeness alone is not enough. An organisation must also be able to explain how each determination was made.
For every finding, it should be possible to establish which rule version was applied, which contractual clause was examined, what evaluation method was used, when the assessment occurred and who was responsible for the relevant approval or process.
Consider a situation in which a state changes its late-fee requirements. A lease assessed before the change may have been compliant under the earlier rule but require attention under the updated one.
If the organisation cannot identify which version of the rule was applied to the original assessment, reconstructing the decision becomes difficult.
The same problem arises when an auditor challenges a particular result. A compliance team needs more than a statement that an AI system considered the lease non-compliant. It needs a traceable relationship between the document, the applicable rule, the evaluation and the resulting finding.
This requires compliance decisions to be reproducible and associated with the appropriate rule versions and supporting evidence.
Why conventional RAG is insufficient
Retrieval-augmented generation (RAG) is useful for searching large collections of documents. It can retrieve relevant passages and provide them to a language model, which can then explain contractual clauses or answer questions about specific agreements.
However, similarity search does not provide a threshold that means every relevant record has been found [1:2].
A RAG system might retrieve the most relevant passages from a collection of leases, but that does not establish that it has examined every lease within the required population.
Even if the retrieved documents appear representative, the system cannot use that fact alone to prove completeness. A relevant document might not be returned because its wording differs from the query, because the relevant information is buried in an unexpected section or because the retrieval process ranks other passages more highly.
The problem is not that RAG is inherently unsuitable for compliance-related information. It is that retrieval relevance and exhaustive assessment are different requirements.
RAG can help a compliance professional understand a clause or locate relevant language. It cannot, by similarity search alone, establish that every record in a defined population has been evaluated.
Why text-to-SQL is not enough
Text-to-SQL appears to offer a more structured solution. A user asks a question in natural language, and a model translates it into a database query that retrieves the relevant records.
This is closer to the requirements of compliance because the system can operate against a defined database population rather than relying exclusively on semantic similarity.
However, AWS identifies a quieter risk: a hallucinated filter can shrink the population while the result still looks exact [1:3].
For example, a user asks for every lease associated with a particular state. The model generates a SQL query containing an incorrect or overly restrictive filter. The database executes the query successfully and returns a precise count.
The result may look authoritative because it comes directly from SQL. Yet the query has excluded records that should have been included.
The problem is that a technically valid query is not necessarily a semantically correct implementation of the user’s request.
A database can execute the instructions it receives without knowing whether those instructions represent the intended compliance population.
This creates a dangerous combination: the model can make an incorrect population decision, while the database returns an exact-looking result.
Adjudicated Query addresses this by removing population construction and compliance judgement from the model’s responsibilities. Instead of generating arbitrary queries, the model selects from a fixed set of reviewed operations whose population logic has been implemented and tested by people [1:4].
For organisations building AI over regulated data, this is a significant architectural distinction. Natural-language interaction does not require unrestricted access to the underlying decision-making process.
How it works
The Adjudicated Query pattern separates conversational interaction from the actual compliance evaluation. The model receives a limited set of operations, while a deterministic engine applies versioned rules to a defined population and produces auditable results.
Four design principles form the foundation of the approach.
The model’s job is narrow.
The language model translates a user’s question into a call on a fixed set of typed operations and then narrates the results [1:5].
It does not write SQL queries, decide which records belong in the compliance population or determine whether an individual lease passes or fails.
This separation is deliberate.
A user might ask, “How many leases in Texas exceed the current late-fee limit?” The model needs to understand the request and select the appropriate approved operation. It does not need to invent a database query or decide how the Texas lease population should be constructed.
The selected operation handles those responsibilities through predefined logic.
The model can then explain the resulting counts, findings and relevant caveats in conversational language.
This creates a clear boundary between interpretation and adjudication.
The model is responsible for understanding the user’s intent well enough to select an operation. The underlying system is responsible for implementing that operation correctly and applying the relevant rules.
The same distinction applies when users ask follow-up questions. The model can invoke additional approved operations, but it cannot independently redefine the population or bypass the rules engine.
The benefit is that conversational flexibility does not automatically translate into unrestricted computational authority.
Rules are data.
The second principle is that compliance rules are stored as versioned data rather than embedded as separate code branches [1:6].
The rulebook contains the rules, while the evaluation engine understands generic comparison operations such as greater-than and equals.
This distinction makes the rules engine independent of the individual legal requirements it evaluates.
For example, a rule might specify a maximum permitted late fee or a required notice period. The engine does not need a dedicated code branch for every state or compliance topic. It applies generic comparison logic to the relevant values defined in the rulebook.
When a regulation changes, the corresponding rule can be updated as a data record rather than requiring a new application deployment.
AWS describes this as a row edit rather than a code change [1:7].
This has several practical advantages.
First, it separates the maintenance of regulatory requirements from the implementation of the evaluation engine. Developers can maintain the generic comparison logic, while authorised business or compliance processes manage the rule data.
Second, versioning makes it possible to associate a determination with the specific rule version used at the time of assessment.
Third, the same engine can evaluate different compliance requirements without needing a separate implementation for every jurisdiction or topic.
The approach also makes the architecture easier to extend. Adding a new rule becomes a matter of defining the relevant data and ensuring that the existing generic operations can evaluate it, rather than introducing another collection of hard-coded conditions.
However, storing rules as data does not eliminate the need for governance. The rules still need to be reviewed, approved and associated with appropriate citations. A technically correct comparison against an incorrect or outdated rule will still produce an unreliable compliance result.
The architecture separates the rule engine from the rules themselves, but the quality and authority of the rulebook remain essential.
Every sweep produces a completeness receipt.
This is arguably the most important part of the pattern.
Every official compliance sweep must account for every record it scans. The results are divided into four categories:
- Compliant.
- In breach.
- Ambiguous.
- Unreadable.
The system asserts the following invariant:
[ \text{Compliant}+\text{In Breach}+\text{Ambiguous}+\text{Unreadable} =\text{Scanned} ]
In other words, the total number of records assigned to the four outcome categories must equal the number of records in the population that was scanned [1:8].
Consider a sweep involving 22,910 leases.
If the system reports 21,500 compliant leases, 900 leases in breach, 300 ambiguous records and 210 unreadable documents, the total is 22,910.
The system has accounted for the complete population.
Now imagine that the processing pipeline silently drops 15 documents because an extraction operation fails. The remaining results would account for only 22,895 records.
The completeness check would fail.
This is the critical difference between a compliance system that merely produces findings and one that can demonstrate that every record received an outcome.
The receipt is computed and asserted before anything is saved. A run that cannot account for every record does not finish [1:9].
The system therefore cannot simply publish a partially evaluated population as though it were a completed compliance sweep.
The four categories also prevent the system from treating uncertainty as compliance.
An ambiguous lease is not automatically compliant. An unreadable document is not automatically excluded from the results. Both remain explicitly represented in the receipt.
This is especially important in high-stakes workflows because an organisation needs to know where human attention is required. A compliance report that contains only compliant and non-compliant records can hide uncertainty by forcing every document into a binary outcome.
The completeness receipt preserves the distinction between a confirmed determination and a record that requires further examination.
Six tools, each with clear semantics.
The MCP server exposes six tools, each designed for a specific operation with clearly defined behaviour [1:10].
The most important distinction is between official compliance sweeps and exploratory operations.
An official sweep is exhaustive and writes findings. It evaluates the defined population against the applicable rules and produces the records and receipt required for an auditable determination.
An exploratory what-if operation serves a different purpose. It returns directional counts without recording official compliance findings.
For example, a user might want to understand how a hypothetical change in a threshold could affect the number of leases requiring attention. That is useful for analysis, but it should not be confused with an approved compliance assessment.
Semantic clause search is another distinct operation. It retrieves a ranked sample of relevant contractual passages, helping users locate clauses and understand the language in individual documents.
However, it cannot answer questions such as “How many leases are in breach?” because a ranked semantic sample is not an exhaustive evaluation of the full population [1:11].
The tool design therefore makes the semantics of each operation explicit.
A user can explore potential outcomes, locate contractual language or initiate an official sweep, but these operations do not have interchangeable guarantees.
The distinction matters because a language model might otherwise present an exploratory result as though it were an official compliance determination.
By exposing a fixed set of operations whose population logic has been written and tested by people, the architecture prevents the model from composing its own potentially incorrect population definition [1:12].
The model chooses an operation; the operation determines how the records are selected and processed.
The architecture.
AWS’s reference implementation combines Amazon Quick, MCP, AWS Lambda, API Gateway, Amazon Cognito, Aurora Serverless v2 and Amazon Bedrock [1:13].
<text weight=“semibold” color=“default”>The request and execution flow</text>
- User interaction: Amazon Quick provides the chat agent through which users ask compliance questions. It also provides a Quick Sight dashboard for viewing the results.
- Authentication: The agent authenticates through Amazon Cognito, establishing the user’s identity before accessing the compliance operations.
- Tool invocation: The chat agent calls an MCP server hosted on AWS Lambda through API Gateway.
- Rule evaluation: Lambda executes the deterministic rules engine against the defined lease population and applicable rulebook.
- Data storage: Aurora Serverless v2, using PostgreSQL with pgvector, stores the rules, leases, findings and sweep runs.
- Exploratory search: Amazon Bedrock is used for exploratory clause search, but not for official compliance determinations.
The choice of Aurora as the central store is particularly relevant to the completeness design. Rules, leases, findings and execution records are held together in one data store, allowing the system to compute the completeness receipt through SQL counts [1:14].
The receipt is therefore not a narrative generated by the language model. It is calculated from the underlying records.
This gives the architecture a clear separation of responsibilities:
- Amazon Quick provides the conversational interface and dashboard.
- Cognito handles authentication.
- MCP exposes the approved operations.
- Lambda executes the deterministic business logic.
- Aurora stores the records and supports the database checks.
- Bedrock supports exploratory semantic clause search.
Keeping Bedrock outside the official determination path is an important design choice. The model can help users find and understand relevant clauses, but the official pass/fail decision remains with the deterministic rules engine.
The architecture therefore combines conversational accessibility with a controlled execution layer. Users can interact with the system naturally without giving the language model unrestricted authority over the compliance process.
Treat the summarizing model as untrusted
One of the most practical lessons from AWS’s implementation concerns the final stage of the workflow: presenting results to the user.
Even when the underlying rules engine produces correct findings, the chat model can misrepresent them while generating a summary.
AWS observed two revealing behaviours. In one case, a model removed an “illustrative” label and presented an invented citation as though it were statutory authority. In another, it extrapolated a population-wide range from only 20 preview rows [1:15].
These examples highlight a problem that can be easy to overlook when designing AI systems around deterministic backends.
Making the underlying decision process reliable does not automatically make the generated explanation reliable.
A model may receive correct results and still introduce unsupported statements, remove important qualifications or present a limited sample as a complete population.
For compliance applications, this can undermine the value of the entire architecture. The decision engine may be correct, but a misleading explanation can cause users to misunderstand the result or rely on information that was never established.
AWS identifies three fixes [1:16].
Write caveats as bracketed suffixes repeated at several levels of the payload.
Important qualifications should not appear only as introductory labels or explanatory text that the model can easily omit.
AWS recommends placing caveats in bracketed suffixes and repeating them at multiple levels of the payload.
The reasoning is practical: a leading label can be removed when the model rewrites or summarises the content. A qualification repeated alongside the relevant data has a better chance of surviving that transformation.
For example, an exploratory result should carry its illustrative status alongside the result itself rather than relying entirely on a sentence at the beginning of the response.
This helps preserve the distinction between information that can be used for exploration and information that represents an official determination.
Compute real aggregates over every record and give them to the model.
A summarising model should not be expected to calculate portfolio-wide statistics from a preview sample.
AWS recommends computing the actual aggregates over the complete population and supplying those results directly to the model [1:17].
If the user asks how many leases are affected, the database should perform the count over the defined population. The model should receive the resulting number and explain it.
The same principle applies to ranges and other aggregate measurements. The model should not infer population-wide statistics from a small collection of example records.
This separates calculation from explanation. SQL produces the aggregate, while the language model communicates the result.
Repeat mode labels at multiple levels.
The third recommendation is to repeat official-versus-exploratory mode labels at the field, string and summary levels [1:18].
A single label can disappear during summarisation. Repeating the distinction in multiple places makes it less likely that the final response will present exploratory information as an official result.
This is especially important when a conversation contains several kinds of operations.
A user may first request a hypothetical assessment and then ask for an official compliance sweep. The two results may discuss the same lease population but carry different levels of authority.
The response needs to preserve that distinction throughout the interaction.
Together, these recommendations establish an important principle: the summarising model should be treated as an untrusted presentation layer, even when the underlying data and decision process are deterministic.
It can explain the results, but it should not be trusted to preserve every qualification automatically or invent missing calculations.
What data and AI engineers should do
The Adjudicated Query pattern offers several practical design principles for teams building AI applications over regulated or business-critical data.
Keep AI out of the decision path when a missed record is a liability.
A language model is useful for translating user intent into an approved operation and explaining the resulting information. It should not independently decide which records belong in the compliance population or whether a particular record passes or fails.
This separation is particularly important when the cost of a missed record is high.
A model-generated SQL query may be syntactically valid but still contain an incorrect filter. Similarly, an LLM-based judgement may overlook a contractual detail or interpret an ambiguous clause incorrectly.
For official determinations, the decision logic should be implemented in a controlled evaluation engine with clearly defined inputs and outputs.
Store rules as versioned data with citations and approvers.
Compliance requirements change, and the system needs to preserve which version of a rule was used for each determination.
Rules should therefore be represented as versioned records rather than hidden inside application code.
Each rule should also have an associated citation and approval information so that the organisation can establish its authority and provenance.
The generic rules engine can then apply the appropriate comparisons without needing separate code branches for individual jurisdictions or regulatory topics.
When a requirement changes, the relevant rule record can be updated through the governance process rather than requiring the engine itself to be rewritten.
Assert a completeness invariant before saving any sweep.
The completeness receipt should be a mandatory condition of a successful official run.
Every scanned record must belong to one of the defined outcome categories: compliant, in breach, ambiguous or unreadable.
If the counts do not balance, the system should not save the sweep as a completed assessment [1:19].
This prevents failed extraction, processing errors or missing records from silently reducing the population.
Unreadable documents should be identified explicitly rather than dropped. Ambiguous records should remain visible for further review.
Make findings append-only.
Compliance findings need to remain defensible over time.
AWS’s sample does not permit UPDATE or DELETE operations on findings [1:20].
This append-only approach prevents an existing finding from being silently overwritten or removed. New assessments can produce new findings while preserving the history of earlier results.
For example, when a regulatory requirement changes, a new sweep can assess the relevant records against the updated rule version. The earlier findings remain available rather than being replaced by the latest results.
This supports the ability to reconstruct what the organisation knew and what determination it made at a particular point in time.
It also reinforces the distinction between a historical assessment and a new assessment under different rules.
Put volume on a dashboard, not in chat.
A compliance sweep involving thousands of leases can produce a substantial result set. Trying to present all of that information inside a conversational response is neither necessary nor particularly useful.
AWS recommends keeping the chat response focused on counts, the completeness receipt and a link to the full results [1:21].
Amazon Quick’s dashboard provides the appropriate place to browse the detailed findings.
This creates a division between conversational interaction and detailed operational reporting.
The chat interface helps users initiate assessments, ask follow-up questions and understand the headline results. The dashboard provides access to the full result set, where users can inspect individual records and investigate exceptions.
The result is a more practical user experience without sacrificing the completeness of the underlying assessment.
Limitations and open questions
The Adjudicated Query pattern provides a strong architectural approach to auditable compliance sweeps, but it does not eliminate every source of uncertainty.
The first limitation is that the reference implementation uses synthetic data and runs in a single AWS Region [1:22] [2:1].
This makes it a useful demonstration of the architecture, but does not establish how the complete system will behave across every production environment or document collection.
Real-world lease portfolios can contain varied document formats and contractual language. The quality of the final determination depends on the ability to extract the relevant clauses and values accurately before applying the rules.
The rules engine itself is deterministic, but deterministic execution does not guarantee that its inputs are correct.
If a clause is extracted incorrectly, the engine may apply the correct comparison to the wrong value. If the applicable rule has been defined incorrectly, the resulting determination can still be wrong.
The second limitation concerns ambiguous and unreadable documents.
The completeness receipt ensures that these records are accounted for, but it does not automatically resolve them. Ambiguous and unreadable leases still require human involvement [1:23].
This is an important distinction. Provable completeness does not mean every record can be classified automatically.
Instead, it means the system can demonstrate that every record was considered and identify those that could not receive a definitive automated determination.
Human review remains necessary where the evidence is insufficient or the contractual language requires interpretation beyond the capabilities of the extraction and evaluation process.
The third limitation is the fixed set of approved operations.
The model cannot freely compose new database queries or invent new compliance operations. This restriction is intentional because it prevents the population-selection and decision logic from being generated dynamically by an LLM.
However, it also limits the range of questions users can ask.
When a new compliance requirement emerges, the system may need a new reviewed operation with clearly defined population logic and evaluation behaviour.
This introduces an additional development and governance step. Teams must balance the flexibility of the conversational interface against the need to keep the underlying operations controlled and predictable.
The fixed-operation approach is therefore not an attempt to make every possible natural-language question executable. It is a way to make supported questions safe and auditable.
There is also a broader implementation consideration: the architecture is not exclusive to AWS.
Teams outside the AWS ecosystem can apply the same design principles using another chat interface, a versioned rules store and an MCP server [1:24].
The important components are the separation of conversational interaction from adjudication, the use of deterministic evaluation, the preservation of rule versions and the completeness invariant.
AWS provides a concrete reference implementation, but the underlying pattern is applicable beyond a particular cloud platform.
The most important open challenge is ensuring that every stage before and after adjudication preserves the same level of discipline.
Clause extraction must be reliable enough to supply meaningful inputs. Rules must be correctly defined and governed. The execution process must account for every record. Findings must retain their history. Finally, the summarising model must communicate the results without changing their meaning or overstating their authority.
Adjudicated Query addresses the architecture of the decision process, but the quality of a real compliance system still depends on how carefully these individual responsibilities are implemented.
Key takeaways
- Adjudicated Query allows users to ask compliance questions through chat while a deterministic rules engine makes the actual pass/fail decisions. The model selects approved operations and explains results rather than generating queries or making compliance judgements. [1:25]
- Every official sweep produces a completeness receipt satisfying the invariant: compliant + in breach + ambiguous + unreadable = scanned. A run that cannot account for every record does not finish. [1:26]
- Rules are stored as versioned data and evaluated through generic comparison operations, allowing regulatory changes to be handled through rule updates rather than application-code deployments. [1:27]
- The architecture uses Amazon Quick, MCP, Lambda, API Gateway, Cognito, Aurora Serverless v2 and Bedrock, with Bedrock restricted to exploratory clause search rather than official determinations. [1:28]
- The summarising model must be treated as untrusted: repeat caveats, calculate aggregates over the complete population and preserve official-versus-exploratory labels throughout the response. [1:29]
- For data and AI engineers, the broader lesson is to use AI for access and explanation while keeping high-stakes decisions deterministic, traceable and independently verifiable. [1:30]
Sources
AWS Machine Learning Blog, “Sweep thousands of leases for compliance using Amazon Quick and the Adjudicated Query pattern”, 2026-10-02. https://aws.amazon.com/blogs/machine-learning/sweep-thousands-of-leases-for-compliance-using-amazon-quick-and-the-adjudicated-query-pattern/ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎
GitHub, “aws-samples/sample-quick-adjudicated-query”. https://github.com/aws-samples/sample-quick-adjudicated-query ↩︎ ↩︎
Discussion
Join the discussion: create a free account or sign in to comment.
No comments yet.