Skip to content
프로젝트

aws-samples/aws-smart-product-onboarding

GitHub에서 보기

소개

Reimagine the seller product onboarding experience with generative AI to create product titles and descriptions, categorize, and extract attributes.

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
0

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Smart Product Onboarding

The Smart Product Onboarding accelerator demonstrates an innovative approach to enhancing the product onboarding process for e-commerce platforms. It showcases Bottom-Up Product Categorization, Generative AI-powered product data generation, and intelligent attribute extraction to improve catalog management and product listings. Using generative AI, the accelerator illustrates how to categorize products within complex category trees, generate product titles and descriptions from images and metadata, and extract attributes based on category-specific schemas. This adaptive approach handles changes to the category tree without model retraining and allows for improvement through manual auditing of results. Built on Amazon Bedrock, AWS Step Functions, and AWS Lambda, the accelerator provides a starting point for retailers to explore efficient management of large product catalogs, adaptation to market needs, and delivery of enhanced product information. Customers are encouraged to build upon and customize this accelerator to meet their specific requirements and production needs.

Example

Light bulb photos

Light bulb title and description

Light bulb category

Light bulb attributes

Architecture

Architecture Overview

Detailed diagrams

Technical Approach

The Smart Product Onboarding accelerator comprises three main components, each leveraging advanced AI capabilities to streamline different aspects of the product onboarding process:

Generate Product Data from Images

The Product Data Generation component automatically creates high-quality product titles and descriptions from images. Utilizing Amazon Bedrock with the Anthropic Claude Haiku 5.5 model by default, it analyzes product images and optional metadata to produce engaging and informative product listings. The solution's flexibility allows for customization to suit various e-commerce platforms and product categories, while its serverless architecture ensures scalability and cost-effectiveness for retailers of all sizes.

Bottom-Up Product Categorization

At the heart of the accelerator, the Bottom-Up Product Categorization component automatically assigns products to the most appropriate category in large, hierarchical category trees. It employs a two-step process: first identifying key concepts (metaclasses) from product titles, then using a large language model to make nuanced categorization decisions. This approach significantly reduces manual effort, improves catalog consistency, and enhances the overall shopping experience. The system's adaptability to different languages and category structures makes it versatile for global e-commerce businesses.

Extract Attributes

Building upon the categorization process, the Attribute Extraction component automatically extracts relevant attributes from product information based on category-specific schemas. By using the Anthropic Claude Sonnet 5.5 model from Amazon Bedrock by default, it can extract multiple attributes in a single API call, significantly improving efficiency. This process enhances the richness and consistency of product data, ultimately improving searchability and the customer experience.

Each component of the Smart Product Onboarding accelerator is designed to work independently or as part of an integrated solution, providing retailers with the flexibility to adopt and customize the elements that best suit their needs. The linked documentation for each component provides detailed explanations of how they work, including insights into the AI models used, prompt engineering processes, and scalability considerations.

Cost

You are responsible for the cost of the AWS services used while running this accelerator. As of this revision, the cost for running this construct with the default settings in the US East (N. Virginia) Region is approximately $1,292.42 per month with 100,000 products onboarded per month. We assume that on average each product will have five 1 megapixel images. Amazon Bedrock prices use global cross-region inference on-demand pricing as of November 2026.

The costs shown represent pricing without consideration of AWS free tier benefits.

We recommend creating a budget through AWS Cost Explorer to help manage costs. Prices are subject to change. For full details, refer to the pricing webpage for each AWS service used in this solution.

The Step Functions execution logs and the API Gateway access logs are kept for 30 days. To keep them longer or shorter, change the retention value in packages/infra/src/constructs/workflow/workflow.ts and packages/infra/src/constructs/apis/smartproductonboardingapi.ts, then redeploy.

The following table provides a sample cost breakdown for deploying this solution with the default parameters in the US East (N. Virginia) Region for one month.

AWS Service Usage Cost [USD]
Amazon Bedrock Generate Product Data from Images - Average 6,000 input tokens and 200 output tokens. Anthropic Claude Haiku 5.5 70.00
Amazon Bedrock Metaclass - Average 350 input tokens and 10 output tokens). Amazon Nova Micro 1.37
Amazon Bedrock Categorize Products - Average 20,200 input tokens and 525 output tokens). Anthropic Claude Haiku 5.5 228.25
Amazon Bedrock Extract Attributes - Average 2,650 input tokens and 350 output tokens). Anthropic Claude Sonnet 5.5 880.00
AWS Lambda Generate Product Data from Images 3.35
AWS Lambda Metaclass 3.32
AWS Lambda Categorize Products 8.02
AWS Lambda Extract Attributes 33.35
AWS Lambda API handlers and workflow orchestration functions 1.00
AWS Step Functions Batch Onboarding 25.90
Amazon Simple Storage Service Input, output, and configuration storage 15.62
Amazon DynamoDB Metaclass word vector store 1.56
Amazon DynamoDB Process status 2.51
AWS API Gateway API 1.02
Amazon CloudWatch Service metrics and logs 9.55
AWS X-Ray API Gateway, Lambda, and Step Functions tracing 5.00
Amazon Cognito Demo users - 100 Monthly Active Users on Plus feature plan 2.00
AWS Web Application Firewall Protect API Gateway 0.60
AWS Systems Manager Parameter Store 0.00
AWS AppConfig Runtime AI model configuration 0.00
Total monthly infrastructure cost 1,292.42

