AI-Powered Marketing Compliance Monitoring at Scale

performline · Legal · 2025 · source Agentic: no · promotional bias: high · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Marketing compliance monitoring at web scale

PerformLine needed to parse complex, multi-product web pages into structured compliance inputs at very high volume without disrupting existing downstream rules engines, while balancing extraction accuracy, throughput, retryability, and inference cost.

Constraints:

Architecture

PerformLine built a serverless event-driven pipeline around Amazon Bedrock. Upstream ETL processes collect web pages and metadata. Retrieved pages trigger compliance-check events; S3 stores page data by metadata; EventBridge routes S3 events to SQS; Lambda consumes SQS messages, scales dynamically, and invokes Bedrock for extraction and generative analysis. Customer-defined product schemas stored in DynamoDB drive schema-targeted output generation. Extracted data is written back to S3 as structured JSON, and EventBridge forwards result events to SQS for downstream rules and compliance checks. Cost controls include change-data-capture partitions with metadata hashes, model routing across Nova Pro, Claude Haiku, Nova Micro, and Nova Lite, and multi-pass inference that filters products cheaply before deeper analysis. Bedrock Prompt Management and inference profiles provide prompt versioning, production deployment, dynamic model selection, and cost attribution.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  upstream-etl["upstream-etl"] --> s3-page-assets["s3-page-assets"]
  s3-page-assets --> eventbridge-events["eventbridge-events"]
  eventbridge-events --> incoming-sqs["incoming-sqs"]
  incoming-sqs --> lambda-extractor["lambda-extractor"]
  incoming-sqs --> dead-letter-queue["dead-letter-queue"]
  lambda-extractor --> bedrock-inference["bedrock-inference"]
  bedrock-inference --> prompt-management["prompt-management"]
  bedrock-inference --> inference-profiles["inference-profiles"]
  bedrock-inference --> multi-pass-model-router["multi-pass-model-router"]
  lambda-extractor --> dynamodb-schemas["dynamodb-schemas"]
  lambda-extractor --> structured-json-s3["structured-json-s3"]
  structured-json-s3 --> eventbridge-events
  eventbridge-events --> results-sqs["results-sqs"]
  results-sqs --> compliance-rules-engine["compliance-rules-engine"]
  s3-page-assets --> cdc-hash-partitions["cdc-hash-partitions"]
  structured-json-s3 --> cdc-hash-partitions
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
upstream-etl Batch process that collects millions of web pages and metadata from PerformLine core systems. s3-page-assets
s3-page-assets Stores retrieved page data according to metadata and triggers processing events. upstream-etl, eventbridge-events, cdc-hash-partitions
eventbridge-events Routes S3 events into work queues and result queues. s3-page-assets, incoming-sqs, results-sqs, structured-json-s3
incoming-sqs Incoming queue for retryable extraction work. eventbridge-events, lambda-extractor, dead-letter-queue
dead-letter-queue Failure queue for messages that cannot be processed successfully. incoming-sqs
lambda-extractor Serverless processing function that consumes SQS messages and invokes Bedrock for extraction and analysis. incoming-sqs, bedrock-inference, dynamodb-schemas, structured-json-s3
bedrock-inference Foundation-model access layer for extraction, product identification, and deeper analysis. lambda-extractor, prompt-management, inference-profiles, multi-pass-model-router
prompt-management Centralized prompt versioning, testing, and production deployment. bedrock-inference
inference-profiles Model invocation configuration and cost attribution layer. bedrock-inference, multi-pass-model-router
multi-pass-model-router Routes initial filtering to lighter models and deeper extraction to stronger models in smaller batches. bedrock-inference
dynamodb-schemas Stores customer-defined product schemas for dynamic LLM targeting and structured output. lambda-extractor
structured-json-s3 Stores extracted structured JSON that conforms to target schemas. lambda-extractor, eventbridge-events, cdc-hash-partitions
results-sqs Queue that makes extracted data available to downstream processing. eventbridge-events, compliance-rules-engine
compliance-rules-engine Existing PerformLine systems that validate extracted products and assets against compliance rules. results-sqs
cdc-hash-partitions Metadata-hash partitions used to avoid reprocessing unchanged pages. s3-page-assets, structured-json-s3

