<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prafull Gupta</title>
    <description>The latest articles on DEV Community by Prafull Gupta (@yash_gupta_4eb6e1b9159a4b).</description>
    <link>https://dev.to/yash_gupta_4eb6e1b9159a4b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4142368%2Faea1dd0d-7019-4c2c-bc6c-c8a8d3d8daad.png</url>
      <title>DEV Community: Prafull Gupta</title>
      <link>https://dev.to/yash_gupta_4eb6e1b9159a4b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yash_gupta_4eb6e1b9159a4b"/>
    <language>en</language>
    <item>
      <title>An Agent That Knows When It Doesn't Know - Fraud Investigation on TigerGraph</title>
      <dc:creator>Prafull Gupta</dc:creator>
      <pubDate>Fri, 25 Sep 2026 06:37:56 +0000</pubDate>
      <link>https://dev.to/yash_gupta_4eb6e1b9159a4b/an-agent-that-knows-when-it-doesnt-know-fraud-investigation-on-tigergraph-307g</link>
      <guid>https://dev.to/yash_gupta_4eb6e1b9159a4b/an-agent-that-knows-when-it-doesnt-know-fraud-investigation-on-tigergraph-307g</guid>
      <description>&lt;h2&gt;
  
  
  What We Built
&lt;/h2&gt;

&lt;p&gt;We built an &lt;strong&gt;agentic fraud investigation system&lt;/strong&gt; on TigerGraph for the &lt;strong&gt;TigerGraph x Hacker House Goa hackathon&lt;/strong&gt;. It takes twenty fraud alerts from the IEEE-CIS dataset (590,742 transactions), investigates each one using graph traversals, calibrates its confidence, and - this is the key part - &lt;strong&gt;asks for more evidence when one signal is not enough&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For each alert the agent produces three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;internal case record&lt;/strong&gt; written into the graph&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;suspicious activity report&lt;/strong&gt; when policy requires one&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;next-best-action&lt;/strong&gt; with an approval route, recorded &lt;em&gt;before and after&lt;/em&gt; any evidence it asks for&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The bank's risk score is an input, not an answer: above 0.7 most flagged transactions are legitimate, and some fraud scores near zero. The agent's job is calibration and restraint as much as detection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alert -&amp;gt; LangGraph agent -&amp;gt; TigerGraph MCP -&amp;gt; TigerGraph (GSQL, algorithms, vectors)
              |                                   ^
              +-&amp;gt; Gemini (temperature 0)            |
              +-&amp;gt; action registry (permissions) ----+ case writeback
              +-&amp;gt; FastAPI (+SSE) -&amp;gt; React analyst UI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pipeline is a state machine:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TRIGGER -&amp;gt; OPEN_CASE -&amp;gt; GATHER_EVIDENCE -&amp;gt; ASSESS -&amp;gt; [uncertain? REQUEST_EVIDENCE -&amp;gt; RE-ASSESS]* -&amp;gt; DECIDE_NBA -&amp;gt; APPROVAL_GATE -&amp;gt; EXPLAIN -&amp;gt; WRITE_CASE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All graph access goes through the tool layer; the model never sees raw rows - only structured evidence briefs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How TigerGraph Is Used
&lt;/h2&gt;

&lt;p&gt;TigerGraph is the backbone of this system. Here's how we used every major capability:&lt;/p&gt;

&lt;h3&gt;
  
  
  Schema Design
&lt;/h3&gt;

&lt;p&gt;We designed a rich graph schema with 12 vertex types and 15+ edge types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Core entities&lt;/strong&gt;: Customer, Card, Transaction, DeviceProfile, EmailDomain, BillingRegion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investigation entities&lt;/strong&gt; (agent-written): Case, Evidence, Action, Pattern, PolicyClause&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Historical&lt;/strong&gt;: ClosedCase (with embeddings for similarity search)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key edges like &lt;code&gt;OWNS&lt;/code&gt;, &lt;code&gt;MADE&lt;/code&gt;, &lt;code&gt;FROM_DEVICE&lt;/code&gt;, &lt;code&gt;BILLED_IN&lt;/code&gt; model the transaction network, while &lt;code&gt;HAS_EVIDENCE&lt;/code&gt;, &lt;code&gt;TOOK&lt;/code&gt;, &lt;code&gt;SIMILAR_TO&lt;/code&gt; capture the agent's reasoning chain.&lt;/p&gt;

