Skip to main content

Generate DQ Rules (AI-Powered)

Overview​

AI-assisted bulk is a rule-creation path inside Data Quality → Rules → Add rule that automatically creates data quality rules from source database objects and imports them into a Quality Hub. It analyzes the schema/metadata of selected tables and generates a starter set of validation rules, reducing manual effort.

Key Features​

  • AI-Powered Rule Generation - Automatically generates DQ rules based on schema metadata
  • Multi-table, multi-rule in one shot - Select many tables at once and generate rules for all of them together
  • DQ Hub Integration - Generated rules import straight into a target Quality Hub

Business Value​

  • Reduces manual effort in creating data quality rules
  • Ensures consistency in data quality monitoring
  • Accelerates data governance initiatives
  • Provides a baseline rule set you can refine afterward

Prerequisites​

1. Source Data Source Configuration​

Before using this feature, ensure:

  • The source data source (e.g. PostgreSQL) is configured and connected in Data Explorer
  • User has appropriate permissions to access the source data source
  • Database tables/objects are accessible and metadata is available

2. Target Quality Hub Configuration​

tip

Ensure the source data source is tested and connected before attempting rule generation.


Use Cases​

The scenarios below are conceptual and still apply regardless of the UI changes — only the mechanics of generating rules (Steps 1–4 below) have changed.

Use Case 1: Onboarding New Database to DQ Framework​

Scenario: A new production database needs to be monitored for data quality.

Steps:

  1. Configure source data source connection
  2. Identify all critical tables in the database
  3. Generate DQ rules for these tables
  4. Review and adjust generated rules in the Quality Hub

Benefits:

  • Quick onboarding of new databases
  • Automated rule creation saves time

Use Case 2: Migration Quality Assurance​

Scenario: Validating data quality during database migration.

Steps:

  1. Generate DQ rules from the source system
  2. Apply the same rules to the target system
  3. Compare rule execution results between systems
  4. Identify discrepancies and data integrity issues

Benefits:

  • Ensures data integrity during migration
  • Automated validation process
  • Consistent quality checks across environments

Use Case 3: Compliance Monitoring​

Scenario: Ensuring regulatory compliance through data quality checks.

Steps:

  1. Identify compliance-critical tables (e.g., customer data, financial records)
  2. Generate DQ rules for these tables
  3. Monitor violations via Incidents and configure alerts via each rule's Notifications sub-tab

Benefits:

  • Proactive compliance monitoring
  • Automated alerting for violations

Use Case 4: Data Profiling and Discovery​

Scenario: Understanding data patterns and quality issues in existing databases.

Steps:

  1. Run DQ rule generation for all critical tables
  2. Review generated rules to understand data patterns
  3. Identify quality issues (nulls, duplicates, format violations)
  4. Implement remediation strategies

Benefits:

  • Data discovery and profiling
  • Pattern identification
  • Quality issue detection

Step-by-Step Usage Guide​

Step 1: Pick a data source​

Navigation: Data Quality → Rules tab → Add rule → AI-assisted bulk → Continue

The "AI-assisted rule creation" wizard opens: "Pick a data source + the objects you want covered. We'll suggest the rules that usually catch real bugs and bulk-create them."

  • Data Source field — a searchable dropdown of existing connections (e.g. a PostgreSQL database), grouped by type

Pick a data source

note

The data source must already be configured and connected in Data Explorer before it appears here.


Step 2: Pick objects to monitor​

Once a data source is selected, the wizard shows a checkbox list of its tables:

  • Filter box to search tables by name
  • Select all visible / Clear actions
  • Each row shows the table name and its schema (e.g. quickstart.public)

Pick objects to monitor, and tune defaults + generate

note

