An AI-powered invoice processing agent built with LlamaIndex Workflows and event-driven architecture.
Processing invoices is tedious. You receive a PDF, manually read the supplier name, tax ID, line items, totals — then type it all into your ERP. Every. Single. Time.
This project replaces that manual process with an AI agent that reads the invoice, understands its structure, extracts every field, and syncs the data to your ERP.
Most AI projects start as linear scripts: call an API, parse the result, save it. It works until it doesn't — then you're debugging a 200-line function with no visibility into what went wrong.
This project uses LlamaIndex Workflows to build the agent as a series of small, independent steps connected through typed events. Each step does one thing, emits an event, and the next step picks it up.
This gives us:
- Observability — Every step is traced. You see exactly what happened, what data flowed between steps, and where things failed. Plug in Arize Phoenix or any OpenTelemetry backend and get a full visual timeline.
- Resilience — Steps fail independently. A parsing failure doesn't crash the whole pipeline — it returns a clean error response while the rest of the system stays healthy.
- Extensibility — Adding a new step (validation, human approval, ERP sync, notification) means writing one function that listens for an event and emits another. No refactoring existing code.
- Testability — Each step can be tested in isolation by sending it a mock event and asserting the output event.
POC phase — The core pipeline works end-to-end: upload a PDF invoice, get back structured JSON with all fields extracted.
See server/README.md for setup and running instructions.