Skip to content

Commit df4bfc0

Browse files
author
Bob Strahan
committed
Merge branch 'develop' v0.3.14
2 parents 5df7371 + 19d2628 commit df4bfc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2515
-1630
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ SPDX-License-Identifier: MIT-0
55

66
## [Unreleased]
77

8+
## [0.3.14]
9+
10+
### Added
11+
- Support for 1m token context for Claude Sonnet 4
12+
- Video demo of "Chat with Document" in [](./docs/web-ui.md)
13+
- **Human-in-the-Loop (HITL) Support Extended to Pattern-2**
14+
- Added HITL review capabilities for Pattern-2 (Textract + Bedrock processing) using Amazon SageMaker Augmented AI (A2I)
15+
- Enables human validation and correction when extraction confidence falls below configurable threshold
16+
- Includes same features as Pattern-1 HITL: automatic triggering, review portal integration, and seamless result updates
17+
18+
### Removed
19+
- Windows development environment guide and setup script removed as it proved insufficiently robust
20+
21+
### Fixed
22+
- Fix 1-click Launch URL output from the GovCloud template generation script
23+
- Add Agent Analytics to architecture diagram
24+
- Fix various UX and error reporting issues with the new Python publish script
25+
- Simplify UDOP model path construction and avoid invalid default for regions other than us-east-1 and us-west-2
26+
- Permission regression from previous release affecting "Chat with Document"
27+
28+
829
## [0.3.13]
930

