Advanced RAG Chunking: Contextual & Structural Chunking with LangChain & Ollama (100% Local)

Venelin Valkov · Beginner ·🧠 Large Language Models ·2mo ago
Complete tutorial and source code (requires MLExpert Pro): https://www.mlexpert.io/academy/v2/context-engineering/effective-chunking-strategies Simple chunking kills RAG performance. If you split a document every 500 characters, you sever tables, break sentences, and create "orphan chunks" that have no context. In this video, we'll build an advanced chunking pipeline that respects document structure and uses a local LLM to inject global context into every single chunk. We will move beyond RecursiveCharacterTextSplitter and implement a two-pass strategy: Markdown Header Splitting followed by …
Watch on YouTube ↗ (saves to browser)

Chapters (6)

The problem with naive chunking
0:38 Chunking pipeline overview
3:08 Chunk dataclass & metadata structure
5:09 Chunking and enrichment with Ollama
8:51 Looking at the resulting chunks
11:39 Token inflation & trade-offs
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Next Up
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)