Data flow

PerformLine's upstream ETL collects pages and metadata. When a page is retrieved, S3 stores the asset and emits events. EventBridge routes those events to SQS, which provides retryable work queues. Lambda consumes messages, retrieves schemas from DynamoDB, invokes Bedrock using managed prompts and inference profiles, and performs extraction and analysis. The output is structured JSON in S3 matching the target schema. EventBridge then routes result events to SQS so existing PerformLine rules engines can validate compliance. CDC metadata hashes prevent unchanged pages from being processed again.

5 supporting quotes
“Millions of pages are processed by an upstream extract, transform, and load (ETL) process from PerformLine’s core systems”article, stated
“When a page is retrieved, it triggers an event in the compliance check system.”article, stated
“EventBridge uses event-driven processing to route Amazon S3 events to Amazon SQS.”article, stated
“A Lambda Function consumes SQS messages and also scales dynamically to handle even unpredictable workloads”article, stated
“Amazon S3 stores the extracted data, which is formatted as structured JSON adhering to the target schema.”article, stated

Why this architecture

PerformLine needed to add AI extraction without breaking existing rules engines, so the design uses event-driven queues and structured JSON handoff rather than a monolithic replacement. S3, EventBridge, SQS, and Lambda provide elastic processing and retries for unpredictable page volumes. DynamoDB schemas keep outputs aligned to customer product structures. Bedrock Prompt Management and inference profiles let developers iterate on prompts and models without redeploying code. Multi-pass inference and CDC address the cost side of processing millions of pages: cheap models filter first, deeper models analyze smaller batches, and unchanged pages are skipped.

“It was imperative that they not disrupt those processes or introduce cascading changes for this solution.”article, implied
3 supporting quotes
“enabling dynamic large language model (LLM) targeting and schema-driven output generation.”article, stated
“dynamically adjust the models the Lambda function invokes, track cost per invocation, and attribute costs to specific application instances”article, implied
“By first identifying the target content and then processing it in smaller batches, PerformLine significantly improved accuracy while minimizing token consumption.”article, implied

Models used: Amazon Nova Pro · Anthropic Claude Haiku · Amazon Nova Micro · Amazon Nova Lite · Amazon Bedrock Converse API · foundation models

Scale

Alternatives considered (roads not taken)

Static parsing of complex product pages

Rejected because: Overlapping page content can apply to one product, several products, or all products, requiring context-aware interpretation.

“overlapping content that can apply to one product, several products, or even all of them at once”article, stated
“traditional static parsing, requiring a context-aware and adaptive solution.”article, stated

Process every page every time

Rejected because: CDC metadata hashes let upstream systems skip pages that were already processed and have not changed.

“determine whether a page has already been processed and if its content has changed.”article, stated
“Avoiding reprocessing unchanged pages, dynamically reducing PerformLine’s analysts’ workload by over 50% in addition to deduplication gains.”article, stated

Run all content through the strongest model

Rejected because: At millions of pages per day, inference cost would escalate; PerformLine filters cheaply first and then applies deeper analysis to smaller batches.

“LLM inference costs can escalate at scale, but context and carefully structured prompts are critical for accuracy. To optimize costs while maintaining precision, PerformLine implemented a multi-pass approach using Amazon Bedrock:”article, stated
“Initial filtering with Amazon Nova Micro – This lightweight model efficiently identifies relevant products with minimal cost.”article, stated

Manually track prompts and versions

Rejected because: Manual tracking became inefficient as the team iterated and collaborated, so Bedrock Prompt Management centralized versioning and deployment.

“Manually tracking multiple prompt versions and templates became inefficient as PerformLine iterated and collaborated.”article, stated
“Prompt Management service provided a centralized solution, enabling them to version, manage, and seamlessly deploy prompts to production.”article, stated

Change downstream compliance systems

