Ch 9 — Advanced RAG Patterns — Under the Hood

GraphRAG internals, agent loops, multi-modal pipelines, Text-to-SQL, and memory
Under the Hood
-
Click play or press Space to begin...
Step- / 10
AMicrosoft GraphRAG InternalsEntity extraction, community detection, and global search
1
description
Documents
Source text
extract
1
hub
Entity Graph
Nodes + edges
cluster
1
workspaces
Communities
Leiden algorithm
summarize
1
summarize
Summaries
Per community
2
searchLocal vs Global Search: local = entity-focused retrieval, global = community summary map-reduce
BAgentic RAG with LangGraphReAct loops, tool selection, and state management
3
psychology
Reason
Think about query
select
3
build
Act (Tool)
Execute tool call
observe
3
visibility
Observe
Process results
loop
3
check_circle
Answer
Or loop again
4
account_treeLangGraph State Machine: nodes = functions, edges = conditional routing, state = message history
CMulti-Modal RAG PipelineIndexing and retrieving images, tables, and diagrams
5
image
Extract Images
From PDFs/docs
describe
5
smart_toy
Vision LLM
Generate summaries
index
5
database
Vector Store
Text + image refs
6
table_chartTable Extraction: Camelot, pdfplumber for structured tables; vision LLM for complex layouts
DText-to-SQL InternalsSchema prompting, query generation, and safety
7
schema
Schema Prompt
Tables + columns
generate
7
code
SQL Query
LLM-generated
execute
7
table_view
Results
Query output
8
shieldSQL Safety: read-only connections, query validation, row limits, no DDL/DML
EConversational Memory ManagementStoring, summarizing, and windowing chat history
9
history
Full History
All messages
window
9
filter_list
Window / Summary
Trim to budget
inject
9
smart_toy
LLM Context
History + retrieval
FContextual Retrieval & Late ChunkingAnthropic's contextual embeddings and Jina's late chunking
10
add_notes
Contextual Embed
Prepend doc context
or
10
view_timeline
Late Chunking
Embed then chunk
result
10
trending_up
Better Retrieval
+49% recall (Anthropic)
1
Title