Spaces:
Sleeping
Sleeping
metadata
title: AP Agent Demo
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
AP Agent Demo - Invoice β PO Matching
AI-powered Accounts Payable processing application that automatically matches invoices to purchase orders, detects backorders, validates suppliers, and identifies duplicates.
Features
- π€ AI-Powered Matching: Uses Azure OpenAI to dynamically match invoice lines to PO lines, handling any column names
- π Backorder Tracking: Automatically calculates remaining quantities per PO line
- β Supplier Validation: Validates suppliers against approved supplier lists
- π Duplicate Detection: Detects duplicate invoices by file hash and business key
- π History & Analytics: Tracks processing history with search and filter capabilities
- π¨ Modern UI: Beautiful React frontend with real-time processing feedback
How to Use
- Upload Invoice: Upload a PDF, DOCX, or TXT invoice file
- Upload PO File: Upload a CSV or Excel file containing purchase order data
- Review Results: The AI agent will:
- Extract invoice fields and line items
- Match invoice lines to PO lines dynamically
- Calculate backorders
- Validate supplier
- Detect duplicates
- Provide approval decision (Approved/Partially Approved/Rejected)
Environment Variables
Set these in your Hugging Face Space settings:
AZURE_OPENAI_ENDPOINT: Your Azure OpenAI endpointAZURE_OPENAI_API_KEY: Your Azure OpenAI API keyAZURE_OPENAI_DEPLOYMENT: Your Azure OpenAI deployment nameAZURE_OPENAI_API_VERSION: (Optional) API version, defaults to 2024-10-21
Optional (for real OCR on scanned invoices):
AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT: Azure Document Intelligence endpointAZURE_DOCUMENT_INTELLIGENCE_KEY: Azure Document Intelligence key
Technical Details
- Backend: FastAPI (Python)
- Frontend: React + TypeScript + Tailwind CSS
- AI: Azure OpenAI (GPT-4)
- Database: SQLite (persistent storage)
- Deployment: Docker on Hugging Face Spaces
License
MIT