Here is the rewritten Project Story, perfectly formatted for your hackathon submission. I have adjusted the headings to match your exact requirements and rewritten the narrative from a first-person ("I") perspective to highlight your solo achievement.


Inspiration

As a solo developer, I wanted to tackle a real-world enterprise problem: the impending September 2026 EU e-invoicing mandates (specifically France's Factur-X and Germany's ZUGFeRD requirements). Global supply chains are currently drowning in messy, unstructured PDF invoices, and cross-border compliance is a manual, error-prone nightmare.

Furthermore, as AI agents become more autonomous, a critical legal paradox emerges: an AI can prepare a document, but it cannot legally sign it. I was inspired by the Foxit challenge—"Your Agent Shouldn't Sign That"—to build a system that leverages AI for maximum efficiency but strictly enforces human agency for irreversible legal commitments.

What it does

ComplyGraph AI is an autonomous agentic pipeline that transforms messy supplier invoices into jurisdiction-compliant e-invoices. It ingests messy PDFs, extracts structured data with confidence scoring, and validates low-confidence fields (like VAT IDs) against live web registries. Once verified, it generates a compliant Factur-X XML payload using jurisdiction-specific branching logic. Finally, it prepares the document for e-signature but intentionally halts, securely handing off control to the human for the legally binding signature.

How we built it

I built ComplyGraph AI as a full-stack, 4-stage pipeline. I used FastAPI as the orchestration layer and Next.js with Tailwind CSS for the frontend. Supabase acts as the database and state machine, tracking the job lifecycle from ingestion to signature.

  • Milestone 1 (Nutrient DWS): I integrated Nutrient to extract JSON from PDFs, implementing a confidence-scoring threshold ($C < 0.85$) to automatically flag low-confidence fields.
  • Milestone 2 (SerpApi): For flagged fields, I used SerpApi to query live web registries, surfacing deltas for Human-in-the-Loop (HITL) review.
  • Milestone 3 (Jinja2): I used Jinja2 to dynamically generate Factur-X compliant XML, applying deterministic tax logic: $VAT_{total} = Amount_{basis} \times Rate_{jurisdiction}$ (e.g., applying a 20% rate for France vs. 19% for Germany).
  • Milestone 4 (Foxit eSign): I integrated the Foxit API to create the envelope, but engineered a strict boolean gate (approved_by_human: true) to ensure the agent halts before signing.

Challenges we ran into

  • The No-Code Bottleneck: I initially tried using Xano to orchestrate the state machine. However, chaining complex multipart form-data requests (like the Foxit API) in a visual builder proved too rigid. I pivoted to a code-first architecture using Python and Supabase, which gave me granular control and a robust PostgreSQL audit trail.
  • The "Handoff Defense" Paradigm: Designing an agent that knows when to stop is counter-intuitive to standard AI workflows. I had to architect strict boolean gates and explicit halt states in my API to ensure the agent never crosses the non-repudiation boundary.
  • Frontend Tooling Friction: Integrating Tailwind CSS v4 with Next.js 14 caused severe build conflicts and missing module errors. I had to downgrade to Tailwind v3 and manually configure PostCSS to get the beautiful, glass-morphism UI to render correctly.

Accomplishments that we're proud of

Building a complete, production-grade full-stack application entirely on my own in a short timeframe. I am incredibly proud of successfully integrating 6 distinct technologies (FastAPI, Next.js, Supabase, Nutrient, SerpApi, Foxit) into a seamless, end-to-end pipeline. Most importantly, I successfully solved the "Secure Handoff" challenge by making the Foxit API call in real-time while ensuring the agent strictly halts execution before the irreversible signature action.

What we learned

  • Non-Repudiation in AI: The most profound takeaway was understanding that in legal and financial tech, an AI agent's greatest strength is sometimes knowing when to do nothing. Preserving human liability is a feature, not a bug.
  • Deterministic vs. Probabilistic AI: I learned that while LLMs are incredible for unstructured data extraction, they shouldn't be trusted for regulatory compliance math. Combining probabilistic extraction (Nutrient) with deterministic branching logic (Jinja2) is the ultimate recipe for enterprise AI.
  • Full-Stack Agility: Pivoting from a no-code backend to a code-first architecture under time pressure taught me the value of choosing the right tool for complex API chaining, even if it requires more boilerplate.

What's next for ComplyGraph AI

Next, I plan to wrap the FastAPI orchestration layer in LangGraph to give the agent true autonomous reasoning capabilities, allowing it to dynamically decide which validation tools to call based on the document type. I also plan to integrate a real DOCX template engine to fully automate the PDF generation step within Foxit, and expand the Jinja2 branching logic to support multi-jurisdictional tax rules beyond France and Germany.

Built With

Share this project:

Updates

Submission history