Selecting a RAG Architecture Pattern
This lesson explains how Retrieval Augmented Generation (RAG) gives a foundation model relevant information at query time, the patterns that exist, and how to select one for a use case.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the basic RAG pattern.
- Identify advanced patterns such as hybrid search, reranking and agentic RAG.
- Select a pattern from use-case signals.
Basic RAG
In the basic pattern, documents are chunked, embedded and stored in a vector index during ingestion. At query time, the question is embedded, the most similar chunks are retrieved, and the model generates an answer from a prompt containing the question and the chunks, usually with citations. RAG gives current, private and citable knowledge without retraining and reduces hallucination, because the model is instructed to answer from the provided context.
The following diagram shows the ingestion and query paths of basic RAG.

Advanced patterns
Hybrid search combines vector similarity with keyword (BM25) matching, which helps with product codes, names and rare terms. Reranking retrieves a larger candidate set and reorders it with a cross-encoder model for precision. Query reformulation rewrites vague questions or decomposes multi-part questions into sub-queries. Hierarchical (parent-child) retrieval matches small chunks and returns their larger parents. Metadata-filtered retrieval restricts results by attributes such as department or date.
GraphRAG builds a graph of entities and relationships (Bedrock Knowledge Bases with Amazon Neptune Analytics) so retrieval can follow connections for multi-hop questions. Structured data retrieval converts natural-language questions into SQL against a data warehouse such as Amazon Redshift, for questions answered by tables rather than documents. Agentic RAG lets an agent decide whether, where and how many times to retrieve, combining several knowledge sources and tools.
Advanced RAG patterns
Selecting a pattern
The following table maps use-case signals to the pattern that fits.
| Use-case signal | Pattern |
|---|---|
| General questions over a document set | Basic RAG (managed knowledge base) |
| Exact codes, part numbers or names in questions | Hybrid search |
| Correct document retrieved but ranked low | Reranking |
| Questions with several parts | Query decomposition |
| Answers need surrounding section context | Hierarchical chunking and retrieval |
| Questions about relationships across entities | GraphRAG (Neptune Analytics) |
| Questions about numbers in tables of a warehouse | Structured data retrieval (text to SQL) |
| Multi-source, multi-step information needs | Agentic RAG |
The following diagram matches three assistants, each answering a different kind of question, to a retrieval pattern for each.

Choose the pattern
Three assistants
A manufacturer plans three assistants.
| Assistant | Pattern | Reason |
|---|---|---|
| Field technicians ask about error code E-4471 | Hybrid search with metadata filter by product | Exact code matching plus product scope |
| Analysts ask "which suppliers of parts used in model X had quality incidents?" | GraphRAG | Multi-hop relationships between parts, suppliers and incidents |
| Managers ask "what were Q3 returns by region?" | Structured data retrieval on Redshift | Answer lives in tables, not documents |
Using basic vector RAG for all three would fail the second and third: embedding similarity cannot follow relationships or compute aggregates.
Which pattern suits multi-hop questions about relationships?
Show answer
GraphRAG with Amazon Neptune Analytics.
Exam Tips
Remember for the exam
- RAG adds current, private knowledge with citations without retraining.
- Exact identifiers: hybrid search.
- Multi-hop relationship questions: GraphRAG with Neptune Analytics.
- Answers in warehouse tables: structured data retrieval (text to SQL).
- Agent decides when and where to retrieve: agentic RAG.