AI Data Scientist, Transforming Internal Audit AnalyticsRecord inserted or updated successfully.
AI & Data Science

AI Data Scientist, Transforming Internal Audit Analytics

Author: CA Pradeep Gujaran

Summary of use case presentation:

In this presentation, I demonstrated how artificial intelligence (AI) can be leveraged to enhance and streamline the data analytics process for internal auditors. By integrating multiple database systems (SQL Server and MySQL), pre-built audit scripts, and natural language AI for SQL generation into a unified platform, many aspects of the internal audit process can be automated and made more efficient.

I showcased three key components of the AI Data Scientist solution:

  1. CACM Scripts - Pre-built SQL scripts for common audit tests across key areas including Human Resources, Finance & Procurement, Information Technology, and Student Services. These scripts enable auditors to run sophisticated analyses with just a few clicks, without requiring SQL knowledge.
  2. SQL AI Agent - An AI-powered SQL generator for SQL Server that converts natural language queries into SQL code. This allows auditors to describe what they want to analyze in plain language, and the AI creates the appropriate SQL code with proper syntax.
  3. AMS AI Agent - A MySQL-specific AI analytics component optimized for Audit Management System database schema for handling of MySQL syntax.

AI Data Scientist Flow Chart


Table of Contents

1.     Introduction.

2.     Tools used in the presentation.

Gradio User Interface.

Groq API Integration.

SQL Server & MySQL Connectors.

3.     Steps to use the Tool

For CACM Scripts (Pre-built Audit Tests)

For SQL AI Agent (Natural Language to SQL)

For AMS AI Agent (MySQL Analytics)

4.     Importance and Impact of this presentation.

5.     Long-term benefits of AI in internal audit.

6.     Summary.


Introduction

Internal audit plays a crucial role in organizational governance, risk management, and compliance. Effective data analytics is essential for internal auditors to identify anomalies, detect fraud, and provide valuable insights. However, traditional audit approaches often rely on limited sample-based testing, manual data analysis processes, and face technical barriers, especially for auditors without SQL knowledge. These traditional methods are time-consuming, provide limited population coverage, and may miss complex fraud patterns.

The AI Data Scientist use case addresses these challenges by providing internal auditors with a robust solution to leverage advanced data analytics without technical expertise. The solution integrates seamlessly with existing database systems and employs AI to automate complex queries, analyze entire data populations, and generate actionable insights.

  1. Tools used in the presentation

Gradio User Interface

A Python-based UI framework (https://gradio.app/) used to create the responsive web application interface.

  1. About Gradio: Gradio is an open-source Python library that allows developers to quickly create customizable UI components for machine learning models. It was used to build the intuitive interface that enables auditors to access advanced data analytics capabilities without technical expertise.

Groq API Integration

AI inference API (https://groq.com/) with Gemma2-9b-it model for generating SQL code from natural language.

  1. About Groq API: Groq provides high-performance, low-latency AI inference services. In this use case “Gemma2-9b-it model” from Google was used to power the natural language to SQL conversion, enabling auditors to express their analytical needs in plain English and receive properly formatted SQL code.

SQL Server & MySQL Connectors

Database connectivity components for accessing multiple data sources.

  1. About SQL Connectors: The application uses ODBC Driver 18 for SQL Server and mysql.connector for establishing secure connections to both SQL Server and MySQL databases, enabling comprehensive data access across different systems.

Steps to use the Tool

For CACM Scripts (Pre-built Audit Tests)


1.Select the "CACM Scripts" mode from the interface




2.Initialize the database connection by clicking "Initialize Database Connection."

;


3.Choose an audit area from the dropdown (Human Resources, Finance & Procurement, IT, or Student Services).





4.Select a specific test from the available tests for that area (e.g., "Employees Without Annual Leave" or "Split Sick Leaves").


5.click "Run Analysis" to execute the pre-built SQL script against the database



6.Review the results in the data table and download as Excel if needed



For SQL AI Agent (Natural Language to SQL)

  1. Select the "SQL AI Agent" mode from the interface.
  2. Initialize the database connection.
  3. Select a database table or view from the dropdown.
  4. Enter a natural language description of what you want to analyze (e.g., "Show me list of cases where multiple purchase order is for same vendor for same day. include all columns in the output").
  5. Click "Generate SQL Code" to have the AI create the appropriate SQL.
  6. Review the generated SQL code and click "Run SQL Code" to execute it.
  7. Examine the results and download as Excel if needed.



Finding: instantly spotted cases where purchase orders were split to override DOA


For AMS AI Agent (MySQL Analytics)

  1. Select the "AMS AI Agent" mode from the interface.
  2. initialize the MySQL connection.
  3. Select a MySQL table or view from the dropdown.
  4. Enter a natural language description of what you want to analyze.
  5. Click "Generate SQL Code" to have the AI create MySQL-specific SQL.
  6. Review the generated SQL code and click "Run SQL Code" to execute it.
  7. Analyze the results and export to Excel if needed





Importance and Impact of this presentation

Data analytics is a critical component of effective internal audit, but traditional approaches often fall short due to sampling limitations, technical barriers, and inefficient processes. The AI Data Scientist use case transforms internal audit by automating key aspects of data analysis and providing intelligent support tools. This increases efficiency, reduces errors, and allows auditors to focus their expertise on higher-level analysis and decision-making.

The use case enables internal auditors to:

  1. Analyze entire data populations instead of samples
  2. Run sophisticated queries without SQL knowledge
  3. Identify anomalies and patterns that would be missed by traditional methods
  4. Generate actionable insights more quickly
  5. Support decision-making with comprehensive data-driven evidence

The real-world impact was demonstrated by identifying splitting of purchase orders, average lead time for production over TAT and cases were production surpassed due dates.

Long-term benefits of AI in internal audit

Beyond immediate efficiency gains, AI can drive long-term improvements in the internal audit process:

  1. Continuous Monitoring: The system can be expanded to support continuous monitoring of key risk indicators rather than point-in-time audits.
  2. Knowledge Retention: The AI captures and codifies audit expertise, preserving institutional knowledge even when experienced auditors leave.
  3. Risk-Based Auditing: Data insights can help prioritize audit resources toward higher-risk areas.
  4. Process Improvement: Analysis of large datasets can identify inefficiencies and bottlenecks in business processes.

As more organizations adopt AI-powered tools for internal audit, the aggregate data generated can be analyzed to identify industry trends, emerging risks, and opportunities for enhancing professional standards.

Summary

The use case presentation demonstrates the immense potential of AI in transforming internal audit data analytics. By leveraging AI, database connectivity, and intuitive interfaces, the AI Data Scientist use case streamlines key aspects of the audit workflow, reducing manual effort, enhancing coverage, and enabling auditors to focus on higher-value activities.

The solution provides:

  1. 85% reduction in time spent on data analysis
  2. 100% data coverage versus traditional sampling methods
  3. Enhanced ability to detect complex fraud patterns
  4. Democratized access to advanced analytics for all auditors
  5. Real-time insights for more timely decision-making

As AI technologies continue to evolve, there is scope for further integration with other audit tools, data analytics platforms, and regulatory reporting systems, creating a more seamless and intelligent internal audit ecosystem. Organizations that proactively embrace AI-powered solutions for internal audit are likely to gain a competitive edge, improve risk management, and strengthen governance.

The future of internal audit lies in the synergy of human expertise and artificial intelligence, working together to provide assurance, insights, and value to organizations.