Rejected because: PerformLine preserved existing rules engines by formatting extracted data as structured JSON and sending it through existing downstream processing.

“Downstream assets are submitted to PerformLine’s rules engine and compliance review processes.”article, stated
“Compliance checks and business rules, running on other PerformLine’s systems, are applied”article, stated

Patterns

async-message-orchestration (architecture)

S3 events, EventBridge, SQS queues, Lambda workers, result queues, and DLQs decouple high-volume extraction from downstream compliance checks.

“EventBridge uses event-driven processing to route Amazon S3 events to Amazon SQS.”article, stated
“The system implements multiple queue types (Incoming, DLQ, Results) and includes error handling mechanisms.”article, stated

batch-offline-processing (operations)

Millions of pages are processed by upstream ETL in batch before extracted assets flow to compliance rules.

“PerformLine’s upstream ingestion pipeline efficiently collects millions of web pages and their associated metadata in a batch process.”article, stated

cost-aware-routing (operations)

The system routes filtering to lightweight models and deeper analysis to stronger models, while inference profiles track per-invocation cost.

“Initial filtering with Amazon Nova Micro – This lightweight model efficiently identifies relevant products with minimal cost.”article, stated
“track cost per invocation, and attribute costs to specific application instances”article, stated

model-routing (inference)

PerformLine uses different Bedrock models for complex requests, fast calls, initial filtering, and targeted extraction.

“Amazon’s Nova Pro was best suited for complex requests that require a powerful model”article, stated
“Anthropic’s Claude Haiku model allows for optimized quick calls, where a fast response is paramount”article, stated

prompt-versioning (prompting)

Bedrock Prompt Management centralizes prompt versioning, testing, and deployment so Lambda can reference prompts dynamically.

"* Prompt management in Bedrock – Supports versioning, testing, and deployment of prompts for improved AI consistency and control

“After the prompts are deployed, they can be dynamically referenced in AWS Lambda”article, stated

structured-output-contract (contracts)

Customer-defined schemas in DynamoDB drive structured JSON extraction that downstream rules engines can consume.

“2. The function stores customer-defined product schemas in Amazon DynamoDB, enabling dynamic large language model (LLM) targeting and schema-driven output generation.”article, stated
“formatted as structured JSON adhering to the target schema.”article, stated

semantic-caching (cost)

The current system uses CDC hashes to skip unchanged pages, and the roadmap calls out Bedrock prompt caching for reused context.

“includes a metadata hash of the asset. This enables upstream processes to determine whether a page has already been processed and if its content has changed.”article, stated
“Prompt caching on Amazon Bedrock offers up to 85% latency improvements and 90% cost reduction”article, stated

Tradeoffs

Use serverless event-driven processing

Chose S3 events, EventBridge, SQS, Lambda, DynamoDB, and Bedrock over a tightly coupled synchronous processing pipeline.

Rationale: The serverless queue-based architecture handles variable workloads, retries failures, and isolates AI extraction from existing downstream systems.

"** Enables precise tracking and optimization of inference costs

“Amazon SQS queues messages for processing and enables messages to be retried on failure.”article, stated

Use multi-pass inference

Chose initial filtering with Nova Micro and deeper extraction with Nova Lite over single-pass analysis over all page content.

Rationale: Filtering first lowers token use and cost while preserving accuracy for product-specific extraction.

“Initial filtering with Amazon Nova Micro – This lightweight model efficiently identifies relevant products with minimal cost.”article, stated
“Identified products are batched into smaller groups and passed to Amazon Nova Lite for deeper analysis.”article, stated

Use CDC hashes

Chose metadata hash partitions for analyzed content over re-analyzing every retrieved page.

Rationale: Skipping unchanged pages reduces redundant processing and analyst workload at high volume.

“written back to a partition that includes a metadata hash of the asset.”article, stated
“Avoiding reprocessing unchanged pages”article, stated

Adopt managed prompt and model configuration

Chose Bedrock Prompt Management, inference profiles, and Converse API over hard-coded prompt/model configuration in Lambda.

Rationale: The managed configuration lets developers test prompts and models, track costs, and deploy changes without rebuilding application code.