Deployment and Development

Prerequisites

  • Configure the AWS Credentials in your environment. Refer to Authentication and access.
  • Download and install AWS CLI. Refer to Installing the AWS CLI.
  • Install and configure AWS CDK. Refer to Installing the AWS CDK.
  • Download and install Docker. Refer to Docker.
    • The Lambda functions run on ARM64 (Graviton), so CDK builds their assets in linux/arm64 containers. Docker Desktop on macOS and Windows runs these under emulation out of the box. On an x86_64 Linux host without emulation, cdk synth fails with exec format error. Register QEMU for arm64 once per boot with docker run --privileged --rm tonistiigi/binfmt --install arm64, then check it with docker run --rm --platform linux/arm64 alpine uname -m (prints aarch64). Refer to Multi-platform builds: QEMU and tonistiigi/binfmt.
  • NodeJS 22.19 or later, or 24 (24 recommended, matching the pull request build)
  • Python >= 3.12 (3.14 recommended, matching the Lambda runtime) preferably with pyenv
  • uv >= 0.5.0
  • Pnpm >= 8.6.3
curl -LsSf https://astral.sh/uv/install.sh | sh
npm install -g pnpm@^8.15.9 aws-cdk

Amazon Bedrock Marketplace Model Subscriptions

This accelerator uses the following models by default, all through cross-region inference profiles:

  • Anthropic Claude Haiku 5.5 (global.anthropic.claude-haiku-5-5): product data generation and categorization
  • Anthropic Claude Sonnet 5.5 (global.anthropic.claude-sonnet-5-5): attribute extraction
  • Amazon Nova Micro (us.amazon.nova-micro-v1:0): metaclass classification

You can optionally enable and use any other models.

Prior to deploying the accelerator, you must subscribe to the models listed above. The simplest way to subscribe is to chat with the models you want to use in the Bedrock Chat Playground in the AWS Console. For more details, see Simplified model access in Amazon Bedrock.

Build and Deploy

First Time Setup

  1. Install dependencies:

    pnpm install
    
  2. Bootstrap CDK (first time only):

    If you haven't used CDK in your AWS account and region before, you need to bootstrap it:

    # Replace with your account ID and desired region
    cdk bootstrap aws://123456789012/us-east-1
    

    Note: You only need to bootstrap once per AWS account/region combination. If you've already used CDK in your target account and region, you can skip this step.

  3. Deploy the infrastructure:

    pnpm exec nx run @aws-samples/smart-product-onboarding-infra:deploy        # Deploy to AWS (~15-20 min)
    

The deploy command will automatically build all necessary packages and then deploy the infrastructure.

Subsequent Deployments

After the first deployment, you only need:

pnpm exec nx run @aws-samples/smart-product-onboarding-infra:deploy

Deploy with Cross-Account access to Bedrock

If you need to use Bedrock in Cross-Account setting (e.g. because the service quota from another account is higher) you can optionally define a context variable containing the ARN of an IAM Role in this other account.

cd packages/infra && cdk deploy smart-product-onboarding --context BEDROCK_XACCT_ROLE=<ARN_OF_ROLE>

Remember to configure the trust relationship in the other account to allow our roles to assume them by adding our account as a principal in the trust policy.

Also note that if you choose to use Bedrock Cross-Account consumption metrics will show up in the other account.

Update Code

After making changes, redeploy with:

pnpm exec nx run @aws-samples/smart-product-onboarding-infra:deploy

This will automatically build all dependencies and deploy the updated infrastructure.

Cleanup

In the event that you decide to stop using the accelerator, we recommend that you follow a tear down procedure. Most of the services used have no cost when there is no active use with the notable exception of storage in S3, DynamoDB, and CloudWatch Logs. AWS CloudFormation via CDK will tear down all resources except for Amazon S3 buckets and AWS CloudWatch Logs log groups with data.

  1. On the AWS CloudFormation console or using AWS CDK in the terminal, destroy the stacks that were deployed. Some of the S3 buckets will remain as they will not be empty.
  2. Delete any CloudWatch Logs log groups that you do not wish to keep.
  3. Delete the word embeddings table from DynamoDB that you created in the notebooks.
  4. In any S3 buckets that remain that you do not wish to keep, empty the buckets by disabling logging and configuring a lifecycle policy that expires objects after one day. Wait a day.
  5. After a day, go back and delete the buckets.

