<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Joshua Zhangzy on Medium]]></title>
        <description><![CDATA[Stories by Joshua Zhangzy on Medium]]></description>
        <link>https://medium.com/@joshua.zhangzy?source=rss-e00d284b2dee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NgGnx72svbFmsAji</url>
            <title>Stories by Joshua Zhangzy on Medium</title>
            <link>https://medium.com/@joshua.zhangzy?source=rss-e00d284b2dee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 16:58:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joshua.zhangzy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Engineering an Agentic AI Workflow to Improve Data Quality]]></title>
            <link>https://medium.com/csit-tech-blog/engineering-an-agentic-ai-workflow-to-improve-data-quality-6197dd786400?source=rss-e00d284b2dee------2</link>
            <guid isPermaLink="false">https://medium.com/p/6197dd786400</guid>
            <category><![CDATA[data-quality-engine]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[llm-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Joshua Zhangzy]]></dc:creator>
            <pubDate>Tue, 09 Dec 2025 07:15:48 GMT</pubDate>
            <atom:updated>2025-12-09T07:15:48.257Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Authors: </em><a href="https://medium.com/u/1510ce07f03d"><em>Xavier Lek</em></a><em>, </em><a href="https://medium.com/u/e00d284b2dee"><em>Joshua Zhangzy</em></a>, <a href="https://medium.com/u/5bea67f5ec65"><em>Loy Yoke Yue</em></a><em>, </em><a href="https://medium.com/u/26e8aac21490"><em>Wayne Q.</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Beufh15-_vXchZ-JbQGXpA.jpeg" /></figure><h4>The Rising Cost of Poor Data Quality in the AI Era</h4><p>In any data-driven organisation, trust in data begins with quality. It determines how confidently we can make decisions, measure outcomes, and build AI systems that people can rely on.</p><p>In the age of AI, gaps in data quality become increasingly costly. Models are only as good as the data they learn from, and even small inconsistencies can have outsized impacts. A renamed column or mismatched date format can quietly skew metrics, break joins, or bias predictions.</p><h4>The Need for a Unified, Intelligent Solution</h4><p>Our data ecosystem is deeply interconnected. Data producers create and update source data, data owners provide business context, data engineers build the pipelines, and data consumers rely on the outputs for insight and decision-making. When quality fails at any point, dashboards break, analysis stalls, and confidence in AI results drops.</p><p>It was evident that our fragmented approach to data quality management was not sustainable. With each team operating in silos, inefficiencies piled up. Therefore, instead of having every team manage data quality in isolation, we set out to explore a unified, intelligent capability that could scale across the organisation. Moreover, since we operate in a secure, air-gapped environment, the solution had to be entirely on-premises.</p><h3>Manual Data Quality Checks and Monitoring</h3><h4>Decentralised and Manual Practices</h4><p>Currently, quality assurance is a fragmented effort. Each team independently defines, implements, and maintains their own validation checks. Data engineers spend countless hours deciphering datasets, consulting business stakeholders to map semantics and lineage, and then creating tailored validation rules.</p><p>With <strong>thousands of datasets</strong> spanning diverse operational systems with evolving fields, our manual, team-specific approach to data quality management would not be scalable. Teams strained to balance day-to-day operations with the growing burden of maintaining custom validation rules, resulting in inconsistent coverage. As gaps in monitoring widened, undetected data quality issues multiplied across our pipelines, a clear sign we needed a fundamentally better solution.</p><h4>Security Constraints in Air-Gapped Environments</h4><p>Operating within a <strong>government domain</strong> adds further complexity. Our <strong>air-gapped environment</strong>, designed to protect sensitive data, restricts access to external cloud-based tools and APIs. Consequently, we cannot leverage emerging <strong>cloud-native data observability platforms</strong> or <strong>AI-assisted monitoring tools</strong>. Innovation in this space required bespoke engineering solutions that align with stringent compliance and deployment requirements.</p><h4>Evaluating AI-Driven Data Quality Management COTS Alternatives</h4><p>The advent of <strong>Large Language Models (LLMs)</strong> and their <strong>reasoning capabilities</strong> introduced a new paradigm for scaling data understanding and automation. We explored <strong>Commercial-Off-The-Shelf (COTS)</strong> solutions that use <strong>Generative AI</strong> for data quality management, assessing their ability to meet operational and technical needs.</p><p>Key Evaluation Criteria</p><p>1. <strong>Air-gapped:</strong> Support for <strong>environments</strong> without external connectivity.</p><p>2. <strong>Interoperability:</strong> Seamless integration with any data pipeline, regardless of stack or framework.</p><p>3. <strong>AI-Driven Intelligence:</strong> Ability to autonomously infer dataset context and generate <strong>data quality test rules</strong>.</p><p>4. <strong>Augmented Remediation:</strong> Provision of <strong>data correction suggestions</strong> based on detected anomalies.</p><p>Despite evaluating multiple COTS offerings, none met all our stringent requirements above, particularly regarding air-gapped deployment and deep pipeline integration. This gap drove us to build our own <strong>Agentic AI Data Quality Engine</strong>.</p><h3>Using Agentic AI to Automatically Identify, Monitor, and Suggest Fixes for Data Quality</h3><p>The core idea behind CSIT’s Agentic AI Data Quality Engine is to eliminate the need for manual rule creation and validation by leveraging an intelligent multi-agent system. Developed as part of a 2025 innovation programme at CSIT, the prototype demonstrated how autonomous AI agents could collaboratively manage the end-to-end lifecycle of data quality management.</p><h4>Agentic AI Workflow Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*qJJ-mXkwO7io4RgHKoMVzw.png" /></figure><p>Our architecture follows a <strong>multi-agent swarm pattern</strong>, comprising the following agents:</p><p>· <strong>Data Profiler Agent:</strong> Performs dataset profiling to detect schema, data types, and statistical distributions.</p><p>· <strong>Generate Expectation Agent:</strong> Leverages LLM reasoning to produce data quality rules using templated prompts and contextual understanding.</p><p>· <strong>Validate Expectation Agent:</strong> Executes and validates generated rules, identifying any syntactic or logical issues.</p><p>· <strong>Add Expectation Agent:</strong> Adds the validated generated rule into the Great Expectation test suite.</p><p>· <strong>Fix Expectation Agent:</strong> Suggests corrections for invalid rules.</p><p>· <strong>Test Execution Agent:</strong> Manages the enforcement and evaluation of rules.</p><p>· <strong>Report Alerting Agent:</strong> Consolidates results into reports for data owners, engineers, and consumers.</p><p>A <strong>Central Controller (Generate Expectations Agent)</strong> orchestrates task delegation, ensuring reliable inter-agent communication and context management throughout the process.</p><h3>Tech Stack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*YJJVqG2SaxbTyPjP9FeLew.png" /></figure><p>· <strong>Streamlit</strong> — Lightweight user interface</p><p>· <strong>OpenAI Python SDK</strong> — LLM-based reasoning and generation</p><p>· <strong>YData Profiling</strong> — Dataset profiling and metadata extraction</p><p>· <strong>Great Expectations</strong> — Data quality expectation generation and validation</p><p>· <strong>Microsoft AutoGen</strong> — Agentic orchestration framework</p><p>· <strong>FastAPI</strong> — Single API endpoint for data pipeline integration</p><p>· <strong>SQLite</strong> — Persistent storage for profiling metadata and validation results</p><h4>The 3 Key Technical Challenges Faced During Development</h4><p><strong>Taming Non-Determinism with Self-Healing Agents and Tool-Augmented Execution<br></strong>One of the most persistent challenges in using LLMs for automated rule generation is their inherent unpredictability. Even with identical prompts, the same model can produce different outputs, some of which may violate schema constraints or fail during execution. To mitigate this, we implemented a closed-loop correction system where agents follow a “Generate → Validate → Reflect → Repair” cycle. The Validation Agent checks each rule for correctness, and if an error is detected, the Fix Agent regenerates it using structured feedback, including schema violations and contextual metadata. This ensures that all rules are syntactically valid before execution, eliminating manual fixes.</p><p>Additionally, we equipped agents with predefined tools, such as data profiling and rule validation functions, to ground their behaviour in deterministic logic. Rather than relying solely on free-form generation, the LLM acts as an orchestrator, invoking these tools when precise, reproducible outputs are needed. Combined with structured prompt engineering, this approach significantly reduces variability while maintaining flexibility.</p><p><strong>Scaling for Large Datasets with Parallelised Workflows<br></strong>Early tests revealed that our initial sequential processing pipeline could not handle large datasets efficiently. End-to-end execution created latency bottlenecks, particularly during profiling and rule validation phases. To optimise performance, we modularised the workflow, assigning dedicated agents to specific tasks and running them in parallel. This drastically reduced processing time while maintaining accuracy.</p><p>We also discovered that static data profiling metrics alone were not sufficient for generating meaningful rules. While traditional profiling tools (like Ydata Profiling) provided statistical summaries, they lacked the semantic understanding required for actionable data quality checks. To bridge this gap, we introduced LLM-augmented profiling, where the system interprets patterns, outliers, and relationships in natural language. This enrichment improved rule relevance and allowed the engine to suggest corrective actions for detected anomalies.</p><p>Looking ahead, we plan to implement an intelligent caching layer to store validated rules for stable schemas. This will further minimise redundant reprocessing while ensuring responsiveness to schema drift.</p><p><strong>Ensuring Consistency Through Multi-Agent Design and Automated Evaluation<br></strong>Initially, we experimented with a single-agent architecture, but this led to unpredictable behaviour as the same model juggled competing tasks, e.g. profiling, validation, and fix, often resulting in conflicting outputs. The solution was to transition to a multi-agent system, where each agent specialises in a single responsibility. This separation of concerns improved precision, simplified debugging, and allowed for targeted optimisations.</p><p>To maintain high-quality rule generation over time, we built an automated evaluation layer that benchmarks performance across different LLM versions (GPT-4o, Llama3, Qwen2.5). Key metrics include:</p><p>· Rule Validity Rate (% of syntactically correct rules)</p><p>· Expectation Coverage (% of columns with valid rules)</p><p>· Ideal Rule Rate (alignment with a curated “Golden Dataset”)</p><p>This continuous feedback loop ensures that as the system evolves, we are finding the most reliable models and techniques.</p><h3>Results and Conclusion</h3><h4>From Proof of Concept to Minimum Viable Product</h4><p>Following the principle of <em>failing fast</em>, the team built a proof of concept (PoC) using closed LLM models in an internet-connected environment. The success of this PoC validated our hypothesis and led to a minimum viable product (MVP) for deployment within our air-gapped infrastructure.</p><h4>Testing and Evaluation</h4><p>The MVP integrated seamlessly with our on-premises hosted LLM models, including <strong>Qwen2.5:72B-Instruct</strong>, and was tested on two datasets:</p><p>· <strong>Mocked Dataset:</strong> Employee dataset with 10 columns and 1,000 rows from Kaggle, tested using closed models.</p><p>· <strong>Recruitment Dataset:</strong> Real production dataset tested in our air-gapped environment using open models.</p><h4>Outcome</h4><p>After onboarding the Agentic AI Data Quality Engine to our data pipelines, data owners could detect data issues early and even get clear suggestions on how to fix it. For data engineers, it was like getting an extra set of hands. The system caught routine quality issues automatically, freeing them up for more interesting work. Downstream teams noticed the difference too. Their reports and models started running smoother because they could trust the numbers coming in. Across the whole organisation, this meant faster rollouts of new analytics and more confidence to try innovative projects.</p><h4>Team’s Reflection</h4><p>CSIT’s innovation programme has been transformative in fostering a culture where cross-functional teams can safely experiment and push boundaries. By breaking down silos and encouraging bold innovation, it enabled us to develop novel solutions that might otherwise have remained unexplored.</p><p>What began as promising prototypes quickly evolved into a deeper technical challenge as we addressed three critical production hurdles (detailed in Section 3). This journey reinforced the importance of agility in AI development — our ability to rapidly iterate and adapt proved crucial in navigating the fast-moving AI landscape.</p><p>Key to our progress has been the synergistic partnership with our AI engineering team, whose work in deploying on-premises LLMs and developing robust API integrations has given us secure access to cutting-edge capabilities. As we continue refining our solution, we are excited to scale its impact across increasingly diverse use cases.</p><h3>Future Recommendations: Evolving the Agentic AI Data Quality Flagger</h3><h4>Scaling for Larger Datasets</h4><p>As organisations collect terabytes or even petabytes of data daily, handling exponentially growing datasets remains a key challenge. Future development should explore <strong>context chunking</strong>, <strong>hierarchical summarisation</strong>, and <strong>memory augmentation</strong> to maintain contextual integrity and analytical efficiency across massive datasets.</p><h4>Unified Data Quality Engine for Diverse Environments</h4><p>A next step is building a <strong>unified data quality engine</strong> that can function as a <strong>side-car module</strong>, integrating seamlessly into existing pipelines. This design would enable real-time monitoring, flagging, and reporting without disrupting workflows. Dynamic prompt tuning will allow the system to adapt across diverse domains and industry, while maintaining standardised quality frameworks.</p><h4>Toward Automated Data Cleaning</h4><p>The long-term goal is to empower the system to <strong>autonomously clean and enrich data</strong> with human-in-the-loop oversight. Integration with <strong>Model Context Protocol (MCP)</strong> standards will enable communication with enterprise systems for real-time corrections, while maintaining transparency through audit trails and confidence scoring. Over time, this hybrid model — AI-led with human verification — will define the future of enterprise-grade data governance.</p><p>Fancy being part of a forward-thinking software engineering team using AI to drive serious impact? Jump in and apply <a href="https://go.gov.sg/csit-careers-blog">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6197dd786400" width="1" height="1" alt=""><hr><p><a href="https://medium.com/csit-tech-blog/engineering-an-agentic-ai-workflow-to-improve-data-quality-6197dd786400">Engineering an Agentic AI Workflow to Improve Data Quality</a> was originally published in <a href="https://medium.com/csit-tech-blog">CSIT tech blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>