Inspiration

Financial fraud in Mexico and across the globe doesn't vanish without a trace; it leaves a complex paper trail that is often hidden intentionally inside hundreds of scattered documents. Detecting a Empresa Fantasma under SAT's Article 69-B or identifying kickback schemes currently requires auditors to manually cross-reference invoices, bank statements, and vendor registers. This manual process takes days or weeks while money moves away.

Inspired by Infosys's "The Forensic Auditor" challenge at HackMTY 2026, we set out to bridge the gap between human expertise and AI automation. We wanted to build a system that acts as a digital forensic investigator: speeding up tedious cross-checks without acting like a "black box," ensuring every finding is backed by indisputable evidence.

What it does

Forensic Auditor is an AI-powered financial investigator that transforms chaotic, scattered financial records into airtight, court-ready case files in minutes.

Key features include:

  • Automated Data Processing: Users upload financial documents (invoices, bank statements, CFDI schemas, vendor logs), and the agent automatically parses, classifies, and indexes them chronologically and by entity.
  • Interactive Money Trail: Uses a visual node graph to map how funds flow between shell companies, vendors, and internal accounts, surfacing anomalies instantly.
  • Evidence-Backed Reasoning & Chat: Auditors can query the agent directly (e.g., "Why did you flag this supplier?") and receive precise explanations linking directly to specific invoice numbers or bank line items.
  • Case File Generation: Outputs a structured report detailing the scheme, entities involved, total peso amount at risk, and a log of discarded leads.

How we built it

  • Frontend & Visualization: Built with React 19 and Vite for a fast, responsive UI. We integrated React Flow to render interactive, customizable money-trail graphs, and developed a custom design system (typography, color palettes, and audit components) to give the application a professional, trustworthy enterprise feel.
  • Backend: Built on Node.js to handle asynchronous document parsing, coordinate data streams, manage graph data structures, and orchestrate local AI calls efficiently.
  • AI & Local LLM Integration: Powered by Ollama running open-source local LLMs. Using local models with aggressive caching allowed us to handle high-volume analytical queries per investigation without running into strict third-party API rate limits, while maintaining strict data privacy over sensitive financial records.

Challenges we ran into

  1. Eliminating AI Hallucinations in Audit Reports: In financial forensics, a false accusation can ruin a business. Prompting and structuring Ollama's output to strictly refuse allegations unless backed by explicit proof (rule broken + exact peso amount) was a tough engineering challenge.
  2. Structuring Graph Data from Unstructured Inputs: Extracting clean, directed node-edge connections from varied inputs (bank transfers vs. CFDI 4.0 XMLs vs. unstructured PDFs) and converting them for real-time React Flow rendering required solid data normalization in Node.js.
  3. Optimizing Local LLM Performance: Running intensive financial analysis locally via Ollama meant optimizing context window usage and building structured query loops so the agent could navigate deep ledgers efficiently.

Accomplishments that we're proud of

  • Zero Black-Box Accusations: We successfully built an agent that refuses to accuse anyone it cannot back up with hard evidence.
  • High-Quality UX for Enterprise Use: Creating a sleek, custom UI using React 19 and React Flow that feels like a production-ready software suite rather than a rough hackathon prototype.
  • Full Local Execution: Running the AI loop locally via Ollama ensuring privacy, low latency, and infinite querying capabilities without cloud API costs or daily limits.

What we learned

  • Auditing the Auditor: We learned how crucial transparency and explainability are when designing AI for high-stakes industries like finance and law.
  • Graph-Based Reasoning: Visualizing financial networks as graph nodes makes complex multi-hop fraud schemes (like round-tripping or kickbacks) immediately apparent to human reviewers.
  • Local LLM Orchestration: Mastered building agentic workflows using Node.js coupled with local Ollama instances for deterministic JSON output and structured tool-calling.

What's next for forensic finance

  • Multi-Modal Document OCR: Direct ingestion and visual parsing of scanned physical receipts, legacy CSV´S, and handwritten ledger books.

Integration: Live synchronization with official Mexican tax authority blacklists to flag blacklisted suppliers automatically upon document upload.

  • Predictive Risk Scoring: Extending the agent's capabilities to calculate proactive risk scores for vendors before invoices are approved for payment.

Built With

Share this project:

Updates

Submission history