@cdklabs/genai-idp-bda-processor
Project description
GenAI IDP BdaProcessor
This package is provided on an "as-is" basis, and may include bugs, errors, or other issues. All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
Overview
The GenAI IDP BdaProcessor implements intelligent document processing using Amazon Bedrock Data Automation. This package provides a complete AWS CDK implementation for extracting structured data from standard documents with well-defined formats using Amazon's managed document processing capabilities.
The BdaProcessor is ideal for processing common document types such as invoices, receipts, financial statements, and other standardized forms where the structure is consistent and well-understood.
For a detailed exploration of all constructs and their configuration options, we invite you to check out our API documentation. This comprehensive reference will help you make the most of Pattern 1's capabilities in your document processing workflows.
Features
- Amazon Bedrock Data Automation Integration: Leverages Amazon's managed document processing capabilities
- Serverless Architecture: Built on AWS Lambda, Step Functions, and other serverless technologies
- Automatic Document Classification: Identifies document types and applies appropriate extraction schemas
- Configurable Processing Rules: Customize extraction behavior through configuration
- Document Summarization: Optional AI-powered document summarization capabilities
- Evaluation Framework: Built-in mechanisms for evaluating extraction quality
- Comprehensive Metrics: Detailed CloudWatch metrics for monitoring processing performance
- Cost Optimization: Efficient resource utilization to minimize processing costs
Getting Started
Installation
The package is available through npm for JavaScript/TypeScript projects and PyPI for Python projects.
JavaScript/TypeScript (npm)
# Using npm
npm install @cdklabs/genai-idp-bda-processor @cdklabs/genai-idp
# Using yarn
yarn add @cdklabs/genai-idp-bda-processor @cdklabs/genai-idp
Python (PyPI)
# Using pip
pip install cdklabs.genai-idp-bda-processor cdklabs.genai-idp
# Using poetry
poetry add cdklabs.genai-idp-bda-processor cdklabs.genai-idp
Basic Usage
Here's how to integrate BdaProcessor into your IDP solution:
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as kms from 'aws-cdk-lib/aws-kms';
import { ProcessingEnvironment } from '@cdklabs/genai-idp';
import { BdaProcessor, BdaProcessorConfiguration, IDataAutomationProject } from '@cdklabs/genai-idp-bda-processor';
export class MyIdpStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Create encryption key
const key = new kms.Key(this, 'IdpKey', {
enableKeyRotation: true,
});
// Create S3 buckets for input, output, and working data
const inputBucket = new s3.Bucket(this, 'InputBucket', {
encryption: s3.BucketEncryption.KMS,
encryptionKey: key,
eventBridgeEnabled: true,
});
const outputBucket = new s3.Bucket(this, 'OutputBucket', {
encryption: s3.BucketEncryption.KMS,
encryptionKey: key,
});
const workingBucket = new s3.Bucket(this, 'WorkingBucket', {
encryption: s3.BucketEncryption.KMS,
encryptionKey: key,
});
// Create processing environment
const environment = new ProcessingEnvironment(this, 'Environment', {
key,
inputBucket,
outputBucket,
workingBucket,
metricNamespace: 'MyIdpSolution',
});
// Replace with your own configuration - this is just a sample
const configuration = BdaProcessorConfiguration.lendingPackageSample();
// Reference your Bedrock Data Automation project
const dataAutomationProject: IDataAutomationProject = /* Your data automation project */;
// Create the processor
const processor = new BdaProcessor(this, 'Processor', {
environment,
configuration,
dataAutomationProject,
});
}
}
Configuration
BdaProcessor supports extensive configuration options:
- Data Automation Project: Connect to your Amazon Bedrock Data Automation project
- Invokable Models: Specify which models to use for evaluation and summarization
- Guardrails: Apply content guardrails to model interactions
- Concurrency: Control processing throughput and resource utilization
- VPC Configuration: Deploy in a VPC for enhanced security and connectivity
For detailed configuration options, refer to the TypeScript type definitions and JSDoc comments in the source code.
Contributing
We welcome contributions to the GenAI IDP BdaProcessor! Please follow these steps to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure your code adheres to our coding standards and includes appropriate tests.
Related Projects
- @cdklabs/genai-idp: Core IDP constructs and infrastructure
- @cdklabs/genai-idp-bedrock-llm-processor: BedrockLlmProcessor implementation for custom extraction using Amazon Bedrock models
- @cdklabs/genai-idp-sagemaker-udop-processor: SagemakerUdopProcessor implementation for specialized document processing using SageMaker endpoints
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cdklabs_genai_idp_bda_processor-0.0.2.tar.gz.
File metadata
- Download URL: cdklabs_genai_idp_bda_processor-0.0.2.tar.gz
- Upload date:
- Size: 157.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07d952355445de27cf23da6a0a1854983eb892dff8782f90c490ed66723b9c35
|
|
| MD5 |
b983d0a15c8c2d6990769c215739ca3c
|
|
| BLAKE2b-256 |
9b806ccff1c14cd0d45660eac7d9f3ab73b0c56e1bbc8835466779d0720c66c0
|
File details
Details for the file cdklabs_genai_idp_bda_processor-0.0.2-py3-none-any.whl.
File metadata
- Download URL: cdklabs_genai_idp_bda_processor-0.0.2-py3-none-any.whl
- Upload date:
- Size: 156.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a6c6b96b3d2f9f9a8c9423e0336308dc9360a8293fd0b30dd058348c034fe73
|
|
| MD5 |
0fe51566dee995a4c68877c6f20c1634
|
|
| BLAKE2b-256 |
6d8357a1d0a9dc8e69f2bc89a1679f1d6360a9991bad49c33413e04d3e61e454
|