DEV Community

Saadhan P
Saadhan P

Posted on

TigerGraph Fraud Sentinel

Building an Autonomous Fraud Investigation Agent with TigerGraph, LangGraph, and FinCEN SAR Automation

A deep dive into building an enterprise-grade agentic fraud intelligence platform for the Hacker House Goa × TigerGraph Hackathon.


🚀 Introduction: The Challenge of Modern Card Fraud

Card fraud detection at tier-1 financial institutions faces a fundamental bottleneck: real-time ML models produce thousands of high-risk transaction alerts daily, but human investigators are needed to determine what kind of fraud it is, how far the compromise extends, and what regulatory actions to take.

Traditional tabular ML approaches evaluate transactions in isolation. They miss the complex, multi-hop connection topologies:

  • Stolen cards tested through automated micro-authorization bursts.
  • Hardware fingerprints shared across seemingly unrelated cardholder accounts.
  • Coordinated syndicates routing fraudulent transactions through common billing zip codes and disposable email domains.

To solve this, we built TigerGraph Fraud Sentinel — an autonomous, multi-hop Agentic Graph Investigation Platform. Powered by a native TigerGraph GSQL database, LangGraph state machine orchestration, and an official Fraud Policy Engine (Rules R1–R10), the agent investigates alerts, gathers graph evidence, simulates customer step-up verification, renders next best actions with human-in-the-loop approval routing (auto, L1, L2), files regulatory FinCEN Suspicious Activity Reports (SAR), and writes closed cases back to graph memory.


🏗️ System Architecture

Our solution is structured into four cohesive layers:

flowchart TD
    subgraph DataLayer["1. TigerGraph Graph Core"]
        TG[(TigerGraph Cloud\nHHGOA_Fraud)]
        GSQL1["card_txn_history"]
        GSQL2["customer_card_profile"]
        GSQL3["shared_device_neighbors"]
        GSQL4["shared_region_email_neighbors"]
        GSQL5["similar_closed_cases"]
        TG --> GSQL1 & GSQL2 & GSQL3 & GSQL4 & GSQL5
    end

    subgraph AgentLayer["2. LangGraph Agentic Pipeline"]
        Trigger["Case Pack Ingestion\n(Alert Trigger)"] --> ToolNode["Multi-Hop Graph Queries\n(5 GSQL Endpoints)"]
        ToolNode --> Synthesizer["Typology Classifier\n(Card Testing / CNP / Ring / Out-of-Region)"]
        Synthesizer --> PolicyInit["Initial Policy Evaluation\n(Rules R1-R10, Routing: auto/L1/L2)"]
        PolicyInit --> EvidenceSim["Evidence Request Simulation\n(Customer Verification / Step-Up Auth)"]
        EvidenceSim --> FinalEval["Final Next Best Actions & Verdict"]
        FinalEval --> SARGen["FinCEN SAR Narrative Generator\n(Who, What, When, Where, How, Why)"]
        SARGen --> MemoryWriteback["Graph Memory Writeback\n(HHG_FraudCase Upsert)"]
    end

    subgraph UILayer["3. Executive Next.js Workspace"]
        NextApp["Next.js 16 + Tailwind CSS + Lucide"]
        CanvasGraph["HTML5 Canvas Physics Graph"]
        PolicyTimeline["Decision Progression Tracker"]
        SARViewer["FinCEN SAR Official Modal"]
        BenchmarkGrid["20-Case Portfolio Matrix"]
        NextApp --> CanvasGraph & PolicyTimeline & SARViewer & BenchmarkGrid
    end

    DataLayer <--> AgentLayer
    AgentLayer <--> UILayer

⚡ How TigerGraph Powers the Investigation

TigerGraph serves as the high-speed intelligence backbone for the agent. Using native GSQL queries compiled as sub-second REST endpoints, the agent executes deep relational graph traversals:

1. Schema Design

The graph schema models financial entities and relational interactions:

  • Vertices: HHG_Customer, HHG_Card, HHG_Transaction, HHG_Device, HHG_BillingRegion, HHG_EmailDomain, HHG_FraudCase, HHG_Action, HHG_FraudPattern.
  • Edges: HHG_USES_CARD, HHG_MADE, HHG_FROM_DEVICE, HHG_BILLED_IN, HHG_PURCHASER_EMAIL, HHG_INVOLVES, HHG_MATCHES_PATTERN, HHG_RESULTED_IN.

2. Multi-Hop Investigation Queries

Rather than querying flat CSV tables, the agent calls 5 compiled GSQL queries:

  1. card_txn_history(card_id): Traverses transactions, device fingerprints, and regional activity.
  2. customer_card_profile(customer_id): Uncovers the cardholder's complete portfolio across cards and accounts.
  3. shared_device_neighbors(device_id): Detects device sharing across disparate customer accounts — uncovering coordinated fraud rings.
  4. shared_region_email_neighbors(txn_id): Explores co-located transactions across billing regions and email domains.
  5. similar_closed_cases(pattern, card_id): Retrieves historical precedent cases from the 5,565 closed investigations in graph memory (GraphRAG).
// Example: Precedent Closed Case Retrieval (GSQL)
CREATE OR REPLACE QUERY similar_closed_cases(STRING p_pattern, STRING p_card_id)
FOR GRAPH HHGOA_Fraud {
  OrAccum @is_patt = false;
  OrAccum @on_card = false;

  patt_v = { HHG_FraudPattern.* };
  patt_v = SELECT p FROM patt_v:p WHERE p.name == p_pattern
           POST-ACCUM p.@is_patt = true;

  pattern_cases =
    SELECT c FROM patt_v:p -(HHG_MATCHES_PATTERN:e)- HHG_FraudCase:c
    WHERE p.@is_patt == true
    LIMIT 30;

  PRINT pattern_cases;
}
Enter fullscreen mode Exit fullscreen mode