&lt;h3&gt;
  
  
  GSQL Queries
&lt;/h3&gt;

&lt;p&gt;We wrote 14 GSQL-backed tool functions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;card_profile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cardholder history: median spend, products, regions, devices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;card_window&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All transactions within +/-72h of the alert&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;velocity_stats&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transaction velocity in configurable time windows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;device_neighbors&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Other customers sharing this device profile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;path_to_known_fraud&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shortest path (&amp;lt;=4 hops) to a confirmed fraud case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fraud_ring_detection&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;WCC + Louvain on shared device/region subgraph&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;similar_cases&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Vector similarity search over closed case embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;policy_lookup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Vector search over policy clause embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Graph Algorithms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Weakly Connected Components&lt;/strong&gt; and &lt;strong&gt;Louvain Community Detection&lt;/strong&gt; on the shared device / region / email subgraph to find fraud rings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PageRank&lt;/strong&gt; for entity centrality - identifying the most connected nodes in suspicious clusters&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Vector Search (GraphRAG)
&lt;/h3&gt;

&lt;p&gt;We embedded closed-case narratives and policy clauses using MiniLM (384-d) and stored them as vector attributes on TigerGraph vertices. For each new case, the agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Retrieves similar closed cases by vector similarity&lt;/li&gt;
&lt;li&gt;Finds relevant policy clauses&lt;/li&gt;
&lt;li&gt;Condenses graph facts + similar cases + policy into an evidence brief&lt;/li&gt;
&lt;li&gt;Reasons over that brief with the LLM&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  MCP Integration
&lt;/h3&gt;

&lt;p&gt;The agent's &lt;em&gt;only&lt;/em&gt; interface to the graph is through TigerGraph MCP tools. Every claim in a case file cites a query name and entity IDs - full provenance, no hallucination.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agentic Behaviour - The Interesting Part
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Uncertainty is Explicit
&lt;/h3&gt;

&lt;p&gt;The agent doesn't just classify fraud/not-fraud. It maintains a calibrated probability and uses Bayesian updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;odds_mult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lr&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;logit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lr&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thresholds come from the fraud policy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&amp;gt;= 0.85&lt;/strong&gt;: Act (with &amp;gt;=2 independent signals)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0.15 - 0.85&lt;/strong&gt;: Request more evidence&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&amp;lt;= 0.15&lt;/strong&gt;: Clear&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Evidence Requests Change Outcomes
&lt;/h3&gt;

&lt;p&gt;When uncertain, the agent requests customer validation, step-up authentication, or analyst review - selecting the channel with the highest &lt;strong&gt;expected information gain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example from Case HHG-001:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initial probability: &lt;strong&gt;0.59&lt;/strong&gt; (out-of-region use pattern)&lt;/li&gt;
&lt;li&gt;Action: VERIFY_WITH_CUSTOMER&lt;/li&gt;
&lt;li&gt;Customer denies the transaction&lt;/li&gt;
&lt;li&gt;Final probability: &lt;strong&gt;0.93&lt;/strong&gt; -&amp;gt; BLOCK_CARD&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. The Recommendation Changes
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;nba_before&lt;/code&gt; and &lt;code&gt;nba_after&lt;/code&gt; are stored with a diff and a reason:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At 0.45 on one signal -&amp;gt; &lt;code&gt;VERIFY_WITH_CUSTOMER&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;After denial -&amp;gt; &lt;code&gt;BLOCK_CARD&lt;/code&gt;, &lt;code&gt;CREATE_CASE&lt;/code&gt;, maybe &lt;code&gt;FILE_REPORT&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Permissions Live in Code
&lt;/h3&gt;

