Bedrock Knowledge Bases: vectors, indexing, retrieval
Lesson 2 of 4 in Deploying FMs, RAG, and Agents.
Bedrock Knowledge Bases is managed RAG plumbing: point it at a data source, and it parses, chunks, embeds, and indexes your documents into a vector store, then answers Retrieve (give me relevant chunks) and RetrieveAndGenerate (also have an FM answer from them). Data preparation covers why chunking and embeddings work; this lesson is the deployment half — what you configure, and what each configuration choice costs to change later.
The ingestion pipeline a sync job runs
- Data source
Amazon S3 is the workhorse; connectors exist for the web crawler, Confluence, SharePoint, and Salesforce.
- Parse & chunk
Documents are split per your chunking strategy — fixed-size, hierarchical, semantic, none, or a custom Lambda.
- Embed
An embeddings model (e.g., Titan Text Embeddings) turns each chunk into a vector. Changing this model later means re-embedding everything.
- Vector index
Vectors + chunk text + metadata land in the vector store you chose at creation.
- Retrieve / RetrieveAndGenerate
Query-time: embed the question, search the index (top-k, filters, optional hybrid), optionally generate.
Chunking strategies — set at the data source
Fixed-size (tokens per chunk + overlap) is the default workhorse; hierarchical keeps parent–child chunks so retrieval can return the small match with its larger context; semantic splits on meaning boundaries; none indexes each document whole (for pre-chunked files); a custom Lambda does anything else. Changing strategy means re-ingesting the source.
Metadata and filtering
Sidecar metadata files attach fields (department, year, product) to documents; queries can then filter before vector search — the cheap fix when "retrieval mixes up product A and product B docs".
Keeping it current — sync jobs
Ingestion is not continuous: a sync (StartIngestionJob) re-processes new/changed/deleted source documents. Fresh documents that never show up in answers usually mean nobody re-synced — the ops side of this lives in the retraining module.
Semantic vs hybrid search
Semantic (vector) search is the default. Hybrid adds keyword matching where the vector store supports it — the tell is exact-string content: part numbers, error codes, names an embedding may blur.
| Store | Flavor | The tell |
|---|---|---|
OpenSearch Serverless | AWS, serverless | The quick-create default; low-latency k-NN plus hybrid search support |
OpenSearch managed cluster | AWS, provisioned | Same engine, your cluster — existing OpenSearch estates |
Aurora PostgreSQL + pgvector | AWS, relational | Vectors living next to relational data and SQL |
Amazon S3 Vectors | AWS, object storage | Cost-first vector storage at large scale with sub-second query |
Pinecone / Redis / MongoDB Atlas | Third-party | The team already runs one of them |
Neptune Analytics | AWS, graph | GraphRAG — retrieval that follows relationships, not just similarity |
Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.