Student view — safe to present
Teaching Deck · Notebook 03

Ingestion & Chunking
(LlamaIndex Edition)

Same problem as Notebook 02, same six strategies, same golden question we tested with yesterday. Different framework underneath. That's the whole session today: watch what changes when only the ergonomics change.
~30–35 min session Twin of Notebook 02 2 built-in one-liners Framework decision table
Yesterday
LangChain, hand-built window metadata, manual parent/child retriever code
→
Today
LlamaIndex, SentenceWindowNodeParser and AutoMergingRetriever, both one call
01 / 11
Where this fits

Same theory, less typing

Every idea from Notebook 02 (the parsing ceiling, all six chunking strategies) shows up here again, unchanged. What's different is how much code each one takes to write.
For the trainer

Set expectations up front, something like: "if you already sat through Notebook 02, this one moves fast, you already know what each cell is trying to prove. Today's real question is LangChain or LlamaIndex, and when." Say it in your own words. It stops people expecting brand new theory that isn't coming.

02 / 11
Where LlamaIndex shines #1

One line loads a whole folder, mixed formats

LangChain (Notebook 02)
PyPDFLoader(...)
BSHTMLLoader(...)
Docx2txtLoader(...)
# one loader class per format
LlamaIndex
SimpleDirectoryReader(
  input_dir=DATA,
  required_exts=[".pdf",".html",".docx"],
).load_data()
# one call, tags each node with its source file
LangChain
3 loaders
LlamaIndex
1 call
For the trainer

Just run it live and let "loaded 3 document(s) from the folder" speak for itself, don't over-narrate it. Worth a quick mention of LlamaHub too, there are hundreds of connectors beyond local files (Notion, Slack, Google Drive). That's honestly LlamaIndex's biggest ingestion strength, give it ten seconds.

03 / 11
Quick recap, not a new lesson

Parsing quality is framework-independent

Same naive-vs-layout-aware PDF result as yesterday, reproduces identically here. Comes down to the parser (pymupdf4llm), not the orchestration library sitting on top of it.
For the trainer

Don't re-run the whole reveal, just say it: "same table, same disaster if you grab the naive reader. Not re-teaching this, just confirming, it's a parser problem, not a LangChain problem or a LlamaIndex problem." Two minutes tops on this one, then move.

04 / 11
The full comparison

Six strategies, side by side

#StrategyLlamaIndexLangChain (Notebook 02)
1Fixed / tokenTokenTextSplitterTokenTextSplitter
2Sentence / recursiveSentenceSplitterRecursiveCharacterTextSplitter
3SemanticSemanticSplitterNodeParserSemanticChunker (experimental)
4Sentence-windowSentenceWindowNodeParser ✓ one-linermanual metadata window
5Small-to-bigHierarchicalNodeParser + AutoMergingRetriever ✓ built-inParentDocumentRetriever
6Doc-type-awareMarkdownNodeParser, HTMLNodeParserMarkdownHeaderTextSplitter, etc.
For the trainer

Rows 4 and 5 are the ones worth slowing down for, point at them directly. Rows 1, 2, 3, and 6 are just "same idea, new class name," blow through those fast, nobody needs three minutes on TokenTextSplitter twice in one week.

05 / 11
Where LlamaIndex shines #2

Sentence-window: a one-liner here, hand-built yesterday

Matched (original_text): "...home-internet stipend..."
→
Window (metadata): full surrounding context, auto-swapped in by MetadataReplacementPostProcessor
Manual (Notebook 02)
~15 lines
SentenceWindowNodeParser
~3 lines
For the trainer

Put yesterday's manual Document plus metadata-window code right next to today's SentenceWindowNodeParser.from_defaults(window_size=2, ...), same screen, same time. That line count is the whole lesson. Don't talk over it.

06 / 11
Where LlamaIndex shines #3, the best live moment of the session

Watch nodes merge, in real time

HierarchicalNodeParser builds parent/child nodes at multiple sizes. AutoMergingRetriever matches small leaves, and once enough leaves from the same parent get hit, it merges them up automatically.
> Merging 5 nodes into parent node.
> Parent node id: b0006982-...
> Parent node text: Master Services Agreement...
For the trainer

Run this cell with verbose=True live, let that log line print right there on the projector. Don't paraphrase it on a slide beforehand, it lands better cold. Watching the merge happen in the actual terminal beats any diagram I could draw.

07 / 11
The decision that matters

Which framework, and when?

Reach for LangChain

Chains, agents, tool-calling, output parsing. Basically the flexible orchestration and generation side of things, Notebook 01's territory.

Reach for LlamaIndex

Multi-format loading, sentence-window, small-to-big. Data ingestion and the harder chunking and retrieval work.

For the trainer

Give them the honest answer: a lot of production stacks just use both. LlamaIndex for ingestion and retrieval, LangChain or LangGraph for orchestration on top of it. Nobody's picking one forever here.

08 / 11
Suggested session flow

A ~30-minute run of tomorrow's session

TimeSegment
0–3 minFrame it as Notebook 02's twin, set expectations for a faster pace
3–8 minSimpleDirectoryReader one-liner, then a quick parsing recap
8–14 minStrategies 1, 2, 3, 6 briskly, "same idea, new class name"
14–24 minStrategies 4 & 5 slowly: sentence-window one-liner, then the live auto-merge demo
24–30 minFramework decision table + hand off to Notebook 04 (embeddings)
09 / 11
Anticipate these questions

FAQ, what usually comes up here

"Do I need to learn both frameworks?"
Not to a deep level in both, no. Know LlamaIndex's ingestion strengths and LangChain's orchestration strengths well enough to grab the right tool for the job. That's basically what real teams do anyway.
"Which one should I use in my capstone project?"
Whichever one you can extend fastest under time pressure. Both cover what we taught in Notebooks 02 and 03 just fine. Staying consistent in your own codebase matters a lot more than picking the "better" one.
"Is AutoMergingRetriever always better than a fixed sentence-window?"
No. It's more setup, multiple chunk sizes, a docstore, a storage context, and the payoff really shows on long structured documents. For short FAQ-style content, plain sentence-window is usually enough on its own.
10 / 11
Next

Chunks exist. Now turn them into vectors.

Notebook 04 picks up right here: embeddings, the geometry of meaning that makes semantic search possible in the first place.

11 / 11