&lt;p&gt;Only &lt;code&gt;auto&lt;/code&gt;-routed actions execute. &lt;code&gt;L1&lt;/code&gt; (team lead) and &lt;code&gt;L2&lt;/code&gt; (fraud manager) actions are recorded as pending with the approver role. &lt;code&gt;BLOCK_ALL_CARDS&lt;/code&gt; is refused unless policy R10 holds.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Memory Through the Graph
&lt;/h3&gt;

&lt;p&gt;Prior case outcomes are retrieved by vector similarity AND shared entities. They're cited in the case file and change recommendations - a cleared travel case makes the agent verify instead of block.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern Discovery
&lt;/h2&gt;

&lt;p&gt;We ran graph algorithms over the full dataset and discovered two undocumented fraud patterns:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DISC-001: Shared-Device Ring&lt;/strong&gt; - One Samsung SM-G935F behind an anonymous proxy, marked New on 28 different customers' cards within 30 days (60 transactions, $16,556). The graph found it through device-neighbor traversal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DISC-002: Threshold Structuring&lt;/strong&gt; - 3-4 online purchases each just under $500 within 45 minutes on rotating device profiles (44 episodes found).&lt;/p&gt;

&lt;p&gt;Case HHG-014 hit the shared-device ring with &lt;strong&gt;0.988 probability&lt;/strong&gt; - the bank's risk score was 0.05. The graph caught what the model missed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;All &lt;strong&gt;20 benchmark cases&lt;/strong&gt; processed successfully:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cases processed&lt;/td&gt;
&lt;td&gt;20/20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fraud detected&lt;/td&gt;
&lt;td&gt;Multiple patterns including card-not-present, out-of-region, account takeover&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undocumented patterns found&lt;/td&gt;
&lt;td&gt;2 (DISC-001, DISC-002)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SARs generated&lt;/td&gt;
&lt;td&gt;Filed when exposure &amp;gt; $1,000 or shared device/customer fraud&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Avg tool calls per case&lt;/td&gt;
&lt;td&gt;~30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Avg latency&lt;/td&gt;
&lt;td&gt;~5-11 seconds per case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evidence requests&lt;/td&gt;
&lt;td&gt;Bayesian updates with simulated customer/auth responses&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Case HHG-014 - The Graph Found What the Model Missed
&lt;/h3&gt;

&lt;p&gt;The bank's risk score was 0.05 (extremely low risk). But TigerGraph revealed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The device profile was shared by &lt;strong&gt;28 customers&lt;/strong&gt; in 30 days&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100%&lt;/strong&gt; of uses were marked "New"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100%&lt;/strong&gt; were behind an anonymous proxy&lt;/li&gt;
&lt;li&gt;The device appeared on &lt;strong&gt;3 confirmed fraud cases&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The agent classified it as &lt;strong&gt;0.988 probability fraud&lt;/strong&gt; - an undocumented coordinated abuse pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Interface
&lt;/h2&gt;

&lt;p&gt;The analyst UI is a React + TypeScript + Framer Motion application with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Case queue&lt;/strong&gt; with priority sorting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bento case view&lt;/strong&gt;: verdict, confidence, evidence list&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Before-&amp;gt;After action timeline&lt;/strong&gt; showing how recommendations changed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive subgraph visualization&lt;/strong&gt; (react-force-graph-2d)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live investigation streaming&lt;/strong&gt; via SSE&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approval workflow&lt;/strong&gt; for L1/L2 actions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What We Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deciding between "case only" and "case plus report"&lt;/strong&gt; is as important as spotting the fraud - the policy engine needs to be as rigorous as the detection engine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeping the model away from raw rows&lt;/strong&gt; made runs cheaper and outputs easier to audit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph traversals &amp;gt; ML features&lt;/strong&gt; for discovering coordinated fraud that individual transaction models miss&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TigerGraph's vector search + graph traversals&lt;/strong&gt; together enable a true GraphRAG pattern - combining structured graph reasoning with semantic similarity&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Graph Database&lt;/strong&gt;: TigerGraph (Savanna Cloud)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM&lt;/strong&gt;: Gemini Flash (temperature 0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Python, FastAPI, SSE&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React, TypeScript, Vite, Tailwind, Framer Motion, react-force-graph-2d&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings&lt;/strong&gt;: sentence-transformers/all-MiniLM-L6-v2 (384-d)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph Algorithms&lt;/strong&gt;: WCC, Louvain, PageRank via GSQL&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built at the TigerGraph x Hacker House Goa hackathon. Dataset: IEEE-CIS Fraud Detection (Vesta Corporation).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>database</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>An Agent That Knows When It Doesn't Know - Fraud Investigation on TigerGraph</title>
      <dc:creator>Prafull Gupta</dc:creator>
      <pubDate>Fri, 25 Sep 2026 06:28:34 +0000</pubDate>
      <link>https://dev.to/yash_gupta_4eb6e1b9159a4b/goa-hack-278l</link>
      <guid>https://dev.to/yash_gupta_4eb6e1b9159a4b/goa-hack-278l</guid>
      <description>&lt;h2&gt;
  
  
  What We Built
