Deep Compliance Agent: An Intelligence & Cognitive Compliance Research Framework

Submission type

Coded Agent with UiPath SDK

Name

Manoj Batra

Industry category in which use case would best fit in (Select up to 2 industries)

Banking
Banking and financial services
Compliance

Complexity level

Advanced

Summary (abstract)

DeepComplianceAgent is an enterprise-grade AI compliance automation system that combines UiPath RPA, LangGraph-based agentic reasoning, and LLM-driven contextual understanding to automate compliance checks on corporate documents, contracts, and supplier invoices.

The system reads unstructured text (e.g., invoices or policy files), identifies policy breaches and anomalies, classifies severity levels, and routes high-risk findings to the UiPath Action Center for human review.

It integrates context grounding (via Vector DB) to ensure all AI findings are evidence-backed by real policy clauses, and it produces traceable audit trails and human-readable HTML reports for governance.

By automating document understanding, reasoning, and escalation workflows, DeepComplianceAgent showcases the power of Agentic AI + RPA synergy in creating trustworthy, explainable, and auditable enterprise automation.

Detailed problem statement

Business Challenge

In large organizations, compliance teams must verify thousands of documents daily — contracts, supplier invoices, onboarding forms, or regulatory reports.
Each must be checked against multiple corporate and legal policies (e.g., vendor approval, tax compliance, and financial thresholds).

Manual review leads to:

  • Slow turnaround times (20–30 minutes per document)

  • Human fatigue and oversight — critical issues often missed

  • Inconsistent enforcement of compliance policies

  • Poor auditability — limited trace of who approved what and why

Technical Challenge

Even when RPA is used for workflow automation, traditional bots lack contextual reasoning:

  • They can’t “understand” policy language or make judgment calls.

  • Rule-based systems explode in complexity when policies change.

  • Compliance logic is often hidden in procedural scripts, not explainable to auditors.

Hence, there’s a need for a cognitive automation system that:

  • Understands unstructured text,

  • Links findings to real policies,

  • Reasons contextually,

  • Escalates intelligently, and

  • Provides auditable, explainable outputs.


Detailed solution

:puzzle_piece: System Overview

DeepComplianceAgent solves the above by integrating:

  • UiPath RPA → document collection, Action Center tasks, audit uploads

  • LangGraph Agentic Flow → structured, multi-node reasoning pipeline

  • LLM (UiPathAzureChatOpenAI) → contextual understanding, findings extraction

  • Context Grounding → retrieves matching rules from a Vector DB of policies

  • MCP Anomaly Detector → statistical + ML-based numeric outlier detection

  • Audit Trail & Reporting → evidence-backed, immutable logs and HTML reports

