Building a Real-Time Agentic Fraud Sentinel using TigerGraph, FastAPI, and Vercel
Financial fraud in the modern digital age is complex, fast, and highly networked. Traditional relational (SQL) databases struggle when analyzing multi-hop connectionsβsuch as shared IP addresses, linked device IDs, and r
Financial fraud in the modern digital age is complex, fast, and highly networked. Traditional relational (SQL) databases struggle when analyzing multi-hop connectionsβsuch as shared IP addresses, linked device IDs, and rapid money transfers across accountsβbecause deeply nested JOIN operations introduce severe latency.
To tackle this, we built Agentic Fraud Sentinel: an autonomous, real-time fraud detection system powered by TigerGraphβs GraphRAG engine and a FastAPI backend. It analyzes transaction streams, traverses deep graph networks in milliseconds, and provides actionable decisions with explainable Chain-of-Thought (CoT) reasoning.
ποΈ High-Level System Architecture
Our solution follows a decoupled full-stack architecture to ensure low latency and high scalability:
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β Frontend (Vercel) β HTTP β Backend (Render) β
β - Single-page Dashboard β βββββββ> β - FastAPI Application β
β - Tailwind CSS / JS β <βββββββ β - Python 3.x β
ββββββββββββββββββββββββββββ ββββββββββββββ¬ββββββββββββββ
β RESTPP APIs
βΌ
ββββββββββββββββββββββββββββ
β TigerGraph Database β
β - Graph Analytics β
β - GraphRAG Traversal β
ββββββββββββββββββββββββββββ
Frontend (Vercel): Responsive dashboard providing live simulation triggers, risk score meters, and step-by-step reasoning views.
Backend (Render): FastAPI service handling REST endpoints, orchestration, and business logic.
Graph Engine (TigerGraph): Core graph engine running RESTPP endpoints to execute deep multi-hop queries and power GraphRAG evidence extraction.
β‘ Core Features Walkthrough
Real-Time Simulation & Event Triggering
The system accepts live transaction payloads via REST API endpoints. Through an interactive simulation modal, security analysts can trigger test transactions and monitor instant system responses.Multi-Hop Graph Traversal via GraphRAG
When a transaction is flagged, TigerGraph performs rapid graph traversal across connected entity nodes (cards, devices, IPs, merchants). The system returns structured Chain-of-Thought (CoT) steps explaining why a transaction is risky.Historical Case Matching
By querying historical fraud benchmark cases stored in the graph database, the system calculates similarity scores (e.g., 0.94 similarity to prior proxy fraud patterns) to validate new threats instantly.Dynamic Scoring & Next Best Action (NBA)
The sentinel dynamically adjusts confidence scores based on graph evidence:
Pre-NBA Score: 78% (Requires Step-Up Auth)
Post-NBA Score: 95% (Automated Action: BLOCK CARD & FILE SAR)
π οΈ Key Technical Challenge: Troubleshooting Vercel Deployment
Deploying a repository containing both static frontend files (index.html) and backend Python files (main.py, requirements.txt) to Vercel presented a unique engineering roadblock.
The Error
Upon deployment, Vercel threw a 500 FUNCTION_INVOCATION_FAILED error.
Root Cause
Vercel automatically detected Python files in the root folder and attempted to build the app as a Serverless Python Function. Because no serverless wrapper was present, function execution failed.
The Solution
We decoupled the execution layer by instructing Vercel to treat the repository strictly as a static web application:
Created vercel.json for URL Rewrites:
JSON
{
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
]
}
Updated Vercel Project Settings:
Set Framework Preset to Other.
Overrode Build Command and Install Command to remain empty.
Redeployed without build cache.
This successfully rendered our static dashboard on Vercel while our FastAPI backend remained independently hosted on Render.
π₯ Why TigerGraph?
Choosing TigerGraph as our graph engine was pivotal to achieving enterprise-level fraud detection performance:
Unmatched Query Speed: TigerGraphβs RESTPP endpoints execute multi-hop graph traversals with sub-second response times.
GraphRAG Power: Integrating Graph-based Retrieval-Augmented Generation provides rich contextual evidence directly to AI decision workflows.
Scalability: Handles massive dataset connections without degradation in query latency.
π Conclusion & Future Roadmap
The Agentic Fraud Sentinel demonstrates how combining graph databases with modern API-first architectures enables real-time, explainable threat detection.
π Live Frontend Demo: https://tiger-graph-gilt.vercel.app
π GitHub Repository: github.com/das09power/tiger-graph
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.