AWS ML ★ 85 4 min

Automated web insight extraction with Amazon Bedrock AgentCore

Advanced (300)Amazon BedrockAmazon Bedrock AgentCoreTechnical How-to

🔗 https://aws.amazon.com/blogs/machine-learning/automated-web-insight-extraction-with-amazon-bedrock-agentcore/

📌 【AWS 技術分享】告別手動爬蟲:利用 Amazon Bedrock AgentCore 實現自動化網頁洞察提取

TL;DR:透過 Amazon Bedrock AgentCore Browser 渲染動態網頁,結合 AI 實現自動化趨勢監測與語義搜尋。

🤔 傳統爬蟲難以應對的挑戰

當設計團隊需要追蹤競爭對手產品,或行銷團隊需要監控內容趨勢時,手動檢查數十個網站不僅效率低下,更令人崩潰。雖然傳統的基於規則(rule-based)的爬蟲可以實現自動化,但它們過於依賴頁面結構;一旦網站重新設計或改用 JavaScript 渲染的前端架構,爬蟲管線(pipeline)往往會無預警失效,導致團隊在發現問題前就已經丟失了關鍵資訊。

🧩 利用 AgentCore Browser 解決動態渲染問題

為了應對現代網頁複雜的 JavaScript 渲染需求,本方案採用了 Amazon Bedrock AgentCore 的核心能力——AgentCore Browser。

  • 全託管瀏覽器服務:不同於在 Lambda 中執行無頭瀏覽器(headless browser),AgentCore 提供全託管的遠端瀏覽器服務。
  • Playwright + CDP 整合:透過 Playwright 並經由 Chrome DevTools Protocol (CDP) 連接,可以穩定渲染包含大量 JavaScript 的頁面,確保 AI 接收到的是完整的網頁內容,而非破碎的 HTML。
  • 高韌性管線:由於瀏覽器能處理動態元素加載,這讓後續的 AI 資訊提取步驟變得更加可靠。

📊 事件驅動的自動化架構流程

此解決方案採用事件驅動架構(event-driven architecture),將「內容收集」與「AI 處理」解耦,使兩者能獨立擴展:

  1. RSS 同步與去重:由 Amazon EventBridge 定期觸發 AWS Lambda,解析 RSS Feed 並將 URL Hash 存於 Amazon S3 進行去重。
  2. 瀏覽器內容擷取:Lambda 透過 WebSocket 連接 AgentCore Browser,渲染頁面、截圖並下載圖片,最後將結構化資料(含 metadata.json)存回 Amazon S3。
  3. 內容清洗與預處理:當 S3 觸發事件後,第二個 Lambda 會從 S3 讀取 HTML。針對大型檔案(>1 MB)使用 html-to-text 簡化,小型檔案則使用 Mozilla 的 Readability 函式庫提取主體內容,以減少 Token 消耗並提升 AI 輸出一致性。
  4. AI 洞察提取:利用 Amazon Bedrock 生成摘要、識別主題與實體、提取可執行的洞察,並產生向量嵌入(vector embeddings)。
  5. 語義檢索與索引:將結果索引至 Amazon OpenSearch Serverless,支援關鍵字與向量搜尋。這意味著即便查詢語句與原文不完全匹配(例如搜尋「新興設計趨勢」),系統仍能找出相關內容。

⚠️ 安全性與生產環境建議

由於系統會攝取來自第三方網站的外部內容,作者建議將抓取的文本視為「不可信輸入」,並利用 Amazon Bedrock Guardrails 作為控制點,在不更動 Prompt 的情況下,對 AI 產出的洞察進行安全性控管。

🎯 實務啟示:從單一工具到整合生態系

這套架構展示了如何將多種 AWS 服務整合為一個完整的產品級解決方案:

  • 開發者介面:透過 Amazon ECS (Fargate) 部署 React 前端,並利用 Amazon Cognito 進行身份驗證。
  • 程式化存取:透過部署在 ECS 上的 Model Context Protocol (MCP) 伺服器,讓其他的 AI 助手或工具能透過統一介面直接查詢此洞察資料庫。

🔗 來源

#AWS #AmazonBedrock #AgentCore #MachineLearning #WebScraping #GenerativeAI #OpenSearch #Serverless #LLM #DataEngineering

原始資料 AWS ML · 收集於 2026-08-05
來源原標題
Automated web insight extraction with Amazon Bedrock AgentCore
作者
Louisa Liu
原始標籤
Advanced (300) · Amazon Bedrock · Amazon Bedrock AgentCore · Technical How-to
原始連結
https://aws.amazon.com/blogs/machine-learning/automated-web-insight-extraction-with-amazon-bedrock-agentcore/

摘要原文

