Learn/Generative AI, RAG & Agents/MODULE 2: RETRIEVAL AUGMENTED GENERATION (RAG)
Lesson 21 of 37 · 2 min read

2.10 Advanced RAG Patterns

A few patterns worth knowing about that push past basic RAG.

Multi-Hop Retrieval

Some questions require chaining multiple retrievals.

For example: "Which of our competitors had higher revenue growth than us in the most recent quarter we have data for?"

To answer:

  1. First, retrieve our most recent revenue data.
  2. Note the quarter.
  3. Then retrieve our competitors' data for that quarter.
  4. Then synthesize.

Multi-hop RAG systems can plan this kind of chain, executing multiple retrievals as needed.

Agentic RAG

When you combine RAG with agents (which we'll cover in Module 3), the agent can decide whether to retrieve, what to retrieve, and how many times.

This is much more powerful than a single fixed retrieval step.

Graph RAG

Some recent systems use a knowledge graph (a structured representation of entities and their relationships) in addition to or instead of pure vector retrieval.

This helps for questions that require relational reasoning — e.g., "Which employees report to managers in the marketing department who joined the company before 2020?"

Self-Querying Retrievers

These translate a natural-language question into a structured query that combines semantic search with metadata filters automatically.

For example, "Show me Q3 reports from last year" might be translated into "semantic search for 'report' + filter: quarter=Q3, year=."

Reciprocal Rank Fusion (RRF)

A clean way to merge results from multiple retrievers (e.g., semantic + keyword + metadata) into a single ranked list.

Just an algorithm; useful to know it exists if you build advanced systems.


💡 Module 2 Recap

  • LLMs alone have knowledge cutoffs, can't access private data, and hallucinate. RAG addresses all of these by augmenting prompts with retrieved information.
  • RAG = retrieve relevant documents + generate an answer based on them.
  • Embeddings turn text into vectors that capture meaning, enabling semantic search.
  • Vector databases store and quickly retrieve similar embeddings at scale.
  • A complete RAG system has an indexing pipeline (run once or periodically) and a query pipeline (run on every user question).
  • Chunking strategy and chunk size meaningfully affect retrieval quality.
  • Advanced retrieval techniques (hybrid search, re-ranking, query rewriting, metadata filtering) often beat basic semantic search.
  • RAG is everywhere in real applications: support bots, internal knowledge tools, research assistants, and more.
  • Pitfalls include stale data, poor chunking, over- and under-retrieval, and "lost in the middle" effects.

Keep going with a free account

A free account saves your progress across lessons and lets you pick up where you left off.