🤖 Agentic Capabilities Implemented

1. Multi-Step State Machine (LangGraph)

The agent operates as a stateful graph where evidence is gathered, evaluated, and iteratively refined.

2. Policy-Driven Decision Engine (Rules R1–R10)

Decisions adhere strictly to regulatory standards and bank fraud policy:

  • Rule R1 (Weak Signal Safeguard): Never block on a single weak signal with probability < 0.70 without prior verification.
  • Rule R2 (Customer Denial): Disputed charges trigger immediate card blocking, case creation, and mandatory SAR filing if exposure > $1,000 or shared device links are present.
  • Rule R5 (Card Testing Sequence): Identifies bursts of low-value authorizations (<$5) preceding larger purchases, declining authorization and enforcing step-up authentication.
  • Rule R6 (Syndicate Detection): Automatically detects shared device/region rings and issues MONITOR_CONNECTED_CARDS across all linked accounts.

3. Action Evolution & Approval Routing

The agent tracks two distinct decision states:

  • Initial Recommendations (Pre-Verification): Recommended actions before customer confirmation.
  • Final Next Best Actions (Post-Verification): Final actions updated based on customer response with explicit approval routing:
    • auto: Autonomous agent execution (MONITOR_CARD, VERIFY_WITH_CUSTOMER, STEP_UP_AUTH).
    • L1 (Team Lead): DECLINE_TRANSACTION, BLOCK_CARD (exposure $\le$ $2,500).
    • L2 (Fraud Manager): BLOCK_CARD (exposure > $2,500), BLOCK_ALL_CARDS, FILE_REPORT (SAR).

4. FinCEN Suspicious Activity Report (SAR) Generator

For confirmed fraud meeting regulatory thresholds (e.g. Case HHG-010), the agent automatically generates an official FinCEN SAR narrative detailing the Who, What, When, Where, How, and Why.

5. Continuous Graph Memory (Writeback)

Every closed investigation is upserted back into TigerGraph as an HHG_FraudCase vertex connected to involved transactions, detected patterns, and resulting actions. Subsequent agent investigations immediately query these cases as prior memory.


📊 Benchmark Results (All 20 Cases)

Case ID Card ID Flagged Txn Verdict Pattern Exposure SAR Filed Tool Calls
HHG-001 C12382-K1 3514030 legitimate out_of_region_use $0.00 Exempt 7
HHG-002 C11891-K1 3478782 fraud card_not_present_fraud $292.36 Exempt 8
HHG-003 C08623-K2 3530164 fraud card_not_present_fraud $49.00 Exempt 7
HHG-004 C08106-K1 3583227 fraud card_not_present_fraud $128.33 Exempt 8
HHG-005 C02923-K1 3523199 fraud card_not_present_fraud $100.07 Exempt 8
HHG-006 C07297-K1 3476682 fraud card_not_present_fraud $482.12 Exempt 7
HHG-007 C09933-K2 3514948 legitimate out_of_region_use $0.00 Exempt 7
HHG-008 C13171-K2 3558054 fraud card_not_present_fraud $55.68 Exempt 10
HHG-009 C08299-K1 3581141 fraud card_not_present_fraud $30.02 Exempt 8
HHG-010 C10434-K1 3506725 fraud card_not_present_fraud $1,000.03 FILED 7
HHG-011 C11923-K2 3583368 fraud card_not_present_fraud $131.30 Exempt 10
HHG-012 C05876-K2 3553342 legitimate out_of_region_use $0.00 Exempt 7
HHG-013 C07671-K2 3526826 fraud card_not_present_fraud $35.66 Exempt 7
HHG-014 C13487-K1 3478561 legitimate none $0.00 Exempt 7
HHG-015 C03042-K1 3464869 fraud card_not_present_fraud $599.94 Exempt 10
HHG-016 C09988-K1 3534820 fraud card_not_present_fraud $59.67 Exempt 7
HHG-017 C04570-K1 3450629 fraud card_not_present_fraud $100.09 Exempt 10
HHG-018 C02354-K2 3491361 fraud card_not_present_fraud $39.08 Exempt 8
HHG-019 C07987-K2 3503878 fraud card_not_present_fraud $99.92 Exempt 7
HHG-020 C12265-K2 3509359 fraud card_not_present_fraud $125.08 Exempt 7

💡 What We Learned & Future Improvements

Key Takeaways:

  1. Graph Memory Transforms LLM Reasoning: Giving an agent direct graph traversals and historical closed cases eliminates hallucination and grounds policy decisions in hard relational proof.
  2. Deterministic Guardrails are Essential in Regulated FinTech: An LLM agent cannot be left to freely guess approval routing or SAR narrative criteria. Pairing LangGraph with strict rule engines ensures regulatory defensibility.

What We Would Add With More Time:

  • Real-Time Streaming Transaction Tap: Attaching a Kafka/WebSocket ingestion pipeline to score transactions as they stream in sub-10ms.
  • Federated Graph Embeddings: Training TigerGraph Graph Neural Networks (GNNs) on sub-graph embeddings to flag novel, undocumented syndicate topologies before any human report.

Built with ❤️ for Hacker House Goa 2026 by Team TigerGraph Sentinel.

Top comments (0)