<?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: Dhyanesh Mahendiran</title>
    <description>The latest articles on DEV Community by Dhyanesh Mahendiran (@dynamo_2723).</description>
    <link>https://dev.to/dynamo_2723</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%2F4141343%2Fd8e69459-5a53-40c0-96ad-df7368c94f53.jpg</url>
      <title>DEV Community: Dhyanesh Mahendiran</title>
      <link>https://dev.to/dynamo_2723</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dynamo_2723"/>
    <language>en</language>
    <item>
      <title>Building FraudSight: A Local GraphRAG Agent for TigerGraph using Mistral-Nemo</title>
      <dc:creator>Dhyanesh Mahendiran</dc:creator>
      <pubDate>Thu, 24 Sep 2026 14:28:29 +0000</pubDate>
      <link>https://dev.to/dynamo_2723/building-fraudsight-a-local-graphrag-agent-for-tigergraph-using-mistral-nemo-36di</link>
      <guid>https://dev.to/dynamo_2723/building-fraudsight-a-local-graphrag-agent-for-tigergraph-using-mistral-nemo-36di</guid>
      <description>&lt;p&gt;Fraud investigation in banking is traditionally a manual, fragmented process. Analysts have to trace money movement, connect shared device profiles, and consult complex policy documents to figure out if a transaction is legitimate or part of a coordinated attack. &lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;TigerGraph Agentic Fraud Investigation Hackathon&lt;/strong&gt;, I built &lt;strong&gt;FraudSight&lt;/strong&gt;: a privacy-first, fully autonomous AI agent that investigates fraud cases, queries a TigerGraph database, and drafts regulatory Suspicious Activity Reports (SARs) without relying on expensive cloud APIs.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of what I built, the architecture, and the engineering hurdles I overcame to make local models behave predictably.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture &amp;amp; TigerGraph Integration
&lt;/h2&gt;

&lt;p&gt;The core of the dataset consists of 6 months of Vesta transaction data, anonymized customer records, and identity profiles. I hosted the graph on &lt;strong&gt;TigerGraph Cloud (Savanna)&lt;/strong&gt;, mapping out a schema connecting &lt;code&gt;Customer&lt;/code&gt;, &lt;code&gt;Card&lt;/code&gt;, &lt;code&gt;Transaction&lt;/code&gt;, &lt;code&gt;DeviceProfile&lt;/code&gt;, and &lt;code&gt;FraudCase&lt;/code&gt; vertices.&lt;/p&gt;

