Gen AI Intelligent Document Processing (GenAIIDP)
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0
📖 Browse the Documentation Site — searchable, with sidebar navigation
Table of Contents
- Table of Contents - Introduction - Alternative Implementations - Key Features - Architecture Overview - Quick Start - Processing Your First Document - Method 1: Web UI (Interactive) - Method 2: Direct S3 Upload (Simple) - Method 3: IDP CLI (Batch/Programmatic) - Updating an Existing Deployment - Detailed Documentation - Core Documentation - Processing Modes - Python Development - Planning \& Operations - Security - Contributing - Project Governance - Security - LicenseIntroduction
A scalable, serverless solution for automated document processing and information extraction using AWS services. This system combines OCR capabilities with generative AI to convert unstructured documents into structured data at scale.
https://github.com/user-attachments/assets/fc2652b5-a9cc-42d7-9975-887c8320a2f5
Concierge support for customization, deployment, and integration of production use cases is available through AWS Professional Services.
Alternative Implementations
Prefer AWS CDK? This solution is also available as GenAI IDP Accelerator for AWS CDK, providing the same functional capabilities through AWS CDK constructs for customers who prefer Infrastructure-as-Code with CDK.
Prefer Terraform? This solution is also available as GenAI IDP Terraform, providing the same functional capabilities as a Terraform module that integrates with existing infrastructure and supports customization through module variables.
Key Features
- Serverless Architecture: Built entirely on AWS serverless technologies including Lambda, Step Functions, SQS, and DynamoDB
- Modular, pluggable patterns: Pre-built processing patterns using state-of-the-art models and AWS services
- Command Line Interface: Programmatic batch processing with evaluation framework, analytics integration, and interactive Agent Chat
- Advanced Classification: Support for page-level and holistic document packet classification
- Few Shot Example Support: Improve accuracy through example-based prompting
- Custom Business Logic Integration: Inject custom prompt generation logic via Lambda functions for specialized document processing
- High Throughput Processing: Handles large volumes of documents through intelligent queuing
- Built-in Resilience: Comprehensive error handling, retries, and throttling management
- Cost Optimization: Pay-per-use pricing model with built-in controls
- Comprehensive Monitoring: Rich CloudWatch dashboard with detailed metrics and logs
- Web User Interface: Modern UI for inspecting document workflow status and results
- Configuration Versioning: Support for multiple configuration versions with version-specific processing and test comparison
- Document Versioning: Every processing run of a document is retained as an immutable version — view, compare, download, and manage prior outputs (see document-versions.md)
- Human-in-the-Loop (HITL): Built-in review system for human validation workflows
- AI-Powered Evaluation: Framework to assess accuracy against baseline data
- Extraction Confidence Assessment: LLM-powered assessment of extraction confidence with multimodal document analysis
- Document Knowledge Base Query: Ask questions about your processed documents
- IDP Accelerator Help Chat Bot: Ask questions about the IDP code base or features
- MCP Integration: Model Context Protocol integration enabling external applications like Amazon Quick Suite to access IDP data and analytics through AWS Bedrock AgentCore Gateway
Architecture Overview
The solution uses a modular architecture with nested CloudFormation stacks to support multiple document processing patterns while maintaining common infrastructure for queueing, tracking, and monitoring.
The unified pattern supports two processing modes, controlled by the use_bda configuration flag:
- Pipeline mode (default): OCR → Bedrock Classification (page-level or holistic) → Bedrock Extraction → Assessment → Rule Validation → Summarization
- BDA mode: End-to-end processing with Bedrock Data Automation (BDA) → Rule Validation → Summarization
Quick Start
To quickly deploy the GenAI-IDP solution in your AWS account:
- Log into the AWS console
- Choose the Launch Stack button below for your desired region:
⚠️ The Canada (Central) button serves artifacts from v0.6.12 onward. Until that release is published it answers a CloudFormation "template not found" error; deploy an earlier release from source instead (see Canada (Central) Region Model Support).
- When the stack deploys for the first time, you'll receive an email with a temporary password to access the web UI
- Use this temporary password for your first login to set up a permanent password
Processing Your First Document
After deployment, choose the processing method that fits your use case:
Method 1: Web UI (Interactive)
- Open the Web UI URL from CloudFormation stack Outputs
- Log in and click "Upload Document"
- Upload a sample document:
- Monitor processing and view results in the dashboard
Method 2: Direct S3 Upload (Simple)
- Upload to the InputBucket (URL in CloudFormation Outputs)
- Monitor via Step Functions console
- Results appear in OutputBucket automatically
Method 3: IDP CLI (Batch/Programmatic)
For batch processing, automation, or evaluation workflows:
# Install the CLI, from the repository root. All three first-party packages go in
ONE pip invocation, so the sibling names they require resolve from this checkout.
pip install -e lib/idp_common_pkg -e lib/idp_sdk -e lib/idp_cli_pkg
Process documents
idp-cli run-inference \
--stack-name <your-stack-name> \
--dir ./samples/ \
--monitor
Download results
idp-cli download-results \
--stack-name <your-stack-name> \
--batch-id <batch-id> \
--output-dir ./results/
make setup (or make setup-venv) installs the same three packages the same way,
along with the rest of the development dependencies. Either way the packages must
come from a path and go in a single command: the names they require of each other
are registered on public PyPI by unrelated parties, so a one-at-a-time install can
resolve a sibling from the index instead of from lib/. See
Installing First-Party Packages Safely.
See IDP CLI Documentation for:
- CLI-based stack deployment and updates
- Batch document processing
- Complete evaluation workflows with baselines
- Athena and Agent Analytics integration
- CI/CD integration examples
IMPORTANT: If you have not previously done so, you must request access to the following Amazon Bedrock models:
- Amazon: All Nova models, plus Titan Text Embeddings V2
- Anthropic: Claude 3.x models, Claude 4.x models
Updating an Existing Deployment
To update an existing GenAIIDP stack to a new version:
- Navigate to CloudFormation in the AWS Management Console
- Select your existing stack
- Click "Update"
- Select "Replace current template"
- Enter the template URL:
https://s3.us-west-2.amazonaws.com/aws-ml-blog-us-west-2/artifacts/genai-idp/idp-main.yaml
- us-east-1: https://s3.us-east-1.amazonaws.com/aws-ml-blog-us-east-1/artifacts/genai-idp/idp-main.yaml
- eu-central-1: https://s3.eu-central-1.amazonaws.com/aws-ml-blog-eu-central-1/artifacts/genai-idp/idp-main.yaml
- ca-central-1: https://s3.ca-central-1.amazonaws.com/aws-bigdata-blog-replica-ca-central-1/artifacts/genai-idp/idp-main.yaml
- Follow the prompts to update your stack, reviewing any parameter changes
- For detailed instructions, see the Deployment Guide
For detailed deployment and testing instructions, see the Deployment Guide.
Detailed Documentation
📖 Browse all documentation on the GenAIIDP Docs Site — full-text search, sidebar navigation, and organized by topic.
Core Documentation
- Architecture - Detailed component architecture and data flow
- Demo Videos - Comprehensive collection of feature demonstration videos
- Deployment - Build, publish, deploy, and test instructions
- Headless Deployment - Backend-only deployment (no Web UI, no UI REST API, no Cognito, no WAF) for API-only use cases
- GovCloud Deployment - Deploy to GovCloud with the full Web UI (
--govcloud) or headless (--headless) - IDP CLI - Command line interface for batch processing, evaluation workflows, and interactive Agent Chat
- Web UI - Web interface features and usage
- Document Versions - Retain, view, compare, and manage every processing run of a document
- Agent Analysis - Natural language analytics and data visualization feature
- Custom MCP Agent - Integrating external MCP servers for custom tools and capabilities
- Configuration - Configuration and customization options
- JSON Schema Migration - JSON Schema format guide and legacy migration details
- Discovery - Pattern-neutral discovery process and BDA blueprint automation
- Classification - Customizing document classification
- Extraction - Customizing information extraction
- Human-in-the-Loop Review - Human review workflows with built-in review system
- Assessment - Extraction confidence evaluation using LLMs
- Rule Validation - Business rule validation and compliance checking
- Evaluation Framework - Accuracy assessment system with analytics database and reporting
- MLflow Experiment Tracking - Optional MLflow integration for tracking metrics, model parameters, and prompts across test runs
- Knowledge Base - Document knowledge base query feature
- Monitoring - Monitoring and logging capabilities
- IDP Accelerator Help Chat Bot - Chat bot for asking question about the IDP code base and features
- MCP Integration - Model Context Protocol integration for external applications like Amazon Quick Suite
- Reporting Database - Analytics database for evaluation metrics and metering data
- Troubleshooting - Troubleshooting and performance guides
Processing Modes
- Architecture - Unified pattern with BDA and Pipeline processing modes
- BDA Mode Reference - Bedrock Data Automation (BDA) concepts and behavior
- Pipeline Mode Reference - Textract + Bedrock classification and extraction
- Few-Shot Examples - Implementing few-shot examples for improved accuracy
Python Development
- Using Notebooks with IDP Common Library - Guide for using and creating Jupyter notebooks to experiment with the IDP Common Library
- IDP Common Package - Documentation for the core library powering the accelerator
Planning & Operations
- Capacity Planning - Comprehensive capacity planning, performance optimization, and resource scaling guidance
- Well-Architected Framework Review - What the solution implements per pillar, plus a checklist template you fill in for your own deployment
- AWS Services & IAM Roles - AWS services used and IAM role requirements
- Threat Model - STRIDE threat model: trust boundaries, controls in place, residual risks and open items
- Cost Calculator - Framework for estimating solution costs
Security
Security artifacts live under security/ so that coverage
and results are auditable rather than asserted.
- Threat model — a STRIDE model of 99 threats
- Security tests — static analysis and dependency
- Per-release result snapshots — curated,
The threat model is kept current by a build gate rather than by intention:
make check-threat-model-currency (run from make lint-cicd in both CI systems)
fails when the model's recorded Last reviewed against version falls more than one
release behind the repository's VERSION.
If you believe you have found a security issue, please notify AWS/Amazon Security via the vulnerability reporting page rather than opening a public issue — see Reporting a security issue.
Contributing
We welcome contributions to the GenAI Intelligent Document Processing accelerator! Whether you're fixing bugs, improving documentation, or proposing new features, your contributions are appreciated.
Please refer to our Contributing Guide for detailed information on:
- Setting up your development environment
- Project structure
- Making and testing changes
- Pull request process
- Coding standards
ruff for linting
- UI code uses ESLint (npm run lint to verify)
- Documentation requirements
- Issue reporting guidelines
Project Governance
How this project is run is written down, so you can predict what will happen to an issue or a pull request before you open one:
- GOVERNANCE.md — who decides, how a change gets accepted,
develop/main branch and release model, and this repository's relationship
to the CDK and Terraform ports.
- .github/CODEOWNERS — who reviews what, and what
- ROADMAP.md — direction, priorities and explicit non-goals.
Security
Do not open a public issue for anything exploitable. Report it privately to AWS
Security via HackerOne or
[email protected]. Hardening suggestions
and non-exploitable findings are welcome as public issues.
SECURITY.md has the full policy, including which versions are
supported, and security/ holds the threat model and the
curated per-release security test results.
License
This project is licensed under the terms specified in the LICENSE file.