“dynamically referenced in AWS Lambda, allowing for flexible configuration.”article, stated
“rapidly test new models and prompts, evaluate results, and iterate without needing to rebuild or redeploy.”article, stated

Gotchas (what bit them)

Context-aware product extraction is required for overlapping product pages.

Root cause: One page can contain content that applies to one product, several products, or every product on the page.

Resolution: PerformLine first identifies relevant products, then processes target content in smaller context-aware batches.

“overlapping content that can apply to one product, several products, or even all of them at once”article, stated
“By first identifying the target content and then processing it in smaller batches”article, stated

LLM cost can dominate at daily web scale.

Root cause: Millions of pages and hundreds of thousands of extracted products would be expensive if every item used a strong model.

Resolution: Use CDC to skip unchanged pages and multi-pass inference with lighter models before deeper extraction.

“LLM inference costs can escalate at scale”article, stated
“Initial filtering with Amazon Nova Micro”article, stated

Manual prompt tracking does not scale with collaboration.

Root cause: Multiple prompt versions and templates became hard to manage as PerformLine iterated.

Resolution: Adopt Bedrock Prompt Management for centralized versioning, management, and production deployment.

“Manually tracking multiple prompt versions and templates became inefficient as PerformLine iterated and collaborated.”article, stated
“Prompt Management service provided a centralized solution”article, stated

AI extraction had to integrate without cascading changes.

Root cause: Existing downstream rules engines and compliance review systems already consumed assets in established workflows.

Resolution: The AI stage emits structured JSON and routes it through event queues into existing downstream processing.

“It was imperative that they not disrupt those processes or introduce cascading changes for this solution.”article, stated
“Compliance checks and business rules, running on other PerformLine’s systems, are applied”article, stated

The less-than-a-day implementation claim likely excludes the full enterprise delivery effort.

Root cause: The post is co-authored with AWS and emphasizes service benefits; the claim appears to refer to the serverless architecture skeleton, not complete requirements, validation, and rollout.

Resolution: Treat the architecture as credible but keep the timeline claim caveated.

“requiring less than a day to develop and deploy.”article, stated
“this is a co-authored post with AWS, which may emphasize positive outcomes and AWS service benefits.”summary, stated

Evaluation

The article emphasizes prompt optimization, evaluation, cost management, and operational workload reduction. It does not describe a formal labeled benchmark, but reports reductions from CDC/deduplication and explains that Prompt Management plus inference profiles let developers rapidly test models and prompts, evaluate results, and iterate.

Metrics: human evaluation workload reduction · analyst workload reduction · pages processed per day · products extracted per day · rule observations per day · cost per invocation · token consumption · latency and cost impact of prompt caching

5 supporting quotes
“focus on prompt optimization, evaluation, and cost management rather than infrastructure overhead.”article, stated
“15% workload reduction in human evaluation tasks.”article, stated
“* Avoiding reprocessing unchanged pages, dynamically reducing PerformLine’s analysts’ workload by over 50% in addition to deduplication gains.”article, implied
“track cost per invocation, and attribute costs to specific application instances”article, implied
“rapidly test new models and prompts, evaluate results, and iterate”article, stated

Outcomes

The source reports 1.1 billion observations over 10+ years, millions of pages in upstream batch ETL, projected 1.5-2 million pages daily, 400,000-500,000 products extracted daily, about 500,000 daily rule observations, 15% human evaluation workload reduction, more than 50% analyst workload reduction, and prompt caching claims of up to 85% latency and 90% cost improvement.

6 supporting quotes
“implemented a highly scalable, serverless, AI-driven architecture”article, stated
“projected to process between 1.5 to 2 million pages daily”article, stated
“extract approximately 400,000 to 500,000 products.”article, stated
“about 500,000 rule observations that will require review each day.”article, stated
“15% workload reduction in human evaluation tasks.”article, stated
“* Avoiding reprocessing unchanged pages, dynamically reducing PerformLine’s analysts’ workload by over 50% in addition to deduplication gains.”article, stated