&lt;/h2&gt;

&lt;p&gt;We built an &lt;strong&gt;agentic fraud investigation system&lt;/strong&gt; on TigerGraph for the &lt;strong&gt;TigerGraph x Hacker House Goa hackathon&lt;/strong&gt;. It takes twenty fraud alerts from the IEEE-CIS dataset (590,742 transactions), investigates each one using graph traversals, calibrates its confidence, and - this is the key part - &lt;strong&gt;asks for more evidence when one signal is not enough&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For each alert the agent produces three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;internal case record&lt;/strong&gt; written into the graph&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;suspicious activity report&lt;/strong&gt; when policy requires one&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;next-best-action&lt;/strong&gt; with an approval route, recorded &lt;em&gt;before and after&lt;/em&gt; any evidence it asks for&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The bank's risk score is an input, not an answer: above 0.7 most flagged transactions are legitimate, and some fraud scores near zero. The agent's job is calibration and restraint as much as detection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alert -&amp;gt; LangGraph agent -&amp;gt; TigerGraph MCP -&amp;gt; TigerGraph (GSQL, algorithms, vectors)
              |                                   ^
              +-&amp;gt; Gemini (temperature 0)            |
              +-&amp;gt; action registry (permissions) ----+ case writeback
              +-&amp;gt; FastAPI (+SSE) -&amp;gt; React analyst UI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pipeline is a state machine:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TRIGGER -&amp;gt; OPEN_CASE -&amp;gt; GATHER_EVIDENCE -&amp;gt; ASSESS -&amp;gt; [uncertain? REQUEST_EVIDENCE -&amp;gt; RE-ASSESS]* -&amp;gt; DECIDE_NBA -&amp;gt; APPROVAL_GATE -&amp;gt; EXPLAIN -&amp;gt; WRITE_CASE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All graph access goes through the tool layer; the model never sees raw rows - only structured evidence briefs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How TigerGraph Is Used
&lt;/h2&gt;

&lt;p&gt;TigerGraph is the backbone of this system. Here's how we used every major capability:&lt;/p&gt;

&lt;h3&gt;
  
  
  Schema Design
&lt;/h3&gt;

&lt;p&gt;We designed a rich graph schema with 12 vertex types and 15+ edge types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Core entities&lt;/strong&gt;: Customer, Card, Transaction, DeviceProfile, EmailDomain, BillingRegion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investigation entities&lt;/strong&gt; (agent-written): Case, Evidence, Action, Pattern, PolicyClause&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Historical&lt;/strong&gt;: ClosedCase (with embeddings for similarity search)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key edges like &lt;code&gt;OWNS&lt;/code&gt;, &lt;code&gt;MADE&lt;/code&gt;, &lt;code&gt;FROM_DEVICE&lt;/code&gt;, &lt;code&gt;BILLED_IN&lt;/code&gt; model the transaction network, while &lt;code&gt;HAS_EVIDENCE&lt;/code&gt;, &lt;code&gt;TOOK&lt;/code&gt;, &lt;code&gt;SIMILAR_TO&lt;/code&gt; capture the agent's reasoning chain.&lt;/p&gt;

&lt;h3&gt;
  
  
  GSQL Queries
&lt;/h3&gt;

