ADAAI Document Automation… waking server (up to ~1 min)

PYTHON · FASTAPI · LANGGRAPH · OCR/VISION · RAG

Intelligent document processing

Paste an invoice (or upload a PDF/image). The agent (a Python backend) classifies the document, extracts the fields (Pydantic), validates the business rules, runs a three-way match against the purchase order, applies deterministic routing rules and — when needed — pauses for human approval. All live.

For recruiters — what this is and what you'll see

HOW TO TEST

  1. Pick an example invoice, edit it, or upload a PDF/image.
  2. Click “Process document” and watch the trace (workflow nodes).
  3. See the extracted fields, validation, three-way match and the routing decision.
  4. An over-threshold or exception document waits for approval — approve or reject.

WHAT IT DEMONSTRATES

  • IDP pipeline — classify → extract → validate → match → route
  • Structured outputs — Pydantic-validated extraction (LLM + regex fallback)
  • Three-way match — invoice ↔ purchase order reconciliation
  • Deterministic rules — safe, auditable routing (no LLM decides payment)
  • RAG + Qdrant — finance/AP policy grounds the decision
  • LangGraph + HITL — durable human-in-the-loop approval
PythonPydanticLangGraphFastAPIVision/OCRRAGQdrantSupabaseDockerpytesteval setobservability

⏳ Waking the document server (free hosting sleeps the service — the first wake-up takes ~30–60 s). You can submit right away — the first response just takes a moment.

Digital PDFs are read from their text layer; scanned images use vision/OCR when an API key is set. With no keys the backend runs a deterministic offline mode.

ℹ️ For the demo to work, disable AdBlock / uBlock for this page and refresh — such extensions can block API requests.

Architecture

Client ─▶ FastAPI ─▶ LangGraph
  ingest_document (Supabase / local storage)
        ▼
  extract_text (PDF text layer · vision OCR · pasted text)
        ▼
  classify → extract_fields (Pydantic) → validate (math / required / dates)
        ▼
  enrich_and_match (vendor master · PO lookup · duplicate check · three-way match)
        ▼
  retrieve_policy (RAG / Qdrant) ─▶ decide (deterministic routing)
        │
   needs_review / escalate ─▶ human_review ─▶ END    auto_approve / route_to_ap / reject ─▶ END
        ▼
  Supabase / PostgreSQL (audit + resume)

The backend starts with safe fallbacks (works deterministically with no API keys) and switches to OpenAI (extraction + vision OCR) + Qdrant + Supabase when keys are set. The routing decision is always deterministic — a model never decides to pay an invoice. Code: Python (FastAPI, LangGraph), pytest tests, an evaluation dataset, Docker.