1031
### Added

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ White-glove customization, deployment, and integration support for production us
3939
- **Cost Optimization**: Pay-per-use pricing model with built-in controls
4040
- **Comprehensive Monitoring**: Rich CloudWatch dashboard with detailed metrics and logs
4141
- **Web User Interface**: Modern UI for inspecting document workflow status and results
42+
- **Human-in-the-Loop (HITL)**: Amazon A2I integration for human review workflows (Pattern 1 & Pattern 2)
43+
- **Note**: When deploying multiple patterns with HITL, reuse existing private workteam ARN due to AWS account limits
4244
- **AI-Powered Evaluation**: Framework to assess accuracy against baseline data
4345
- **Extraction Confidence Assessment**: LLM-powered assessment of extraction confidence with multimodal document analysis
4446
- **Document Knowledge Base Query**: Ask questions about your processed documents
@@ -128,6 +130,7 @@ For detailed deployment and testing instructions, see the [Deployment Guide](./d
128130
- [Configuration](./docs/configuration.md) - Configuration and customization options
129131
- [Classification](./docs/classification.md) - Customizing document classification
130132
- [Extraction](./docs/extraction.md) - Customizing information extraction
133+
- [Human-in-the-Loop Review](./docs/human-review.md) - Human review workflows with Amazon A2I
131134
- [Assessment](./docs/assessment.md) - Extraction confidence evaluation using LLMs
132135
- [Evaluation Framework](./docs/evaluation.md) - Accuracy assessment system with analytics database and reporting
133136
- [Knowledge Base](./docs/knowledge-base.md) - Document knowledge base query feature

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.14-wip
1+
0.3.14

docs/agent-analysis.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ https://github.com/user-attachments/assets/e2dea2c5-5eb1-42f6-9af5-469afd2135a7
3737

3838
## Architecture
3939

40+
The architecture of the Agent Analysis feature is shown below. The Web UI and AppSync API components are the same as used by the rest of the IDP system (with new AppSync endpoints added). Note the inclusion of Amazon Athena and the AgentCore Code Interpreter is specific to the Analytics Agent, but the Agent Request Handler and Processor lambdas along with jobs table are used for all agents, including [MCP agents](./custom-MCP-agent.md).
41+
42+
![Architecture Diagram](../images/IDP-AnalyticsAgent.drawio.png)
43+
4044
### Multi-Agent System
4145

4246
The Agent Analysis feature uses a multi-agent architecture with:
4347

4448
1. **Orchestrator Agent**: Routes queries to appropriate specialized agents based on query content and agent capabilities
4549
2. **Analytics Agent**: Handles data analysis, SQL generation, and visualization creation
46-
3. **Dummy Agent**: Provides simple calculations and development testing capabilities
47-
4. **External MCP Agents**: Custom agents connected via Model Context Protocol servers
48-
5. **Extensible Framework**: Easy addition of new specialized agents for specific use cases
50+
3. **External MCP Agents**: Custom agents connected via Model Context Protocol servers
51+
4952

5053
### Agent Workflow
5154

docs/custom-MCP-agent.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,9 @@ The External MCP Agent allows you to:
2020
- **Real-time Integration**: Tools are available immediately through the IDP web interface
2121

2222
## Architecture
23+
An example architecture demonstrating the authentication flow and connections between the MCP Client (running in the IDP application) and an external MCP Server (deployed outside of the IDP application) can be seen below. The `get_client_address` and `send_verification_email` APIs drawn are just for demonstration purposes.
2324

24-
```
25-
┌─────────────────────┐ ┌──────────────────────┐ ┌─────────────────────┐
26-
│ IDP Solution │ │ Your AWS Account │ │ Your MCP Server │
27-
│ │ │ │ │ │
28-
│ ┌─────────────────┐ │ │ ┌──────────────────┐ │ │ ┌─────────────────┐ │
29-
│ │ External MCP │ │ │ │ AWS Cognito │ │ │ │ Custom Tools │ │
30-
│ │ Agent │◄┼────┼─┤ User Pool │◄┼────┼─┤ - Calculator │ │
31-
│ │ │ │ │ │ │ │ │ │ - Weather API │ │
32-
│ └─────────────────┘ │ │ └──────────────────┘ │ │ │ - Database │ │
33-
│ │ │ │ │ │ - Custom Logic │ │
34-
│ ┌─────────────────┐ │ │ │ │ └─────────────────┘ │
35-
│ │ AWS Secrets │ │ │ │ │ │
36-
│ │ Manager │ │ │ │ │ │
37-
│ └─────────────────┘ │ │ │ │ │
38-
└─────────────────────┘ └──────────────────────┘ └─────────────────────┘
39-
```
25+
![Architecture Diagram](../images/IDP-external-mcp-example.drawio.png)
4026

4127
## Prerequisites
4228

docs/govcloud-deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You need to have the following packages installed on your computer:
4242
3. [sam (AWS SAM)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html)
4343
4. python 3.11 or later
4444
5. A local Docker daemon
45-
6. Python packages for publish.py: `pip install boto3 typer rich botocore setuptools`
45+
6. Python packages for publish.py: `pip install boto3 rich PyYAML botocore setuptools`
4646

4747
### Step 1: Generate GovCloud Template
4848

@@ -65,7 +65,7 @@ aws cloudformation deploy \
6565
--template-file .aws-sam/idp-govcloud.yaml \
6666
--stack-name my-idp-govcloud-stack \
6767
--region us-gov-west-1 \
68-
--capabilities CAPABILITY_IAM \
68+
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
6969
--parameter-overrides \
7070
IDPPattern="Pattern2 - Packet processing with Textract and Bedrock"
7171
```

docs/human-review.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Human-in-the-Loop (HITL) Review
2+
3+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
SPDX-License-Identifier: MIT-0
5+
6+
## Table of Contents
7+
8+
- [Overview](#overview)
9+
- [Architecture](#architecture)
10+
- [Workflow](#workflow)
11+
- [Configuration](#configuration)
12+
- [Review Portal](#review-portal)
13+
- [Best Practices](#best-practices)
14+
- [Troubleshooting](#troubleshooting)
15+
- [Known Limitations](#known-limitations)
16+
17+
## Overview
18+
19+
The GenAI-IDP solution supports Human-in-the-Loop (HITL) review capabilities using Amazon SageMaker Augmented AI (A2I). This feature enables human reviewers to validate and correct extracted information when the system's confidence falls below a specified threshold, ensuring accuracy for critical document processing workflows.
20+
21+
**Supported Patterns:**
22+
- Pattern 1: BDA processing with HITL review
23+
- Pattern 2: Textract + Bedrock processing with HITL review
24+
25+
26+
https://github.com/user-attachments/assets/126c9a70-6811-46f3-9166-ef71397ea4bc
27+
28+
29+
30+
## Architecture
31+
32+
The HITL system integrates with the document processing workflow through:
33+
34+
- **Amazon SageMaker A2I**: Manages human review tasks and workflows
35+
- **Private Workforce**: Secure reviewer access with existing credentials
36+
- **Review Portal**: Web interface for validation and correction
37+
- **Confidence Assessment**: Automated triggering based on extraction confidence scores
38+
39+
<img src="../images/hitl_a2i_workflow.png" alt="HITL Flow diagram" width="800">
40+
41+
## Workflow
42+
43+
### 1. Automatic Triggering
44+
45+
HITL review is automatically triggered when:
46+
- HITL feature is enabled in your configuration
47+
- Extraction confidence score falls below the configured threshold
48+
- The system creates a human review task in SageMaker A2I
49+
50+
### 2. Review Process
51+
52+
**Access:**
53+
- Reviewers access the SageMaker A2I Review Portal (URL available in CloudFormation output `SageMakerA2IReviewPortalURL`)
54+
- Login credentials are the same as those used for the GenAI IDP portal
55+
56+
**Review Tasks:**
57+
- Extracted key-value pairs are presented for validation and correction
58+
- Reviewers can validate correct extractions or make necessary corrections
59+
- Submit corrections using the "Submit" button
60+
61+
### 3. Result Integration
62+
63+
- Corrected key-value pairs automatically update the source results
64+
- The document processing workflow continues with the human-verified data
65+
- Processing status is updated to reflect human review completion
66+
67+
## Configuration
68+
69+
### Deployment Parameters
70+
71+
**Pattern 1:**
72+
- `EnableHITL`: Boolean parameter to enable/disable the HITL feature
73+
- `Pattern1 - Existing Private Workforce ARN`: parameter to use existing private workforce (reuse existing private workteam ARN due to AWS account limits)
74+
75+
**Pattern 2:**
76+
- `EnableHITL`: Boolean parameter to enable/disable the HITL feature
77+
- `Pattern2 - Existing Private Workforce ARN`: parameter to use existing private workforce (reuse existing private workteam ARN due to AWS account limits)
78+
79+
### Confidence Threshold Configuration
80+
81+
The confidence threshold determines when human review is triggered:
82+
83+
1. **Access the Web UI**: Open the Web UI URL from your CloudFormation stack outputs
84+
2. **Navigate to Configuration**: Click on the "Configuration" tab in the navigation menu
85+
3. **Find Assessment & HITL Section**: Scroll to the "Assessment & HITL Configuration" section
86+
4. **Set Confidence Threshold**:
87+
- Enter a value between 0.0-1.0 (e.g., 0.8 for 80% confidence threshold)
88+
- Fields with confidence scores below this threshold will trigger HITL review
89+
5. **Save Configuration**: Click "Save" to apply the changes
90+
91+
The confidence threshold is stored as a configuration parameter and automatically applied to new document processing without requiring stack redeployment.
92+
93+
## Review Portal
94+
95+
### Accessing the Portal
96+
97+
The SageMaker A2I Review Portal URL is available in your CloudFormation stack outputs as `SageMakerA2IReviewPortalURL`.
98+
99+
### Portal Features
100+
101+
- **Task Queue**: View all pending review tasks
102+
- **Document Preview**: Visual representation of the document being reviewed
103+
- **Key-Value Editor**: Interface for validating and correcting extracted data
104+
- **Submission Controls**: Submit approved or corrected extractions
105+
106+
### Reviewer Credentials
107+
108+
- Use the same credentials as the GenAI IDP Web UI portal
109+
- If using an existing private workforce, provide the workforce ARN during deployment
110+
111+
## Best Practices
112+
113+
### Review Management
114+
- **Regular Monitoring**: Check the Review Portal regularly for pending tasks to avoid processing delays
115+
- **Consistent Guidelines**: Establish consistent correction guidelines if multiple reviewers are involved
116+
- **Quality Assurance**: Implement review quality checks for critical document types
117+
118+
### Threshold Optimization
119+
- **Start Conservative**: Begin with higher confidence thresholds (0.8-0.9) and adjust based on accuracy needs
120+
- **Monitor Performance**: Track review frequency and accuracy improvements to optimize thresholds
121+
- **Document-Specific**: Consider different thresholds for different document types based on complexity
122+
123+
### Workflow Integration
124+
- **Training**: Ensure reviewers understand the document types and expected extraction fields
125+
- **Escalation**: Define processes for complex cases that require additional expertise
126+
- **Feedback Loop**: Use review corrections to improve extraction prompts and configurations
127+
128+
## Troubleshooting
129+
130+
### Common Issues
131+
132+
**No Review Tasks Appearing:**
133+
- Verify HITL is enabled in deployment parameters
134+
- Check confidence threshold settings in Web UI configuration
135+
- Ensure documents are triggering confidence scores below threshold
136+
137+
**Portal Access Issues:**
138+
- Verify reviewer credentials match GenAI IDP Web UI credentials
139+
- Check private workforce configuration if using existing workforce
140+
- Confirm portal URL from CloudFormation outputs
141+
142+
**Review Submissions Not Processing:**
143+
- Check Step Functions execution for error details
144+
- Verify A2I workflow definition is properly configured
145+
- Review CloudWatch logs for processing errors
146+
147+
### Monitoring
148+
149+
Monitor HITL performance through:
150+
- **CloudWatch Metrics**: Track review task creation and completion rates
151+
- **Step Functions**: Monitor workflow execution and HITL integration points
152+
- **Web UI Dashboard**: View document processing status including HITL stages
153+
154+
## Known Limitations
155+
156+
### Current Limitations
157+
158+
- **Task Navigation**: Current version of SageMaker A2I cannot provide direct hyperlink to specific document tasks. When reviewers click on review document URL, the portal displays all review tasks without task-specific navigation.
159+
160+
- **Template Updates**: Updating SageMaker A2I Template and workflow performs deletion on A2I flow definition and custom template, then recreates resources via Lambda function. Direct updates to A2I resources through Python SDK are not supported.
161+
162+
- **Private Workforce Cognito Limitation**: AWS SageMaker Ground Truth allows only **one private workforce per Cognito User Pool** per AWS account. This creates a critical dependency when deploying multiple GenAI-IDP stacks with HITL enabled:
163+
- Each private workforce must be mapped to a unique Cognito client
164+
- Multiple stacks cannot create separate private workforces if they use the same Cognito User Pool
165+
- **Risk**: If the first stack (that created the private workforce) is deleted, it will break the private workteam for all other stacks using the same workforce
166+
- **Recommendation**: Always reuse existing private workteam ARNs when deploying additional patterns or stacks with HITL enabled
167+
- Use the `ExistingPrivateWorkforceArn` parameter to reference the workforce created by your first HITL-enabled deployment
168+
169+
### Workarounds
170+
171+
- **Task Management**: Reviewers should process tasks in chronological order or use task identifiers to track specific documents
172+
- **Configuration Changes**: Plan A2I template updates during maintenance windows to minimize disruption
173+
- **Multi-Stack HITL Deployment**:
174+
1. Deploy your first HITL-enabled stack and note the `PrivateWorkteamArn` from CloudFormation outputs
175+
2. For subsequent stacks, provide this ARN in the `ExistingPrivateWorkforceArn` parameter
176+
3. Never delete the original stack that created the private workforce without first migrating the workforce to another stack
177+
4. Consider creating a dedicated "HITL infrastructure" stack to manage the private workforce independently

docs/pattern-1.md

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -196,49 +196,11 @@ payload = {
196196

197197
Pattern-1 supports Human-in-the-Loop (HITL) review capabilities using Amazon SageMaker Augmented AI (A2I). This feature allows human reviewers to validate and correct extracted information when the system's confidence falls below a specified threshold.
198198

199-
#### HITL Workflow
200-
1. **Automatic Triggering**:
201-
- HITL is triggered when the feature is enabled in your configuration
202-
- Extraction confidence score falls below your configured confidence threshold
203-
- The system creates a human review task in SageMaker A2I
204-
205-
2. **Review Process**:
206-
- Reviewers access the SageMaker A2I Review Portal (URL available in CloudFormation output `SageMakerA2IReviewPortalURL`)
207-
- Login credentials are the same as those used for the GenAI IDP portal (if you want to use your own Private work team, you can provide your existing private workforce work team arn as a input parameter for `Pattern1 - Existing Private Workforce ARN`)
208-
- Extracted key-value pairs are presented for validation and correction
209-
- Reviewers validate correct extractions or make necessary corrections
210-
- After review, corrections are submitted with the "Submit" button
211-
212-
3. **Result Integration**:
213-
- Corrected key-value pairs automatically update the source results
214-
- The document processing workflow continues with the human-verified data
215-
216-
<img src="../../images/hitl_a2i_workflow.png" alt="HITL Flow diagram" width="800">
217-
218-
#### Configuration
199+
**Pattern-1 Specific Configuration:**
219200
- `EnableHITL`: Boolean parameter to enable/disable the HITL feature
220-
- **Confidence Threshold**: Configured through the Web UI Portal Configuration tab under "Assessment & HITL Configuration" section. This numeric value (0.0-1.0) determines when human review is triggered based on extraction confidence scores.
201+
- `Pattern1 - Existing Private Workforce ARN`: Optional parameter to use existing private workforce
221202

222-
#### Configuring Confidence Threshold
223-
To set the confidence threshold for HITL triggering:
224-
225-
1. **Access the Web UI**: Open the Web UI URL from your CloudFormation stack outputs
226-
2. **Navigate to Configuration**: Click on the "Configuration" tab in the navigation menu
227-
3. **Find Assessment & HITL Section**: Scroll to the "Assessment & HITL Configuration" section
228-
4. **Set Confidence Threshold**:
229-
- Enter a value between 0.0-1.0 (e.g., 0.8 for 80% confidence threshold)
230-
- Fields with confidence scores below this threshold will trigger HITL review
231-
5. **Save Configuration**: Click "Save" to apply the changes
232-
233-
The confidence threshold is stored as a configuration parameter and automatically applied to new document processing without requiring stack redeployment.
234-
235-
#### Best Practices
236-
- Regularly check the Review Portal for pending tasks to avoid processing delays
237-
- Establish consistent correction guidelines if multiple reviewers are involved
238-
239-
#### Known Limitations
240-
- Current version of SageMaker A2I cannot provide direct hyperlink to respective document tasks. When reviewer clicks on review document URL and start working, review portal will start displating all review tasks. Reviewer cannot pick specific task and start working.
241-
- Updating SageMaker A2I Template and workflow performs deletion on A2I flow definition, A2I custom template and recreate the resources via lambda function. Update A2I resources through Python SDK is not allowed.
203+
For comprehensive HITL documentation including workflow details, configuration steps, best practices, and troubleshooting, see the [Human-in-the-Loop Review Guide](./human-review.md).
242204

243205
## Best Practices
244206
1. **BDA Project Configuration**:

0 commit comments

Comments
 (0)