DEV Community

Aman Kumar
Aman Kumar

Posted on

Building an Autonomous Fraud Investigation Agent with TigerGraph and MCP

Building an Autonomous Fraud Investigation Agent with TigerGraph and MCP

Combining Native Parallel Graph Analytics, Model Context Protocol, and Agentic Reasoning to Automate Financial Crime Triage and SAR Compliance


1. The Problem: Relational Blind Spots in Modern Fraud

Traditional fraud engines evaluate incoming transactions as single, isolated rows in a relational database. The catch? Organized financial crime rarely happens in isolation. Modern fraud syndicates rely heavily on synthetic identities, distributed money-mule rings, and shared hardware infrastructure.

On paper, an isolated $75 transaction looks benign. However, inspecting the network topology reveals the true picture: multiple accounts authenticating from the exact same hardware fingerprint, rapidly layering funds into a common beneficiary cluster.

To bridge this gap, I engineered an Autonomous Fraud Investigation Agent backed by TigerGraph and standard Model Context Protocol (MCP) interfaces.


2. Architecture Overview

The system operates across three interconnected layers:
[ Case Trigger / CSV Pack ]


[ app.py / agent.py ] ◄───► [ TigerGraph Client (tg_client.py) ]
│ │
▼ ▼
[ MCP Server (mcp_server.py) ] ──► [ Graph Query & Traversal ]

├── Risk Scoring & Feature Extraction
├── Prior Case History Matching (closed_cases_history.csv)
├── Next-Best-Action (NBA) Policy Routing


[ Evaluation Results (cases/HHG-001.json - HHG-020.json) ]

├── Structured SAR Filing Determinations
├── Exposure Calculations & Approval Routing
└── Executive Forensic Summaries

  • TigerGraph Layer: Stores heterogeneous financial graphs (Accounts, Devices, IP Addresses, Transactions, Merchants) and runs real-time multi-hop neighborhood traversals.
  • MCP Decision Engine: Exposes deterministic graph queries, feature extraction tools, and historical lookup routines to the LLM agent via typed tool interfaces.
  • Autonomous Agent Loop: Evaluates signals, proposes two-stage Next-Best-Actions (NBAs), compiles regulatory Suspicious Activity Reports (SARs), and writes the investigative conclusions back into the graph.

3. How TigerGraph Powers the Investigation

TigerGraph serves two essential roles in the pipeline:

A. Deep-Link Graph Introspection

When a fraud alert triggers, the agent queries the MCP server, which invokes parameterized GSQL queries to trace paths up to 2–3 hops away:

  • Device & Identity Sharing: Discovering whether an account's device fingerprint or IP address has been observed across other flagged accounts.
  • Flow-of-Funds Analysis: Detecting circular routing, velocity spikes, or rapid fund dispersion to newly linked beneficiaries.

Because TigerGraph uses native parallel processing (MPP), these multi-hop subgraphs return in sub-second latency, giving the agent real-time relational context.

B. Closing the Loop: In-Graph Case Persistence

An investigation is incomplete if its output remains trapped in a static log. The agent persists the entire case record back into TigerGraph:

  • Creating FraudCase vertices.
  • Drawing ASSOCIATED_WITH and FLAGGED_DEVICE edges to affected accounts and devices.
  • Storing risk scores, investigator decisions, and SAR reference tags directly on the graph so future agent runs immediately benefit from historical findings.

4. Agentic Capabilities Implemented

  1. Two-Stage Next-Best-Action (NBA) Policy Engine:
    • Stage 1 (Pre-Evidence): Proposes minimal friction actions (e.g., step-up biometric prompt, Tier 1 Ops manual check) while initial data is gathered.
    • Stage 2 (Post-Evidence): Upon receiving secondary graph traversals or behavioral evidence, upgrades the routing (e.g., immediate freeze, escalation to Tier 2 Senior Fraud Specialist).
  2. Deterministic Compliance & SAR Drafting:
    • Analyzes risk thresholds and exposure figures against federal AML/SAR filing policies.
    • Automatically synthesizes structured narratives linking entities, suspicious patterns, and regulatory justifications.
  3. Structured Verification via Schemas:
    • Constrains agent outputs to strict schemas, ensuring 100% machine-readable outputs for downstream banking microservices.

5. Benchmark Performance Across 20 Cases

We validated the pipeline across 20 diverse, multi-vector fraud evaluation scenarios (HHG-001 through HHG-020):

Metric Target Policy Achieved Score
Case Completion Rate 100% (20 / 20 cases) 100%
SAR Determination Accuracy > 95% 100%
Approval Route Precision Tier 1 / Tier 2 Compliance 100%
Schema Validation Rate 100% Strict JSON 100%
  • Low-Risk Transacting (risk_score < 0.30): Correctly classified as low exposure with non-invasive friction (e.g., standard monitoring, cleared outcome).
  • Medium-Risk Anomalies (0.30 ≤ risk_score < 0.70): Prompted intermediate next-best actions without triggering premature account freezes.
  • High-Risk Syndicates (risk_score ≥ 0.70): Flagged for mandatory SAR filing, immediate beneficiary restrictions, and escalation to Senior Fraud Specialists.

6. What I Would Improve With More Time

  • Real-Time Streaming Graph Analytics via Kafka: Integrate an event-driven ingestion pipeline directly into TigerGraph’s streaming upsert API to trigger sub-second graph investigations the moment a transaction fires, replacing batch CSV processing.
  • Graph Neural Network (GNN) Embeddings: Train a Graph Convolutional Network (GCN) or Graph Attention Network (GAT) directly over TigerGraph topologies to generate structural entity embeddings for proactive anomaly detection.
  • Multi-Agent Orchestration: Deconstruct the monolithic agent into collaborative sub-agents (Evidence Investigator Agent, Compliance & Legal Agent, and an Adversarial Red-Team Agent to mitigate false positives).

7. Key Takeaways

  • Graphs Eliminate Hallucinations: Providing an LLM with verified relational subgraphs grounds its reasoning in structural enterprise facts.
  • MCP Simplifies AI Integration: Standardizing tool schemas via the Model Context Protocol keeps domain logic decoupled from model orchestration.
  • Write Back to the Graph: The most effective graph agents don't just read data—they write their conclusions back into the topology, compounding institutional memory over time.

Top comments (0)