&lt;p&gt;We wrote 14 GSQL-backed tool functions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;card_profile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cardholder history: median spend, products, regions, devices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;card_window&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All transactions within +/-72h of the alert&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;velocity_stats&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Transaction velocity in configurable time windows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;device_neighbors&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Other customers sharing this device profile&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;path_to_known_fraud&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shortest path to a confirmed fraud case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fraud_ring_detection&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;WCC + Louvain on shared device/region subgraph&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;similar_cases&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Vector similarity search over closed case embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;policy_lookup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Vector search over policy clause embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Graph Algorithms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Weakly Connected Components&lt;/strong&gt; and &lt;strong&gt;Louvain Community Detection&lt;/strong&gt; on the shared device / region / email subgraph to find fraud rings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PageRank&lt;/strong&gt; for entity centrality - identifying the most connected nodes in suspicious clusters&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Vector Search (GraphRAG)
&lt;/h3&gt;

&lt;p&gt;We embedded closed-case narratives and policy clauses using MiniLM (384-d) and stored them as vector attributes on TigerGraph vertices. For each new case, the agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Retrieves similar closed cases by vector similarity&lt;/li&gt;
&lt;li&gt;Finds relevant policy clauses&lt;/li&gt;
&lt;li&gt;Condenses graph facts + similar cases + policy into an evidence brief&lt;/li&gt;
&lt;li&gt;Reasons over that brief with the LLM&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  MCP Integration
&lt;/h3&gt;

&lt;p&gt;The agent's &lt;em&gt;only&lt;/em&gt; interface to the graph is through TigerGraph MCP tools. Every claim in a case file cites a query name and entity IDs - full provenance, no hallucination.&lt;/p&gt;

&lt;h2&gt;
  
  
  Agentic Behaviour - The Interesting Part
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Uncertainty is Explicit
&lt;/h3&gt;

&lt;p&gt;The agent doesn't just classify fraud/not-fraud. It maintains a calibrated probability and uses Bayesian updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;odds_mult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lr&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;sig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;logit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lr&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thresholds come from the fraud policy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&amp;gt;= 0.85&lt;/strong&gt;: Act (with &amp;gt;=2 independent signals)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0.15 - 0.85&lt;/strong&gt;: Request more evidence&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&amp;lt;= 0.15&lt;/strong&gt;: Clear&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Evidence Requests Change Outcomes
&lt;/h3&gt;

&lt;p&gt;When uncertain, the agent requests customer validation, step-up authentication, or analyst review - selecting the channel with the highest &lt;strong&gt;expected information gain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example from Case HHG-001:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initial probability: &lt;strong&gt;0.59&lt;/strong&gt; (out-of-region use pattern)&lt;/li&gt;
&lt;li&gt;Action: VERIFY_WITH_CUSTOMER&lt;/li&gt;
&lt;li&gt;Customer denies the transaction&lt;/li&gt;
&lt;li&gt;Final probability: &lt;strong&gt;0.93&lt;/strong&gt; -&amp;gt; BLOCK_CARD&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. The Recommendation Changes
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;nba_before&lt;/code&gt; and &lt;code&gt;nba_after&lt;/code&gt; are stored with a diff and a reason:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At 0.45 on one signal -&amp;gt; &lt;code&gt;VERIFY_WITH_CUSTOMER&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;After denial -&amp;gt; &lt;code&gt;BLOCK_CARD&lt;/code&gt;, &lt;code&gt;CREATE_CASE&lt;/code&gt;, maybe &lt;code&gt;FILE_REPORT&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Permissions Live in Code
&lt;/h3&gt;

&lt;p&gt;Only &lt;code&gt;auto&lt;/code&gt;-routed actions execute. &lt;code&gt;L1&lt;/code&gt; (team lead) and &lt;code&gt;L2&lt;/code&gt; (fraud manager) actions are recorded as pending with the approver role. &lt;code&gt;BLOCK_ALL_CARDS&lt;/code&gt; is refused unless policy R10 holds.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Memory Through the Graph
&lt;/h3&gt;