Pick objects to monitor, Tune defaults + generate (Step 3), and Review suggestions (Step 4, once you've generated) all appear on the same scrolling page in the wizard — you don't navigate away between them.

Selection guidance (still applies):

  • Business Criticality - Focus on high-value business data
  • Compliance Requirements - Include regulatory-required tables
  • Data Volume - Start with critical tables before scaling
  • Data Change Frequency - Prioritize frequently updated tables
tip

Start with a handful of critical tables rather than selecting everything at once.


Step 3: Tune defaults + generate​

The third stage shows what Generate rules will use, lets you set the destination and kicks off generation:

  • An AI context panel holds a Will use line, which says what the click will use, before you make it: "Will use: default prompt v3 · model OpenAI · hub Sales_DQ". It names the prompt, the AI model and the hub.
    • Prompt — default prompt vN (the shipped prompt), built-in default prompt, or your custom prompt (a prompt an admin saved for this kind of data source).
    • Model — the AI source's name, with the model name in parentheses when one is set, for example OpenAI (gpt-4o). "model none" means no AI model is set up; bind one under Manage → Integrations: a source of your own, or ask an admin to bind one for everyone (binding means choosing which AI source the platform uses).
    • Hub — the hub the rules will be created in (below).
    • Click the panel's header to open or fold it. It opens by itself when something needs your attention, such as a custom prompt or no AI model.
  • Target DQ Hub — select the destination Quality Hub for the generated rules. With one hub, it is already chosen. With several, the hub you last generated rules into, in this browser, is chosen when you open the wizard (the Will use line names it, so check it before you generate). If you have not generated into one yet, none is chosen: the line reads "hub none chosen yet" and Generate rules stays off until you pick one. With none at all, the wizard says so and links to Data Sources, where you create a DQ Hub first (the steps are in Data Quality → Step 1: Create a Quality Hub).
  • A note confirms the defaults: "Generated rules default to Low severity / Accuracy — you can edit each suggestion before creating."
  • Click Generate rules

When a custom prompt is in use, an admin (a user with tenant admin rights) sees a Reset to default prompt button. It asks first: the prompt is shared, so the reset changes it for everyone who generates rules for that kind of data source, and your custom prompt is not deleted: every saved version stays on record. Anyone who is not an admin sees "Ask an admin to reset it to the default." instead of the button.

Change the prompt or add context for one run. Open the AI context panel:

  • PROMPT reads the usual prompt until you choose. Click Change to see the saved versions of the rule prompt (they come from the Command Registry), pick one and click Use this version. The badge then reads, for example, v2 chosen for this run, and the Will use line reads prompt v2 (your choice). Your choice does not change the shared prompt. It stays for every Generate rules click until you pick another data source or leave the wizard, and it is not remembered after that. If a custom prompt is in use, your choice replaces it for this run.
  • CONTEXT adds material the AI reads to understand your data. Click Data source to attach what other data sources know about your data (only data sources that have search turned on are listed; pick up to 3 and click Done; very long context is cut to fit), or File to upload one file (a new upload replaces the earlier one; at most 2 MB; text, CSV, PDF, JSON, XML, HTML, Markdown, Python, JavaScript or TypeScript). Each item appears as a chip you can remove, and the Will use line adds "· 1 context item". The prompt's instructions and the output format still apply; the context only helps the AI understand the data. If a file is refused or fails to upload, a message appears and nothing is attached.
  • If a context item cannot be used, the line under Generate rules says so, for example "Generated with prompt v2 · 1 context source was left out", and the rules are still created from the rest.
note

For a data source that someone else has shared with you, the Will use line cannot be shown; it says "What will run can't be shown for a source that isn't yours. Generate rules still works." If the line cannot be loaded for any other reason, it reads "Couldn't load what will run." with a Retry link. Either way, Generate rules still works, but the PROMPT and CONTEXT controls are not shown until the line loads.

important

Generating suggests rules — it does not create them yet. Each selected table gets one AI call proposing rules for it; nothing is written to your Quality Hub until you explicitly accept and create them in the next step.

When generation finishes, a line under the button says how the rules were made: "Generated with default prompt v3", followed by "· N tables failed" if some tables could not be generated.

A batch is capped at 25 tables per generate. If you select more, unselect some or run additional passes afterward.


Step 4: Review suggestions​

Once generation finishes, a fourth section appears: "Review N of M suggestions" — every suggested rule, grouped by the table it belongs to, all accepted by default.

For each suggestion you can see:

  • The rule name and target column(s)
  • A plain-language description of what it checks
  • The exact name it will be created with
  • What it checks, shown one of two ways depending on the rule's type:
    • Structured rules (e.g. not null, unique, range, allowed values, pattern match) show a kind label plus the settings that make it up — no SQL to read, because the platform compiles it for you at run time.
    • Custom SQL rules (needed for checks that span multiple columns or tables) show an expandable "View SQL condition" so you can inspect the generated SQL before accepting it.

Actions per suggestion:

  • Uncheck it to exclude it from creation (without deleting it from the list)
  • Click the trash icon to remove it from the list entirely
  • Edit the rule name, target column(s), severity and dimension before you create it, and, for a custom SQL rule, its SQL condition (the description and a structured rule's settings are read-only here)

If any table failed to generate, a warning banner lists which ones and why — the rest of the batch is unaffected. If you change your table selection after generating, a banner prompts you to generate again before creating.

When you're happy with the selection, click Create N rules (the button label updates live with your count). Only then are the accepted rules written to the target hub — you'll see a confirmation toast ("Created N rules in <hub name>") and land back on the Rules tab.


Step 5: Review created rules​

Navigation: Data Quality → Rules tab — newly created rules appear in the rule list like any other rule, filterable via the "Just created" preset.

  1. Examine Rule Details — open a rule to review its Definition tab for severity, dimension, and category
  2. Open its Conditions tab to see the exact SQL logic that was created for that table/column
  3. Adjust any defaults that don't match your business requirements

Step 6: Customize and execute rules​

  1. Customize Rules as Needed
    • Open the rule's Definition tab to adjust Severity, Category, Description
    • Open Conditions to adjust the underlying SQL or assertions
  2. Execute Rules
    • Click Run rule to trigger immediate execution
  3. View Results
    • Open the rule's Results sub-tab to see the run history (pass/fail per run)
note

See Data Quality → Step 3: Manage and inspect rules for the full breakdown of a rule's detail tabs.


Best Practices​

1. Object Selection​

Do:

  • Start small with a handful of critical tables before scaling
  • Prioritize business-critical and compliance-required tables
  • Group related tables together for consistent rule generation

Don't:

  • Rely on "Select all visible" for a large schema — generation is capped at 25 tables per batch; anything beyond that is silently skipped (with a toast telling you how many were skipped)
  • Generate rules for temporary or staging tables
  • Skip validation of source data accessibility

2. Rule Management​

After Generation:

  • Always review and validate generated rules before relying on them in production
  • Customize rule parameters (severity, category, description) to match business requirements
  • Set appropriate severity levels based on business impact

Ongoing Maintenance:

  • Periodically review rule effectiveness
  • Update rules when schema changes occur
  • Delete or disable obsolete rules

Troubleshooting​

Issue 1: Rule Generation Fails​

Symptoms:

  • Error message displayed during generation
  • No rules created in the target hub

Possible Causes:

  • Source data source connectivity issues
  • Insufficient permissions
  • Invalid schema or table selection

Solutions:

  1. Read the message in the wizard — it names the cause and the next step (see the table below)
  2. Verify the source data source's connection status via Test Connection (in Data Explorer)
  3. Check user permissions on both the source data source and the target Quality Hub
MessageWhat to do
No AI model is set up for rule generationBind (choose) an AI model under Manage → Integrations: a source of your own, or ask an admin to bind one for everyone
The AI model for rule generation hasn't been shared with youAsk an admin to share the AI source with you
The AI model for rule generation can't be reached right nowTry again in a minute, or ask an admin to check Manage → Integrations
The AI model didn't accept the requestTry again; if it keeps failing, ask an admin to check the AI model and the rule prompt
This table's columns couldn't be readRefresh the data source's metadata, then try again
The data source couldn't be readTry again in a moment
This data source wasn't found for your accountCheck that the source still exists and is shared with you
The rule prompt can't be usedThe prompt text has a curly brace, such as a stray {, that is not one of the generator's own placeholders. Fix the prompt text, or ask an admin to reset it to the default
The prompt version you chose isn't available any more (the version was removed after you picked it)Click Change in the AI context panel and choose another version
The saved prompt versions couldn't be read right nowTry again in a moment
The AI's answer for this table was cut offTry a table with fewer columns
The AI's answer couldn't be read, The AI returned nothing, The AI suggested a rule that isn't valid SQLTry again
The request was incompleteReload the page and try again
Rule generation failedTry again; if it keeps failing, contact an admin

Issue 2: Created Rules Not Appearing​

Symptoms:

  • You clicked Create N rules but the rules aren't visible in the Rules tab

Possible Cause:

  • Generating only suggests rules — if you didn't click Create N rules on the Review suggestions step, nothing was ever written to the hub

Solutions:

  1. Confirm you actually clicked Create N rules (not just Generate rules) and saw the success toast
  2. Refresh the Data Quality page
  3. Confirm you're viewing the correct target hub — filter or search by hub name in the Rules list
  4. Use the "Just created" preset to quickly find recently generated rules

Issue 3: Incorrect or Unexpected Rules​

Symptoms:

  • Generated rules don't match expected patterns
  • Rule logic seems incorrect

Solutions:

  1. Review table metadata (data types, constraints) for the selected tables
  2. Customize generated rules (Definition/Conditions tabs) to match business requirements
  3. Delete unwanted rules and create manual rules instead if needed

Appendix​

Supported Data Source Types​

Only these source types appear as pickable in the "Pick a data source" step:

Data Source TypeAI-assisted bulk support
MySQLYes
PostgreSQLYes
SQL ServerYes

Other connected data source types (e.g. AI model providers, DQ Hubs themselves) don't appear here — only source databases the AI can read schema/metadata from.


  • Data Quality - Quality Hubs, rule creation, Overview, and Incidents