Data quality has always been one of those problems that refuses to stay solved. You write rules, data evolves, new edge cases emerge, and suddenly your carefully crafted validation logic is out of date.
What if AI could help? Not by replacing human judgement, but by accelerating the mundane parts of data quality management.
We've been building AI agents that do exactly this — and the results have been striking.
The Data Quality Problem
Traditional data quality approaches rely on human-defined rules. Someone has to:
- Analyse the data to understand distributions and patterns
- Identify potential quality issues
- Write validation rules
- Maintain those rules as data evolves
- Investigate alerts and determine root causes
This works at small scale. But as data volumes and sources grow, the manual effort becomes unsustainable. Most organisations end up in one of two states:
- Rule fatigue: Too many rules, too many false positives, alerts get ignored
- Rule poverty: Too few rules, issues slip through, downstream consumers lose trust
Enter AI Agents
An AI agent differs from a simple ML model in a crucial way: it can take actions, not just make predictions.
Our data quality agents don't just detect anomalies — they can:
- Generate rules based on statistical analysis of historical data
- Explain anomalies in natural language
- Suggest remediations based on similar past incidents
- Escalate appropriately based on impact assessment
What is an AI Agent?
An AI agent is a system that uses a large language model (LLM) as its reasoning engine, combined with tools that allow it to take actions in the real world — querying databases, calling APIs, or executing code.
Our Agent Architecture
We've developed a multi-agent architecture for data quality that consists of four specialised agents:
1. Data Profiler Agent
This agent continuously analyses incoming data to understand:
- Statistical distributions (mean, median, percentiles)
- Cardinality and uniqueness patterns
- Temporal trends and seasonality
- Null rates and completeness
- Format patterns and data types
The profiler builds a baseline model of what "normal" looks like for each dataset.
2. Rule Generator Agent
Using the profile data and any existing business rules, this agent:
- Suggests validation rules based on observed patterns
- Identifies columns that should have referential integrity
- Detects implicit constraints (e.g., "order_date is always before ship_date")
- Prioritises rules based on likely impact
Generated rules are presented to humans for review — the agent doesn't deploy them autonomously.
3. Anomaly Detector Agent
This agent monitors data in real-time against the baseline and rules:
- Flags statistical anomalies (values outside expected ranges)
- Detects pattern breaks (sudden changes in distribution)
- Identifies completeness issues (unexpected nulls)
- Catches referential integrity violations
Critically, it also assesses anomaly severity based on:
- How far outside normal the value is
- How business-critical the affected data is
- How many downstream systems are impacted
4. Remediation Suggester Agent
When an anomaly is detected, this agent:
- Retrieves similar historical incidents
- Analyses what remediation was applied
- Suggests a resolution approach
- Drafts communication for stakeholders
How We Built It
The Technology Stack
Our agents are built on:
- LLM backbone: Claude or GPT-4 for reasoning and natural language generation
- Vector database: For storing and retrieving similar past incidents
- Orchestration: LangGraph for multi-agent coordination
- Data platform: Snowflake or Databricks for profiling and rule execution
- Alerting: Integration with Slack, PagerDuty, or ServiceNow
The Prompt Architecture
Each agent has carefully crafted prompts that:
- Define its role and boundaries clearly
- Provide relevant context about the data domain
- Include examples of good outputs (few-shot learning)
- Specify output formats for downstream processing
Prompt engineering is crucial. A poorly constructed prompt will generate plausible but incorrect rules — the worst kind of failure mode.
Human-in-the-Loop
We deliberately keep humans in the loop for:
- Rule approval: Generated rules require human sign-off before activation
- Escalation decisions: High-severity anomalies route to humans
- Feedback: Humans can mark agent suggestions as helpful or not
This feedback improves agent performance over time.
Real-World Results
In a recent engagement with a global CPG company, our AI agents:
| Metric | Before | After | Change | |--------|--------|-------|--------| | Rules in production | 85 | 280+ | +230% | | Time to create a rule | 2-3 hours | 10 minutes | -95% | | Anomalies caught | ~60% | ~85% | +40% | | False positive rate | 35% | 12% | -65% | | Mean time to resolution | 4 hours | 45 minutes | -80% |
The key insight: agents don't replace data quality engineers — they amplify them.
Key Learnings
1. Start With Clear Objectives
AI agents need direction. Before building, define:
- What types of quality issues are you trying to catch?
- What's the acceptable false positive rate?
- Which datasets are highest priority?
2. Invest in Your Knowledge Base
The remediation suggester is only as good as its historical knowledge. Invest time in:
- Documenting past incidents and resolutions
- Tagging incidents by type and severity
- Building a searchable knowledge base
3. Monitor Agent Performance
Track key metrics over time:
- Rule acceptance rate (what percentage of suggested rules get approved?)
- Anomaly precision (what percentage of flagged anomalies are real issues?)
- Resolution accuracy (do suggested remediations actually work?)
4. Iterate on Prompts
Your first prompts won't be perfect. Plan for iteration:
- Log all agent outputs
- Review failures weekly
- Refine prompts based on patterns
What's Next
The future is autonomous data quality — systems that not only detect issues but resolve them. We're working on agents that can:
- Automatically correct obvious data errors (with audit trails)
- Enrich missing values from trusted sources
- Predict quality issues before they occur
- Self-tune based on feedback
Data quality doesn't have to be a constant battle. With AI agents, we can finally get ahead of the problem.