Investigates fraud from uncertain signals and recommends defensible next-best-actions, with case memory, policy guardrails, GraphRAG grounding, and an analyst dashboard.
pip install -r requirements.txt
python data/generator.py --scale standard # quick | standard | full
python scripts/run_20_cases.py # 20 benchmark cases -> outputs/
python -m uvicorn backend.api:app --port 8000
# open http://localhost:8000
pytest -qstandard = 1,200 customers / ~28k txns / 140 prior cases / 20 benchmark triggers.
full mirrors the HHGOA_IEEE shape (13.5k customers / ~590k txns) for TigerGraph-scale runs.
- Agent (
backend/agent.py): Trigger → Investigate → Gather → Assess uncertainty → Request evidence (customer validation / step-up / analyst, all simulated oracles) → NBA before AND after evidence → Explain → Update memory. Stops only when the policy evidence standard (§4.2) is met or evidence rounds are exhausted. - Graph layer (
backend/graph_store.py+gsql/): TigerGraph-first; falls back to local NetworkX with identical tool semantics. GSQL schema + 7 installed queries ship ingsql/. - MCP (
backend/mcp_bridge.py): 8 tools (txn_neighborhood,velocity_burst,shared_identifiers,mule_fan,ato_signals,ring_members,card_history,upsert_case), served at/api/mcp/*, compatible withtigergraph-mcp. - GraphRAG (
backend/rag.py): distills subgraph + patterns + similar cases + policy chunks into a grounded context; calls OpenAI ifOPENAI_API_KEYis set, else a deterministic template explainer (reproducible judging, no key needed). - Memory (
backend/memory.py): TF-IDF + entity-boost recall over closed cases; index refreshes on every close, so recurring entities/patterns improve future cases. - Policy guardrails (
backend/policy_engine.py+data/policies/): risk tiers, evidence standard, approval matrix (auto-execute vs L1/L2/compliance), SAR rules ($3,000 internal bar), customer-contact etiquette. Every action cites policy and records its approval route. - Detectors (
backend/patterns.py): T1 CNP velocity, T2 ATO, T3 mule fan-out/in, T4 collusion ring, T5 bust-out/structuring, plus anemerginganomaly head for undocumented patterns (never force-fit into T1–T5). - Dashboard (
frontend/): case queue, risk/uncertainty, evidence, patterns + memory, pre/post NBA with approvals, SAR draft, k-hop graph (vis-network), full agent trace. - Submissions (
scripts/run_20_cases.py→outputs/): per-case answer file (investigation record, evidence, findings, decisions, actions), graph write receipt, SAR draft when required, NBA + approval route before/after evidence, plusmetrics.json.
trigger → GraphStore (TigerGraph GSQL | local NetworkX)
→ patterns (T1..T5+emerging) → risk calibration → CaseMemory recall
→ GraphRAG (policy+typology+cases) → NBA pre → evidence oracles
→ re-assess → NBA post → execute-or-route → SAR draft → close+memorize
→ FastAPI (/api/*, /api/mcp/*) → analyst dashboard
- Schema (
gsql/schema.gsql): Customer/Account/Card/Device/IP/Merchant/Txn/FraudCase + 11 edges. - Queries (
gsql/queries.gsql): neighborhood, velocity, shared identifiers, mule fan, ATO signals, ring community, case upsert. SetTIGERGRAPH_HOST/GRAPH/USERNAME/PASSWORD(Savanna: enable auto-stop/start) and the agent runs them live; otherwise the local fallback serves the same tools and every trace row records which backend answered. - Graph algorithms: velocity windows, shared-identifier linkage, fan-out counts, community/ cycle signals for rings — the LLM never replaces this; it only reasons over the output.
- Vector: policy/typology chunks + case narratives are TF-IDF indexed locally; on Savanna swap to the built-in vector search without changing the agent.
Place the dataset under data/hhgoa/ (keep filenames from its README) — GraphStore.load()
prefers real CSVs when present and the generator documents the expected columns.
Fraud policy / 5 patterns / regulatory refs already live in data/policies/ for RAG.
- Demo: run the API, investigate 2–3 queue cases live (one pre/post NBA flip), show the graph panel + trace + SAR. Record 3–5 min.
- Blog skeleton: what / architecture / TigerGraph use / agentic capabilities / learnings / next steps — mirror the sections above.
- Social: tag @TigerGraphDB with blog/demo link.
- Uncertainty must be a first-class output (confidence + missing-evidence list), not a footnote.
- Two-stage NBA (pre/post evidence) is what makes the agent defensible under §4.2.
- Next with more time: live Savanna vector search, Louvain ring jobs, analyst-feedback RL, streaming triggers, full 590k load test.