サービス · Machine Learning · AIF-C01 の発展
Amazon Bedrock Knowledge Bases
Data sources, parsing, chunking, embeddings, sync, metadata and security for a knowledge base.
このレッスンはまだ翻訳されていないため、英語で表示しています。
AI Practitionerで学んだこと
- A knowledge base reads documents, chunks them, embeds each chunk and writes vectors to a vector store.
- You choose the embeddings model, the chunking and the vector store, and you sync after the data changes.
- 1A sync reads new, changed and deleted files from the data source.
- 2Each file is parsed and split into chunks.
- 3The embeddings model turns chunks into vectors, saved in the vector store.
Data source
- Options
- S3, web, Confluence, SharePoint, Salesforce, custom
- Note
- Connectors crawl on sync
Parsing
- Options
- Default, Data Automation, foundation model
- Note
- Advanced parsers handle tables
Chunking
- Options
- Default, fixed, hierarchical, semantic, none
- Note
- Fixed when the source is created
Metadata
- Options
- file.ext.metadata.json
- Note
- faiss engine for filters
Service role and KMS
- Options
- Least-privilege role, customer key
- Note
- Role needs the key too
| Setting | Options | Note |
|---|---|---|
| Data source | S3, web, Confluence, SharePoint, Salesforce, custom | Connectors crawl on sync |
| Parsing | Default, Data Automation, foundation model | Advanced parsers handle tables |
| Chunking | Default, fixed, hierarchical, semantic, none | Fixed when the source is created |
| Metadata | file.ext.metadata.json | faiss engine for filters |
| Service role and KMS | Least-privilege role, customer key | Role needs the key too |
1 / 2
Data source
- Options
- S3, web, Confluence, SharePoint, Salesforce, custom
- Note
- Connectors crawl on sync
Parsing
- Options
- Default, Data Automation, foundation model
- Note
- Advanced parsers handle tables
| Setting | Options | Note |
|---|---|---|
| Data source | S3, web, Confluence, SharePoint, Salesforce, custom | Connectors crawl on sync |
| Parsing | Default, Data Automation, foundation model | Advanced parsers handle tables |
2 / 2
Chunking
- Options
- Default, fixed, hierarchical, semantic, none
- Note
- Fixed when the source is created
Metadata
- Options
- file.ext.metadata.json
- Note
- faiss engine for filters
Service role and KMS
- Options
- Least-privilege role, customer key
- Note
- Role needs the key too
| Setting | Options | Note |
|---|---|---|
| Chunking | Default, fixed, hierarchical, semantic, none | Fixed when the source is created |
| Metadata | file.ext.metadata.json | faiss engine for filters |
| Service role and KMS | Least-privilege role, customer key | Role needs the key too |
概要
A data source can be Amazon S3, a web crawler, or a connector for Confluence, SharePoint or Salesforce. A custom data source lets your code push documents in directly. Parsing turns files into text. The default parser reads text. Bedrock Data Automation or a foundation model parser can extract tables and images from complex files. Chunking choices are default (about 300 tokens), fixed-size (max tokens and overlap), hierarchical (small child chunks matched, larger parents returned), semantic (splits by meaning and costs extra model calls) or none. The chunking strategy cannot be changed after the data source is created.
概要
Pick the embeddings model and the vector store when you create the knowledge base. A sync is an ingestion job (StartIngestionJob). It is incremental: only new, changed and deleted files are processed. Unchanged files are skipped, and a metadata-only change can avoid new embeddings. Check the job statistics for failed documents. Metadata for S3 files goes in a file named like the document with .metadata.json added. Filters on it need an OpenSearch Serverless index that uses the faiss engine, not nmslib.
概要
Bedrock uses a service role to read the data source, call the embeddings model and write to the vector store. Keep it least-privilege and limited to the bucket and index. Use a customer managed AWS KMS key for the data used during ingestion and for the vector store, and give the role permission on that key.
覚えること
- Sources: S3, web crawler, Confluence, SharePoint, Salesforce, or a custom source.
- Parsing: default, Bedrock Data Automation or a foundation model parser.
- Chunking: default 300 tokens, fixed-size, hierarchical, semantic or none. It cannot be changed later.
- Sync is incremental. Check the ingestion job for failed documents.
覚えること
- Metadata: file.ext.metadata.json. OpenSearch Serverless needs the faiss engine for filters.
- The service role needs S3, embeddings model, vector store and KMS permissions.
試験では
- “Documents with complex tables are mis-parsed” points to an advanced parser, such as Bedrock Data Automation or a foundation model parser.
- “Retrieve small chunks but give the model larger context” points to hierarchical chunking.
- “Filter by metadata does not work on OpenSearch Serverless” points to an index built with nmslib instead of faiss.
- “Add only changed files to the index” points to an incremental sync.
このタスクの内容 · 3.2
- Provisioned vs on-demand resources
- IaC for ML: CloudFormation, CDK and Service Catalog
- Containers for ML: images, ECR and own containers
- ECS, EKS and Batch for ML workloads
- SageMaker endpoints in a VPC
- Auto scaling endpoints and choosing metrics
- Scaling GPU and LLM workloads
Knowledge Bases
- Retrieval pipelines
- Agent state and memory management
- Agentic workflow infrastructure