Applications of Foundation Models
RAG Architecture
RAG grounds a foundation model response in retrieved source content. It ingests, chunks, embeds, and stores documents, then retrieves relevant chunks for the model at runtime.
Concepts
- RAG sends retrieved source context to a model so it can generate a grounded response.
- RAG is usually preferred when knowledge changes frequently or must stay external to model weights.
- Retrieval quality depends on chunking, metadata, embedding model choice, ranking, and source document quality.
- At ingestion time, RAG chunks documents into passages, creates embeddings such as Amazon Titan Embeddings, and stores the vectors in a vector database.
- At query time, RAG embeds the user question, runs similarity search such as cosine similarity, retrieves the top matching chunks, injects them into the model prompt, and generates a grounded response.
- Amazon OpenSearch Serverless is the default vector store for Amazon Bedrock Knowledge Bases, with other supported stores including Aurora PostgreSQL with pgvector, Pinecone, and Redis Enterprise Cloud.
- Amazon OpenSearch Service is a managed provisioned search and analytics engine for log analytics, full-text search, monitoring, and vector search; Amazon OpenSearch Serverless auto-scales with pay-per-use capacity and native Bedrock Knowledge Bases integration.
Exam tips
- RAG is preferred when private knowledge changes or should not be baked into model weights.
- Chunking, metadata, embedding model choice, and ranking affect retrieval quality.
- Bedrock Knowledge Bases provide managed RAG over supported data sources and vector stores.
- For query-time RAG, embed the user question before similarity search, then pass retrieved chunks into the FM prompt.
- OpenSearch Serverless is the default Bedrock Knowledge Bases vector store; do not confuse it with provisioned Amazon OpenSearch Service clusters.
- Choose Amazon OpenSearch Service when you need managed cluster capacity control; choose OpenSearch Serverless for auto-scaling, no capacity planning, and Bedrock Knowledge Bases RAG integration.