Document AI
Intelligent document processing module with OCR, classification, data extraction, and analysis capabilities powered by AI.
Features
- Document Processing - Upload and process documents with AI
- OCR Processing - Extract text from images, scanned documents, and PDFs
- Document Classification - Automatically categorize documents by type
- Data Extraction - Extract structured data from invoices, receipts, business cards, and ID documents
- Processing Jobs - Track and manage document processing jobs with retry capability
- Extraction Templates - Pre-built templates for common document types
- Integration Endpoints - Built-in endpoints for other modules to use Document AI capabilities
Requirements
| Requirement | Details |
|---|---|
| Dependencies | AICore |
| PHP Version | 8.2+ |
| AI Provider | At least one AI provider configured in AI Core |
Installation
Enable via Admin Panel
- Log in as administrator
- Navigate to Settings > Addons
- Find Document AI and click Enable
Enable via Command Line
php artisan module:enable DocumentAI
php artisan migrate
note
AI Core must be installed and enabled with at least one AI provider configured before enabling this module.
Usage
Dashboard
Access Document AI at /document-ai/. The dashboard shows an overview of processing activity and recent jobs.
Process Documents
Navigate to /document-ai/process to upload and process documents. Select the document type and processing options, then submit for AI-powered extraction.
Processing Jobs
View all processing jobs at /document-ai/jobs:
- Job List - Browse all processing jobs with datatables
- Job Details - View detailed results for each job
- Retry - Retry failed processing jobs
Templates
View available extraction templates at /document-ai/templates.
Integration Endpoints
Document AI provides integration endpoints for other modules to extract data from specific document types:
| Endpoint | Description |
|---|---|
/document-ai/integration/business-card | Extract business card data |
/document-ai/integration/invoice | Extract invoice data |
/document-ai/integration/receipt | Extract receipt data |
/document-ai/integration/id-document | Extract ID document data |
/document-ai/integration/auto | Auto-detect document type and extract |
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/V1/document-ai/process | Process a document |
| POST | /api/V1/document-ai/ocr | Extract text (OCR) |
| POST | /api/V1/document-ai/classify | Classify document type |
| POST | /api/V1/document-ai/extract | Extract structured data |
| GET | /api/V1/document-ai/jobs | List processing jobs |
| GET | /api/V1/document-ai/jobs/{id} | Get job details |
| POST | /api/V1/document-ai/jobs/{id}/retry | Retry a failed job |
| POST | /api/V1/document-ai/jobs/{id}/cancel | Cancel a job |
| GET | /api/V1/document-ai/templates | List extraction templates |
| GET | /api/V1/document-ai/document-types | List supported document types |
| POST | /api/V1/document-ai/extract/business-card | Extract business card data |
| POST | /api/V1/document-ai/extract/invoice | Extract invoice data |
| POST | /api/V1/document-ai/extract/receipt | Extract receipt data |
| POST | /api/V1/document-ai/extract/id-document | Extract ID document data |
| POST | /api/V1/document-ai/extract/auto | Auto-detect and extract |
| POST | /api/V1/document-ai/extract/custom | Custom extraction |
Supported Formats
- Images: JPG, PNG, TIFF, BMP
- Documents: PDF (scanned and native)
Notes
- Large documents are processed in background queues
- Extraction accuracy depends on document quality and the AI model used
- All processed documents are tracked through the jobs system
- Integration endpoints allow other modules to leverage Document AI capabilities
Changelog: View version history