&lt;p&gt;To bridge the gap between the LLM and the database, I integrated the &lt;strong&gt;TigerGraph Model Context Protocol (MCP)&lt;/strong&gt;. Instead of writing hardcoded API wrappers, the MCP exposes the graph database directly to the agent as a suite of executable tools (e.g., &lt;code&gt;get_nodes&lt;/code&gt;, &lt;code&gt;run_query&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Agentic Capabilities: Taming Local Models
&lt;/h2&gt;

&lt;p&gt;A major requirement for my project was running the LLM locally on an RTX 5070 GPU to ensure customer financial data remained private. I used &lt;strong&gt;Mistral-Nemo&lt;/strong&gt; via LangChain. &lt;/p&gt;

&lt;p&gt;However, small local models are notorious for failing at generic ReAct (Reasoning + Acting) loops and hallucinating JSON schemas. If the agent fabricated a Case ID, the hackathon rules dictated an automatic zero score. &lt;/p&gt;

&lt;p&gt;To give the agent deterministic guardrails, I:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Explicitly Bound Tools:&lt;/strong&gt; Bypassed generic agent executors in favor of explicit Ollama tool-binding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforced Pydantic Schemas:&lt;/strong&gt; Used strict Python &lt;code&gt;Enum&lt;/code&gt; and &lt;code&gt;Literal&lt;/code&gt; validation for the final output. The agent physically cannot output a verdict other than &lt;code&gt;fraud&lt;/code&gt;, &lt;code&gt;legitimate&lt;/code&gt;, or &lt;code&gt;uncertain&lt;/code&gt;, and it is forced to cite exact policy rules (R1-R10) when recommending the next best action.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The GraphRAG Innovation &amp;amp; What I Learned
&lt;/h2&gt;

&lt;p&gt;The hardest challenge arose when integrating GraphRAG to allow the agent to semantically search the bank's unstructured fraud policies. &lt;/p&gt;

&lt;p&gt;During development, the cloud vector search endpoint threw a 404 error, breaking the semantic search. Instead of abandoning the feature, I engineered a &lt;strong&gt;local Python cosine-similarity fallback&lt;/strong&gt;. I modified the MCP tool so the agent uses &lt;code&gt;tigergraph__get_nodes&lt;/code&gt; to pull the raw &lt;code&gt;PolicyChunk&lt;/code&gt; embeddings directly from the graph into memory. The application then performs the mathematical cosine similarity comparison locally in Python against the user's query, seamlessly sorting and returning the top policy documents. &lt;/p&gt;

&lt;p&gt;This taught me a vital lesson in building resilient agentic systems: always have local fallbacks for cloud dependencies, and understand the underlying vector math instead of relying purely on abstracted APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Would Improve
&lt;/h2&gt;

&lt;p&gt;With more time, I would transition this to a &lt;strong&gt;Multi-Agent Architecture&lt;/strong&gt; using LangGraph. I would deploy one lightweight "Investigator Agent" dedicated purely to routing and executing TigerGraph MCP queries, and a larger "Policy Judge Agent" responsible for evaluating the retrieved evidence against the regulatory SAR framework. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;FraudSight demonstrates that secure, local agentic workflows can successfully orchestrate complex graph database investigations while adhering to strict banking policies. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Watch the Demo:&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://drive.google.com/file/d/1z7W9mdv8FybHuwPjMBNZBGCKR42j4iuz/view?usp=sharing" rel="noopener noreferrer"&gt;Google Drive Demo Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View the Code:&lt;/strong&gt; &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/DYNAMOatGHUB" rel="noopener noreferrer"&gt;
        DYNAMOatGHUB
      &lt;/a&gt; / &lt;a href="https://github.com/DYNAMOatGHUB/TigerGraph_Agentic_Fraud_Investigation" rel="noopener noreferrer"&gt;
        TigerGraph_Agentic_Fraud_Investigation
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🔍 FraudSight: Agentic Investigation Engine&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://python.org" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/4ac87a8486dba72eb60e51caa3561b72d85e290b9d56959a7b46278c640a15b1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f507974686f6e2d332e31332d3337373641423f7374796c653d666f722d7468652d6261646765266c6f676f3d707974686f6e266c6f676f436f6c6f723d7768697465" alt="Python"&gt;&lt;/a&gt;
&lt;a href="https://tigergraph.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/12de410a6f88314e74e8c29ee76138bb4554cd92db06ac88df627ff9a318e9ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f546967657247726170682d4d43502d4441354232413f7374796c653d666f722d7468652d6261646765266c6f676f3d6772617068716c266c6f676f436f6c6f723d7768697465" alt="TigerGraph"&gt;&lt;/a&gt;
&lt;a href="https://langchain.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/6cd0751ed4206986e24e33b9738b6eed765b35acdcdc951c8e6780eea0e59254/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c616e6747726170682d52654163745f4167656e742d3441393044393f7374796c653d666f722d7468652d6261646765266c6f676f3d6c616e67636861696e266c6f676f436f6c6f723d7768697465" alt="LangGraph"&gt;&lt;/a&gt;
&lt;a href="https://streamlit.io" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/00cdb3a285651b9bbea8bb19ca257f32545145677c8a904bdba2b202e95817d2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53747265616d6c69742d44617368626f6172642d4646344234423f7374796c653d666f722d7468652d6261646765266c6f676f3d73747265616d6c6974266c6f676f436f6c6f723d7768697465" alt="Streamlit"&gt;&lt;/a&gt;
&lt;a href="https://ollama.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9826c604fcd1fee0431ad1e9f12e0dbc72267d1205f619755a5d0059e40d6224/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f6c6c616d612d6d69737472616c2d2d6e656d6f2d626c61636b3f7374796c653d666f722d7468652d6261646765266c6f676f3d6f6c6c616d61266c6f676f436f6c6f723d7768697465" alt="Ollama"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An autonomous, graph-native fraud investigation agent&lt;/strong&gt; that traverses the TigerGraph knowledge graph via the Model Context Protocol (MCP), applies bank policy rules through GraphRAG, and produces fully structured, hackathon-compliant JSON case reports — all on local GPU compute with zero data leaving the machine.&lt;/p&gt;


&lt;/div&gt;
&lt;br&gt;


&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🏗️ Architecture Overview&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────────────────┐
│                      FraudSight Pipeline                            │
│                                                                     │
│  case_pack.csv ──▶ fraud_agent.py                                   │
│                        │                                            │
│              ┌─────────▼──────────┐                                 │
│              │  mistral-nemo LLM  │  ← Local GPU (RTX 5070)         │
│              │  (Ollama, 12B)     │                                 │
│              └─────────┬──────────┘                                 │
│                        │  ReAct Loop                                │
│              ┌─────────▼──────────┐     ┌──────────────────────┐   │
│              │  TigerGraph MCP    │────▶│  FraudCaseGraph      │   │
│              │  (48 tools)        │     │  (TigerGraph Savanna) │   │
│              └─────────┬──────────┘     └──────────────────────┘   │
│                        │                                            │
│              ┌─────────▼──────────┐                                 │
│              │  GraphRAG          │  ← Policy chunk lookup          │
│              │  (cosine-sim)      │  ← nomic-embed-text (local)     │
│              └─────────┬──────────┘                                 │
│                        │                                            │&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/DYNAMOatGHUB/TigerGraph_Agentic_Fraud_Investigation" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ncduyo81bnnlywmsghx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ncduyo81bnnlywmsghx.png" alt=" " width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flymsgvcn4rq6a5012d0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flymsgvcn4rq6a5012d0t.png" alt=" " width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq30pdmwa23rc7tt5p7l5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq30pdmwa23rc7tt5p7l5.png" alt=" " width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb0iekhbah4o60u7vyxdo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb0iekhbah4o60u7vyxdo.png" alt=" " width="800" height="387"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzn0x3ysg9vvb9orl9163.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzn0x3ysg9vvb9orl9163.png" alt=" " width="294" height="922"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>hackathon</category>
      <category>tigergraph</category>
    </item>
  </channel>
</rss>