&lt;p&gt;Prior case outcomes are retrieved by vector similarity AND shared entities. They're cited in the case file and change recommendations - a cleared travel case makes the agent verify instead of block.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern Discovery
&lt;/h2&gt;

&lt;p&gt;We ran graph algorithms over the full dataset and discovered two undocumented fraud patterns:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DISC-001: Shared-Device Ring&lt;/strong&gt; - One Samsung SM-G935F behind an anonymous proxy, marked New on 28 different customers' cards within 30 days (60 transactions, $16,556). The graph found it through device-neighbor traversal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DISC-002: Threshold Structuring&lt;/strong&gt; - 3-4 online purchases each just under $500 within 45 minutes on rotating device profiles (44 episodes found).&lt;/p&gt;

&lt;p&gt;Case HHG-014 hit the shared-device ring with &lt;strong&gt;0.988 probability&lt;/strong&gt; - the bank's risk score was 0.05. The graph caught what the model missed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;All &lt;strong&gt;20 benchmark cases&lt;/strong&gt; processed successfully:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cases processed&lt;/td&gt;
&lt;td&gt;20/20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fraud detected&lt;/td&gt;
&lt;td&gt;Multiple patterns including card-not-present, out-of-region, account takeover&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undocumented patterns found&lt;/td&gt;
&lt;td&gt;2 (DISC-001, DISC-002)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SARs generated&lt;/td&gt;
&lt;td&gt;Filed when exposure &amp;gt; $1,000 or shared device/customer fraud&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Avg tool calls per case&lt;/td&gt;
&lt;td&gt;~30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Avg latency&lt;/td&gt;
&lt;td&gt;~5-11 seconds per case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evidence requests&lt;/td&gt;
&lt;td&gt;Bayesian updates with simulated customer/auth responses&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Case HHG-014 - The Graph Found What the Model Missed
&lt;/h3&gt;

&lt;p&gt;The bank's risk score was 0.05 (extremely low risk). But TigerGraph revealed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The device profile was shared by &lt;strong&gt;28 customers&lt;/strong&gt; in 30 days&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100%&lt;/strong&gt; of uses were marked "New"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100%&lt;/strong&gt; were behind an anonymous proxy&lt;/li&gt;
&lt;li&gt;The device appeared on &lt;strong&gt;3 confirmed fraud cases&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The agent classified it as &lt;strong&gt;0.988 probability fraud&lt;/strong&gt; - an undocumented coordinated abuse pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Interface
&lt;/h2&gt;

&lt;p&gt;The analyst UI is a React + TypeScript + Framer Motion application with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Case queue&lt;/strong&gt; with priority sorting&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bento case view&lt;/strong&gt;: verdict, confidence, evidence list&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Before-&amp;gt;After action timeline&lt;/strong&gt; showing how recommendations changed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive subgraph visualization&lt;/strong&gt; (react-force-graph-2d)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live investigation streaming&lt;/strong&gt; via SSE&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Approval workflow&lt;/strong&gt; for L1/L2 actions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What We Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deciding between "case only" and "case plus report"&lt;/strong&gt; is as important as spotting the fraud - the policy engine needs to be as rigorous as the detection engine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeping the model away from raw rows&lt;/strong&gt; made runs cheaper and outputs easier to audit&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph traversals &amp;gt; ML features&lt;/strong&gt; for discovering coordinated fraud that individual transaction models miss&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TigerGraph's vector search + graph traversals&lt;/strong&gt; together enable a true GraphRAG pattern - combining structured graph reasoning with semantic similarity&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Graph Database&lt;/strong&gt;: TigerGraph (Savanna Cloud)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM&lt;/strong&gt;: Gemini Flash (temperature 0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: Python, FastAPI, SSE&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React, TypeScript, Vite, Tailwind, Framer Motion, react-force-graph-2d&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings&lt;/strong&gt;: sentence-transformers/all-MiniLM-L6-v2 (384-d)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph Algorithms&lt;/strong&gt;: WCC, Louvain, PageRank via GSQL&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Built at the TigerGraph x Hacker House Goa hackathon. Dataset: IEEE-CIS Fraud Detection (Vesta Corporation).&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
