ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Service · Machine Learning · Builds on AIF-C01

Amazon Bedrock Knowledge Bases

Data sources, parsing, chunking, embeddings, sync, metadata and security for a knowledge base.

You know from 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.
Read the AI Practitioner lesson
Data source
Parse and chunk
Embeddings model
Vector store
  1. 1A sync reads new, changed and deleted files from the data source.
  2. 2Each file is parsed and split into chunks.
  3. 3The embeddings model turns chunks into vectors, saved in the vector store.
What a sync does with each document.
  • 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
Five settings to configure on a knowledge base.

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

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
Five settings to configure on a knowledge base.

What it is

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.

What it is

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.

What it is

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.

Remember

  • 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.

Remember

  • 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.

On the exam

  • “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.