AWS详解用Crawl4AI准备网页知识库数据
AWS Machine Learning Blog介绍了一套工作流:使用Crawl4AI抓取获授权的公开网页,将页面转换为Markdown及元数据附属文件,再通过Amazon S3导入Amazon Bedrock Knowledge Bases。定时Fargate任务可完成预处理,随后由Bedrock处理解析、分块、嵌入、索引、检索及带引用的回答;多数公共网站也可直接使用Amazon Bedrock Web Crawler。该方案属于批量摄取,并非推理时实时访问网页。
这套流程让RAG开发者能够控制网页内容的索引范围及附带元数据,但AWS指出启发式裁剪仍需人工检查代表性输出后再扩大规模。
When you build Retrieval Augmented Generation (RAG) applications, answer quality depends on the data that you ingest. Amazon Bedrock Knowledge Bases is the fully managed RAG capability of Amazon Bedrock. With Amazon Bedrock Managed Knowledge Base, you connect your data sources, and Amazon Bedrock manages ingestion, storage, indexing, and retrieval for you. You don’t provision or scale a vector store, and embedding and reranking use service-managed models by default.
For web content, start with the Amazon Bedrock Web Crawler data source connector for managed knowledge bases. You give it the seed URLs or sitemaps that you’re authorized to crawl, and it crawls within the scope and rate limits that you set. Scheduled syncs keep your knowledge base current as pages change, and the connector can wait for content that loads with JavaScript. There’s no crawler for you to build, host, or operate, so this connector is the starting point for most public website content.
Some sources need more control over what reaches the knowledge base. You might want to index only the main content region of each page, remove navigation and other boilerplate, or attach your own metadata attributes to every document. For that class of source material, you can extend the reach of your knowledge base with a preparation step built with Crawl4AI, an open source Python crawler. The step writes Markdown and a metadata sidecar for each page to Amazon Simple Storage Service (Amazon S3), and the knowledge base ingests both through its Amazon S3 data source.
#Amazon Bedrock Knowledge Bases#Amazon Bedrock Web Crawler#Crawl4AI#Amazon Simple Storage Service#AWS Fargate#AWS Machine Learning Blog