[ SYSTEM_CORE: PROJECT_NODE_067nxdwd47 ]

AI INVOICE EXTRACTOR (HITL)

AI Invoice Extractor (HITL)

AI Invoice Extractor (HITL)

An End-to-End Intelligent Document Processing (IDP) engine featuring automated AI extraction, n8n workflow orchestration

AI Invoice Extractor (HITL) 🚀📄 An enterprise-grade Intelligent Document Processing (IDP) pipeline designed to automate the extraction of data from invoices and receipts using AI (Google Gemini via n8n), coupled with a robust Human-In-The-Loop (HITL) review system.

Built for scalability, this project streamlines the accounts payable and data-entry workflow by replacing manual processes with an AI-driven, event-based automation engine.

💡 Business Value & Use Case In modern enterprises, manual invoice processing is slow, error-prone, and expensive. This platform solves the problem by providing:

Automated Extraction: Invoices are uploaded and instantly queued. An AI agent automatically extracts critical structured fields (Invoice Number, Total, Vendor, Line Items). Confidence Thresholding & Auto-Approval: The system calculates a confidence score. If the AI is highly confident (e.g., >80%), the document is automatically approved for downstream processing (ERP/Accounting software). Human-In-The-Loop (HITL) Review: Documents failing the confidence threshold are flagged for manual review. Human operators can instantly verify data, correct mistakes, and approve the document. Immutable Audit Trail: Every action—from system uploads to AI processing to human corrections—is securely tracked for compliance and auditing. Real-time Analytics: A global dashboard providing insights into document processing volumes, pending reviews, and automation success rates. 🛠️ Technology Stack & Architecture This project uses a modern, decoupled, Event-Driven Architecture (EDA):

Backend API: Java 21, Spring Boot 3, Spring Security Frontend App: Next.js 14, React, Tailwind CSS Database: PostgreSQL (Hibernate/JPA) Message Broker: RabbitMQ (AMQP) AI Automation: n8n (Node-based workflow automation), Google Gemini API Containerization: Docker & Docker Compose 🔄 The Event-Driven Pipeline (What We Did & Why) Previous Architecture: The system relied on synchronous HTTP webhooks. While functional, HTTP calls can timeout, fail silently, and couple the backend tightly to the extraction service. Current Architecture (RabbitMQ): We migrated to an asynchronous Event-Driven Architecture using RabbitMQ.

Why? Message queues guarantee delivery. If the AI service (n8n) goes down or rate limits are hit, messages remain safely in the queue until the service recovers. This provides enterprise-level resilience, decoupling, and scalability. Upload: User uploads a document via the Next.js frontend. Event Published: Spring Boot saves the file and publishes a {"documentId": "..."} JSON message to a RabbitMQ Exchange. Queue Consumption: n8n acts as a consumer, picking up the message from the RabbitMQ queue immediately. AI Processing: n8n downloads the file and passes it to Google Gemini for structured data extraction. Webhook Return: n8n posts the extracted JSON payload back to the Spring Boot /extraction webhook. Threshold Check & Audit: Spring Boot validates the data, updates the status (APPROVED or NEEDS_REVIEW), and logs the audit trail.

Technology Map

Spring Boot 3Next Js n8n RabbitMQ

Telemetry Core

SYSTEM HEALTH100%
UPTIME99.9%
BUILDSTABLE