Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.4.4. Amazon Bedrock Knowledge Bases and Retrieval Pipelines

💡 First Principle: RAG quality is decided at two moments: ingestion (how documents are parsed, chunked and embedded) and query time (how many chunks you fetch, whether you filter or rerank them, and how you phrase the search). Settings chosen at ingestion are expensive to change, so they deserve the most thought.

Vector store choice. A customer-managed knowledge base writes embeddings into a store you choose:

Vector storeWhy pick itNotable limits
Amazon OpenSearch ServerlessQuick-create default; hybrid search; binary vectorsIndex must use the faiss engine for metadata filtering
Amazon OpenSearch Service managed clustersExisting domain, binary vectorsDomain must allow public access (VPC-only domains are not supported)
Amazon S3 VectorsLowest cost for infrequent queries at scaleFloat vectors only; 1 KB custom metadata and 35 keys per vector; hierarchical chunking not recommended
Amazon Aurora PostgreSQL (pgvector)Relational team, hybrid searchCluster must be in the same account; GIN index needed on the text column
Neptune AnalyticsGraphRAG over entity relationshipsVector index dimension set at graph creation
Pinecone, Redis Enterprise Cloud, MongoDB AtlasExisting third-party investmentCredentials held in AWS Secrets Manager

AWS also offers a Bedrock Managed Knowledge Base, where Bedrock provisions and scales the data store, embeddings and reranking for you; choose a customer-managed knowledge base when you need a specific vector database or direct access to it.

Ingestion settings you cannot change later. The chunking strategy is fixed once the data source is created, and the embeddings model and storage configuration are fixed once the knowledge base is created. Changing either means creating a new data source or knowledge base and re-ingesting.

Chunking strategyBehaviourChoose when
DefaultAbout 300 tokens, respects sentence boundariesGetting started
Fixed-sizeYour max tokens and overlap percentageUniform documents, tunable recall
HierarchicalChild chunks are matched, parent chunks are returnedPrecise matching but the model needs surrounding context
SemanticSplits on meaning using buffer size and breakpoint percentile (uses an FM, extra cost)Documents whose topics shift mid-section
NoneEach file is one chunkYou pre-split files yourself

Query-time configuration (Retrieve and RetrieveAndGenerate):

  • numberOfResults defaults to 5 chunks. With hierarchical chunking it counts child chunks, so you may receive fewer results once children collapse into parents.
  • overrideSearchType: HYBRID combines vector and keyword search; SEMANTIC uses vectors only. Hybrid works only on Amazon RDS, OpenSearch Serverless and MongoDB stores with a filterable text field; elsewhere the query falls back to semantic.
  • Metadata filtering (equals, in, greaterThan, andAll/orAll and more) narrows results before generation; implicit filtering lets a model derive the filter from the question.
  • Reranking rescores retrieved chunks with a reranker model (Amazon Rerank 1.0 or Cohere Rerank 3.5) so the most relevant chunks reach the prompt.
  • Query decomposition splits a multi-part question into sub-queries before retrieval.
  • Structured data stores (for example Amazon Redshift) let a knowledge base turn natural language into SQL instead of searching vectors.

⚠️ Exam Trap: When answers cite the right document family but the wrong product version, the fix is metadata filtering, not a bigger numberOfResults. When the right chunk is retrieved but ranked sixth and never reaches the prompt, the fix is reranking. When exact part numbers or error codes are missed, the fix is hybrid search.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications