Building Managed RAG with Amazon Bedrock Knowledge Bases
This lesson explains Amazon Bedrock Knowledge Bases, the managed RAG service that handles ingestion, chunking, embedding, vector storage, retrieval and generation, so teams configure rather than build the pipeline.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the components of a knowledge base.
- Configure parsing and chunking for each data source.
- Choose between the Retrieve and RetrieveAndGenerate APIs.
Components
A knowledge base has an embedding model (such as Titan Text Embeddings V2 or Cohere Embed), a vector store and one or more data sources. Supported vector stores include Amazon OpenSearch Serverless, OpenSearch Service managed clusters, Amazon S3 Vectors, Amazon Aurora PostgreSQL (pgvector), Amazon Neptune Analytics (GraphRAG) and third-party stores such as Pinecone, Redis Enterprise Cloud and MongoDB Atlas. Quick create provisions an OpenSearch Serverless or S3 Vectors store automatically. Data sources include Amazon S3, a web crawler, Confluence, SharePoint, Salesforce and custom sources that push documents through the API. A knowledge base can also connect to structured stores for text-to-SQL retrieval.
How a knowledge base ingests
Ingestion configuration
Each data source sets a parsing strategy (default, Bedrock Data Automation or FM parsing), a chunking strategy (fixed-size, hierarchical, semantic, none or custom Lambda) and an optional custom transformation Lambda function. An ingestion job (sync) reads the source, processes new, changed and deleted documents incrementally, embeds chunks and writes them to the vector store. Metadata files supply filterable attributes. The knowledge base service role needs access to the source bucket, the embedding model, the vector store and any KMS keys.
Knowledge base settings
Retrieval APIs
The Retrieve API returns relevant chunks with scores and source locations, for applications that build their own prompts. RetrieveAndGenerate retrieves and then generates an answer with citations using a chosen model, and supports sessions for follow-up questions, a custom prompt template, guardrails and retrieval settings such as number of results, search type, metadata filters and reranking. Knowledge bases can also be attached to Bedrock Agents. The following table summarises the configuration points.
| Setting | Where | Can change after creation |
|---|---|---|
| Embedding model | Knowledge base | No (create a new knowledge base) |
| Vector store | Knowledge base | No |
| Chunking and parsing | Data source | No (create a new data source) |
| Number of results, search type, filters, reranking | Each query | Yes, per request |
| Generation model, prompt template, guardrail | RetrieveAndGenerate request | Yes, per request |
The following diagram shows the configuration and query path of an HR policy knowledge base built entirely through configuration.

Which API?
An HR policy assistant
An HR team wants employees to ask questions about 2,000 policy PDFs in S3, with answers citing the source, within two weeks and without ML engineers.
- Create a knowledge base with Titan Text Embeddings V2 and quick create of an S3 Vectors store, because query volume is modest and cost matters.
- Add the S3 data source with default parsing and fixed-size chunking of 500 tokens with 15% overlap; add country metadata files.
- Run the ingestion job, then call RetrieveAndGenerate with a metadata filter on the employee's country and a guardrail.
Everything is configuration; no vector database or embedding pipeline is built. If testing later shows that a different chunking strategy is needed, a new data source is created and synced.
What is the difference between Retrieve and RetrieveAndGenerate?
Show answer
Retrieve returns matching chunks. RetrieveAndGenerate also generates an answer with citations.
Exam Tips
Remember for the exam
- Managed RAG with least effort: Bedrock Knowledge Bases.
- Retrieve returns chunks; RetrieveAndGenerate also generates a cited answer.
- Embedding model and vector store cannot be changed after creation.
- Ingestion (sync) jobs process new, changed and deleted documents incrementally.
- Quick create provisions OpenSearch Serverless or S3 Vectors automatically.