Extracting insights from dozens of websites often means manually checking each one, a process that quickly becomes overwhelming. Design teams need to track competitor products, marketing teams want to monitor content trends, and product managers need to stay on top of market intelligence. But doing this manually means someone has to visit sites, copy content, and organize information before real analysis can begin. Rule-based scrapers offer some automation, but they are tightly coupled to page structure. A site redesign or a migration to a JavaScript-rendered frontend can silently break the pipeline for days before the team notices. Amazon Bedrock AgentCore is a platform to build, connect, and optimize agents at scale, with any framework or model. The solution in this post uses the AgentCore Browser, a capability of Amazon Bedrock AgentCore. This fully managed browser service renders JavaScript-heavy pages reliably, so your pipeline is more resilient when websites change. This post demonstrates how to deploy an automated insight extraction solution using Amazon Bedrock AgentCore Browser, Amazon Bedrock for AI-powered analysis, Amazon OpenSearch Serverless for semantic search, and AWS Lambda for orchestration. You build a system that monitors RSS feeds, retrieves web content using the AgentCore managed browser, extracts insights with AI, and makes everything searchable through a web interface. This solution was built for design and product teams who need to track industry trends, but the architecture applies to broader scenarios: At the end of this post, you will understand how the event-driven architecture separates content collection from AI processing, how the browser automation in Amazon Bedrock AgentCore handles JavaScript-heavy pages, and how vector embeddings in Amazon OpenSearch Serverless power semantic search across your collected insights. The complete implementation is available in this GitHub repository . If you are new to the services used in this solution, the following resources provide foundational context: The architecture follows an event-driven pattern that separates content collection from processing. The following diagram illustrates the end-to-end system, organized into three functional layers. Figure 1 — Architecture diagram for the automated web insight extraction system RSS feed collection: An Amazon EventBridge schedule triggers an AWS Lambda function every 15 minutes to check configured RSS feeds for new articles and deduplicate against Amazon Simple Storage Service (Amazon S3). Browser-based content retrieval: For each new article, the Lambda function opens a browser session through Amazon Bedrock AgentCore and connects to it using Playwright over the Chrome DevTools Protocol (CDP). Unlike standard HTTP requests, the remote browser renders the full page including JavaScript-heavy content, waits for dynamic elements to load, takes a screenshot, and downloads images. This is the step that makes the rest of the pipeline possible: without reliable page rendering, the AI extraction downstream would receive incomplete or broken content. The artifacts are uploaded to Amazon S3 in a structured format. Event-driven processing: Amazon S3 upload events publish messages to an Amazon Simple Queue Service (Amazon SQS) queue, and a second Lambda function extracts clean text from the raw HTML. AI-powered insight extraction: Amazon Bedrock generates summaries, identifies themes and entities, extracts actionable insights, and creates vector embeddings from the cleaned content. Indexing and semantic search: The enriched results are indexed into Amazon OpenSearch Serverless, which supports both keyword and vector search. User and API access: End users authenticate through Amazon Cognito and access a React-based frontend on Amazon Elastic Container Service (Amazon ECS) with AWS Fargate . For programmatic access, a Model Context Protocol (MCP) server on Amazon ECS with Fargate exposes the system through Amazon CloudFront . MCP is an open standard that lets AI assistants and tools connect to external data sources through a unified interface. The following sections describe the main components of the solution. The RSS sync Lambda function does more than fetch feeds. It parses each RSS feed, filters for articles published within a configurable time window (24 hours by default), and deduplicates using a URL hash as a unique ID in Amazon S3. For new articles, the function opens a remote browser session through Amazon Bedrock AgentCore and connects via Playwright over CDP. This isn’t a headless browser running in Lambda. It is a managed browser service: AgentCore hosts the remote browser, and Playwright controls it through a WebSocket connection. The browser renders the full page, waits for JavaScript to load, and captures the complete rendered output. The function then extracts images from the page, downloads them, and uploads everything to Amazon S3 in a structured format: The metadata.json file includes the original URL, title, timestamp, and references to downloaded assets. When the metadata file is uploaded to Amazon S3, it triggers the processing pipeline automatically. This separation means content collection and AI processing scale independently. If you’re monitoring dozens of RSS feeds, the collection Lambda function handles them concurrently while the Amazon SQS queue with a dead-letter queue provides automatic retries for processing failures. The idea extraction Lambda function preprocesses HTML to reduce token consumption, a step that significantly improves the consistency of AI-generated output. When it receives a message from Amazon SQS, it pulls the HTML from Amazon S3 and runs it through a preprocessing step. Large HTML files (over 1 MB) get simplified using html-to-text to avoid token limits. Smaller files use Mozilla’s Readability library, which does a better job of extracting the main content and identifying the primary image. The cleaned content then goes to Amazon Bedrock with a customizable prompt. You can use models supported by Amazon Bedrock. For model availability by AWS Region, refer to Supported models by AWS Region in Amazon Bedrock . The prompt asks the AI to extract: The Lambda function also generates vector embeddings for semantic search, so you can find related content even when the exact words don’t match. The function writes everything to Amazon OpenSearch Serverless: the original content, AI-extracted metadata, and the embedding vector. The index is configured for both keyword and vector search. A query like “what are emerging design trends” returns relevant results even if those exact words don’t appear in the source content. Because this pipeline sends third-party web content to a foundation model and publishes the AI-generated output to your team, production deployments should include safeguards around the extraction step. Amazon Bedrock Guardrails lets you apply these controls without changing the extraction prompt: Because the pipeline ingests content from external websites, treat the scraped text as untrusted input: guardrails act as a control point between raw web content and the insights your organization consumes. The React-based frontend with Amazon Cognito authentication provides a search interface where teams can browse and explore insights. The MCP server provides an API layer for integration with other AI tools, supporting programmatic search and retrieval through Amazon CloudFront. MCP is an open standard that defines how AI assistants discover and call external tools, so other AI agents in your organization can query the insight database directly. Processing components run within an Amazon Virtual Private Cloud (Amazon VPC), with Amazon CloudWatch providing observability and AWS Identity and Access Management (IAM) enforcing least privilege access. Building a real-world insight extraction pipeline involves more than wiring together managed services.

tencent/hy3:free 自動生成