Configuration

After deployment, the accelerator needs to be configured for your category tree and attribute schema using the notebooks. To facilitate demos, there is an automated configuration script you could use instead. The deployment doesn't create the /ProductCategorization/CategorizationConfig parameter; the script or notebook 2 does. Until then, categorization requests fail and the functions log ParameterNotFound for that parameter.

Runtime AI Model Configuration

The accelerator uses AWS AppConfig for runtime configuration of AI model settings. This allows you to change model IDs, temperatures, and product generation options without redeploying infrastructure.

After deployment, you can deploy a configuration document to AppConfig via the AWS Console or CLI. The configuration is a JSON document with the following structure:

{
  "productGeneration": {
    "modelId": "global.anthropic.claude-haiku-5-5",
    "temperature": 0.1,
    "language": "English",
    "descriptionLength": "medium",
    "examples": []
  },
  "metaclassClassification": {
    "modelId": "us.amazon.nova-micro-v1:0",
    "temperature": 0
  },
  "productCategorization": {
    "modelId": "global.anthropic.claude-haiku-5-5",
    "temperature": 0
  },
  "attributeExtraction": {
    "modelId": "global.anthropic.claude-sonnet-5-5",
    "temperature": 0
  }
}

The productGeneration section supports additional optional fields:

  • language — output language for generated titles and descriptions
  • descriptionLength — "short", "medium", or "long"
  • examples — up to 10 example products (each with title and description) for few-shot style guidance

All components fall back to their default model IDs and temperatures if no AppConfig configuration is deployed. Newer Anthropic Claude models (4.7 and later, including Haiku 5.5 and Sonnet 5.5) do not accept a temperature, so the configured temperature is ignored for them.

Troubleshooting

Common Build Issues

Nx cache issues:

# Clear Nx cache if builds are failing unexpectedly
pnpm exec nx reset

TypeScript compilation errors:

# Clean and rebuild TypeScript packages
pnpm exec nx run-many --target=clean --all
pnpm build

CDK deployment issues:

pnpm exec nx run @aws-samples/smart-product-onboarding-infra:synth    # Test synthesis
pnpm exec nx run @aws-samples/smart-product-onboarding-infra:deploy   # Deploy with automatic builds

Python virtual environment issues:

# Reset uv virtual environment
cd packages/smart-product-onboarding
rm -rf .venv
uv sync

Docker build failures:

# Re-authenticate with ECR if Docker builds fail
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws

Performance Tips

  • Use pnpm exec nx run-many --target=build --parallel=3 to limit parallel builds if experiencing memory issues
  • Run pnpm exec nx show projects to see all available projects and their dependencies
  • Use pnpm exec nx graph to visualize the project dependency graph
  • Use pnpm exec nx run @aws-samples/smart-product-onboarding-infra:deploy:dev for faster development deployments with hotswap

Demo

This accelerator includes a web app in packages/website/ with three pages to showcase the Smart Product Onboarding functionality. It has a dark and a light theme, and works on phones.

1. New product

Onboard one product in four steps:

  1. Images & details: add product images (drop them, choose files, or take photos with the camera) and optional metadata. Under the advanced settings you can set the language, description length, model and temperature, and add example listings to guide the tone and style.
  2. Generate: review and edit the generated title and description, or regenerate them.
  3. Category & attributes: the app finds candidate categories, chooses one, and extracts the category's attributes.
  4. Review: check the images, listing, category and attributes together, regenerate any part, and copy or download the listing as JSON.

Products you have generated are kept as Recent drafts in the navigation rail, in this browser only, so you can come back to them.

2. Batches

Onboard many products at once from a CSV file:

  1. Open Batches and choose New batch.
  2. Add your product catalog CSV. It needs a header row with either title and description columns, or an images column. short_description and metadata are optional. The app checks the columns before uploading, and you can download a sample CSV.
  3. If the CSV has an images column, add a ZIP file with those images.
  4. Start the batch. The list refreshes while batches run, and shows any error message for failed batches.
  5. When a batch completes, download the results CSV with the generated content, categories and attributes.

3. Quick generate

Generate a title and description from images and metadata without categorizing the product or saving a draft.

Notes

  • Both demos use the same underlying Smart Product Onboarding accelerator components.
  • The batch process is more suitable for large-scale product onboarding, while the individual process allows for more fine-grained control and immediate review of results.
  • You can use these demos to experiment with different inputs and settings to see how they affect the AI-generated content and categorizations.

Remember to review and potentially edit the AI-generated content before using it in a production environment.

Security Guideline

Please see the security guidelines.

Content Security Legal Disclaimer

Sample code, software libraries, command line tools, proofs of concept, templates, or other related technology are provided as AWS Content or Third-Party Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content or Third-Party Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content or Third-Party Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content or Third-Party Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.

관련 프로젝트 살펴보기

불러오는 중…