Step Component Description
1. Input File Third Party Feeds User uploads a document (e.g., Supplier.docx).
2. Text Extraction read_and_extract() Reads .docx via python-docx and stores text in state.
3. Policy Retrieval find_relevant_rules() Fetches top 3–5 relevant policy snippets from the vector DB.
4. Reasoning & Findings reason_about_compliance() LLM analyzes document + policy context → structured JSON of issues, severity, confidence.
5. Anomaly Detection check_for_anomalies_mcp() Extracts numeric features (amounts, days, percentages) → checks for statistical and ML-based anomalies.
6. Decision Logic decide_action() Combines LLM confidence + anomaly score → decides whether to auto-resolve, monitor, or escalate.
7. Escalation / Action act_or_escalate() Creates Action Center task for human review if needed.
8. Audit Trail explain_and_record() Writes full JSON record (rules, findings, decisions).
9. Final Report generate_report() Produces HTML summary (issues, risk scores, recommendations).
  1. read_and_extractGraphState.topic (excerpt)
    “Supplier: AlphaTech Solutions Pvt. Ltd.
    Invoice No: INV-2048
    Invoice Date: 12 September 2025
    Total Amount: ₹1,450,000.00
    Payment Terms: 50% advance, remaining 50% within 30 days.

    GST registration details have not been verified.
    No prior vendor risk assessment found in the compliance portal.”

  2. find_relevant_rulesretrieved_rules (example snippet list — from your policy index)
    [
    {“snippet”:“Policy: Overseas payments require 2-step finance approval and KYC”, “score”:0.92, “source”:“VendorPolicy_v2”},
    {“snippet”:“Policy: High value invoices (>₹1,000,000) require procurement committee sign-off”, “score”:0.89, “source”:“ProcurementPolicy”},
    {“snippet”:“Policy: GST verification required for domestic suppliers”, “score”:0.82, “source”:“TaxPolicy”}
    ]

  3. reason_about_compliancefindings (JSON array expected from LLM)
    [
    {
    “issue”: “Unverified GST”,
    “severity”: “High”,
    “explanation”: “GST registration of the vendor has not been verified; issuing payment without verification risks tax non-compliance.”,
    “confidence”: 0.92,
    “evidence_refs”: [“TaxPolicy#GST verification clause”]
    },
    {
    “issue”: “Overseas payment to vendor account”,
    “severity”: “Medium”,
    “explanation”: “Payment is to an overseas bank account; this requires additional approvals and FX documentation.”,
    “confidence”: 0.85,
    “evidence_refs”: [“VendorPolicy_v2#overseas-payment”]
    },
    {
    “issue”: “High invoice amount without procurement committee approval”,
    “severity”: “High”,
    “explanation”: “Invoice total ₹1,450,000 exceeds approval threshold and appears to lack procurement committee sign-off.”,
    “confidence”: 0.9,
    “evidence_refs”: [“ProcurementPolicy#thresholds”]
    }
    ]

  4. check_for_anomalies_mcp → numeric extraction and z-score computation

  • Numeric values extracted: [1450000.0, 50.0, 30.0]
  • Computed population mean ≈ 483,360.0, population stdev ≈ ~683,600.0, max z ≈ ~1.414no single value exceeds |z|>2anomalies = [], anomaly_score ≈ 0.28.
  1. decide_action → combining severity and anomaly:
    {
    “action”: “escalate”,
    “reason”: “Presence of high severity finding(s).”,
    “combined_confidence”: 0.65,
    “timestamp”: “2025-11-04T…Z”
    }

  2. act_or_escalate → creates Action Center task
    {
    “Reason”: “Presence of high severity finding(s).”,
    “Findings”: “Issue: Unverified GST\nSeverity: High\nExplanation: GST registration… \nIssue: High invoice amount …”,
    “AnomalyScore”: “0.28”,
    “UserReason”: “”,
    “RecordId”: null
    }

  3. explain_and_record → writes audit_{uuid}.json (uploaded to DeepComplianceBucket_Log). Example audit snippet:
    {
    “audit_id”: “4b6f9a1e-…”,
    “timestamp”: “2025-11-04T…Z”,
    “document_excerpt”: “Supplier: AlphaTech Solutions Pvt. Ltd. …”,
    “retrieved_rules”: […],
    “findings”: […],
    “anomalies”: ,
    “anomaly_score”: 0.28,
    “decision”: {…decided_action…},
    “action_task_id”: 12345
    }

  4. generate_report → human-readable HTML email report produced by LLM:

Compliance Review — Supplier: AlphaTech Solutions Pvt. Ltd.

Findings

  • Unverified GST — High. Recommendation: Hold payment until GST is verified.
  • High invoice amount without procurement approval — High. Recommendation: Escalate to procurement committee.
  • Overseas payment — Medium. Recommendation: Submit FX documentation and approvals.

Action: Escalated to Compliance Team (Task ID: 12345)

Uploaded to DeepComplianceBucket_Output as {audit_id}.txt and RPA processes invoked to store results into enterprise systems.


Intelligence Behind the Flow

  • Agentic Reasoning
    Each node is an autonomous decision agent that processes and updates shared state — allowing transparency and modular testing.

  • Contextual Grounding
    Findings are never hallucinated — they’re always supported by retrieved policy text (from retrieved_rules).

  • Hybrid Anomaly Detection
    Uses both statistical z-scores and ML predictions (MCP endpoint) for precision in numeric or behavioral deviations.

  • Human-in-the-Loop
    Integration with UiPath Action Center ensures critical cases are escalated for final approval, balancing automation with accountability.

  • Auditability
    Every run creates an audit_.json file with the `complete reasoning chain, ensuring full traceability and regulatory transparency.

Narrated video link (sample: https://bit.ly/4pvuNEL)

Expected impact of this automation

Qualitative Impact

  1. Scalable Cognitive Compliance
  • Handles thousands of documents daily without fatigue or bias.

  • Standardizes policy interpretation across teams.

  1. Explainable AI & Trust
  • Each finding includes evidence (retrieved_rule) and reasoning (explanation, confidence).

  • Enables auditors and regulators to see why a decision was made.

  1. Human-AI Collaboration
  • Action Center keeps human reviewers in control of escalations.

  • Feedback loop allows model fine-tuning over time.

  1. Regulatory Readiness
  • Full audit trails and decision metadata meet ISO, GDPR, and SOX governance needs.
  1. Cross-Domain Expandability
  • Can be adapted to Finance, Procurement, HR policy compliance, Risk assessment, or ESG reporting — with minimal changes.

UiPath products used (select up to 4 items)

UiPath Action Center
UiPath Apps
UiPath Coded Agents
UiPath Data Service
UiPath Orchestrator
UiPath Robots
UiPath Studio Web

Integration with external technologies

Financial Datasets, Compliance documents

TO-BE workflow/architecture diagram (file size up to 4 MB)

Other resources

4 Likes

:waving_hand: Hi there, @Manoj_Batra builder,

It’s been a while :slight_smile: . Thank you so much for being part of the Specialist Coded Agent Challenge. Your creativity, dedication, and automation skills truly blew us away! :collision:

Here’s what’s next:

:spiral_calendar: Nov 5–16: Jury evaluation by @eusebiu.jecan1 & @Adrian_Tamas + community voting
:trophy: Nov 17: Winners announced :tada:

Don’t forget the Community Choice Award, the best-voted project wins a $500 gift card + $60 UiPath Swag voucher! Voting is open till Nov 16, but remember that fresh accounts can’t vote (Level 1 access required, as we want to keep it fair and spam-free).

You’ve already won our admiration, now let’s see who takes home the big prizes :grinning_face_with_smiling_eyes:.

GOOD LUCK :four_leaf_clover: ,

Loredana

1 Like