Bedrock knowledge bases: MLA-C02 study notes and practice questions
What to know about Bedrock knowledge bases for the MLA-C02 exam, from the Deployment and Orchestration of ML and AI Workflows domain (24% of the exam guide), then 2 free questions to test it. Part of the MLA-C02 study guide.
Knowledge base questions ask how to set up, update or troubleshoot managed RAG in Bedrock.
Building one
Choose data sources: S3, web crawler, Confluence, SharePoint, Salesforce, or custom (push documents directly).
Choose parsing and chunking strategies.
Choose an embedding model.
Choose a vector store: OpenSearch Serverless (quick create), Aurora PostgreSQL with pgvector, S3 Vectors, Neptune Analytics (GraphRAG), OpenSearch managed clusters, or third-party stores such as Pinecone, Redis Enterprise Cloud and MongoDB Atlas.
Give it an IAM service role that can read the sources, call the embedding model and write to the store (and use KMS keys if encrypted).
An existing Aurora PostgreSQL cluster can be the store, using pgvector, the RDS Data API and credentials in Secrets Manager.
Keeping it current
A sync (ingestion job) processes only new, changed and deleted documents.
Start syncs on a schedule or from events (such as EventBridge on S3 changes, calling StartIngestionJob).
Direct ingestion adds or deletes documents through the API without a full sync.
Querying
API
Returns
Retrieve
Relevant chunks and scores; you build the prompt
RetrieveAndGenerate
A generated answer with citations, and session context for follow-ups
Options include number of results, hybrid search, metadata filters, reranking, query decomposition, a custom prompt template and an attached guardrail.
Structured data
Knowledge bases can connect to Redshift (and data in the Glue Data Catalog) and turn natural-language questions into SQL.
Common traps
Recreating the knowledge base when documents change. Run a sync.
A new OpenSearch collection when an existing Aurora cluster can hold the vectors.
Retrieve when the app wants a finished answer with citations.
A regional bank has an Amazon Bedrock knowledge base over its branch-policy documents, stored in an S3 data source. Staff updated several policy PDFs this morning, but the assistant still answers with last week's rules.
The bank wants the updated documents to be used for answers as soon as possible, without rebuilding the knowledge base or changing the documents' location.
What should the team do?
Choose one answer.
AA. Delete the knowledge base, create a new one with the same data source, and wait for the new index to finish building.
BB. Change the chunk size of the knowledge base, because applying a new chunking setting makes the service re-read and re-embed every document in the bucket.
CC. Start an ingestion job for the knowledge base data source, so that the changed S3 documents are re-processed and their vectors are updated.
DD. Copy the updated PDFs to a new S3 bucket, since the knowledge base reads from the newest bucket automatically.
Show the answer and explanation
Answer: C
A. Wrong: Recreating the knowledge base is slower and unnecessary for updated files. The stem asks for the updates to be picked up without rebuilding.
B. Wrong: Chunking settings control how documents are split when they are ingested, and changing them is not the way to pick up edited files. The documents are refreshed only when the data source is synced.
D. Wrong: The knowledge base reads only from its configured data source, so a new bucket is not read until it is configured. The stem asks to keep the location.
Explanation
Updated S3 documents reach a knowledge base through a sync, or ingestion job, which processes only the changed files and updates their vectors. Recreating the knowledge base, changing chunk settings or copying files to another bucket does not refresh the indexed content.
A logistics broker keeps its carrier contract PDFs in Amazon S3 and runs an Amazon Aurora PostgreSQL cluster for its contract management system. The data team wants a Bedrock knowledge base over the contracts, and it does not want to create and pay for a separate vector database.
The knowledge base must store its embeddings in the existing cluster, and the database credentials must be kept in AWS Secrets Manager rather than in code or configuration files.
Which vector store configuration should the team choose?
Choose one answer.
AA. Create an Amazon OpenSearch Serverless collection for the embeddings, and move the contract management tables out of Aurora into it.
BB. Export the contract texts to CSV files in Amazon S3, and let the knowledge base answer questions over them through Amazon Athena queries.
CC. Put the database user name and password in the knowledge base prompt template, so that the knowledge base can connect to Aurora without a stored secret.
DD. Use the existing Aurora PostgreSQL cluster as the vector store with pgvector and the RDS Data API, and keep its credentials in Secrets Manager.
Show the answer and explanation
Answer: D
A. Wrong: OpenSearch Serverless is a supported vector store, but it is the separate vector database the broker wants to avoid, and moving the contract tables breaks the existing system. The stem asks to reuse the Aurora cluster.
B. Wrong: Athena is a query service and does not serve as a knowledge base vector store for semantic retrieval. The option does not use the vector store the stem needs.
C. Wrong: Placing credentials in a prompt template exposes them and breaks the stated Secrets Manager requirement. A prompt template does not provide database access.
Bedrock knowledge bases can use an existing Aurora PostgreSQL cluster as the vector store, with the pgvector extension, the RDS Data API and a database user managed in Secrets Manager. A new OpenSearch collection adds the separate database the broker wants to avoid, Athena does not provide semantic retrieval, and credentials in a prompt template are unsafe.
Want more on Bedrock knowledge bases? The 5 full-length practice sets have 8 more Bedrock knowledge bases questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →