Free courses from frontend to fullstack and AI
AI Engineer - Learn how to integrate AI into software applications
Overview
Google, IBM & Meta Certificates – 40% Off
One plan covers every Professional Certificate on Coursera.
Unlock All Certificates
Learn to implement advanced RAG chunking techniques that preserve document structure and context using LangChain and Ollama in this 14-minute tutorial. Discover why simple character-based splitting destroys RAG performance by severing tables, breaking sentences, and creating contextless "orphan chunks." Move beyond RecursiveCharacterTextSplitter by implementing a sophisticated two-pass strategy that combines Markdown Header Splitting with LLM-based Contextual Enrichment. Build a chunking pipeline that respects document structure while using a local LLM to inject global context into every chunk. Explore the chunk dataclass and metadata structure, examine the resulting enriched chunks, and understand the trade-offs including token inflation considerations. Master these advanced techniques to significantly improve your RAG system's performance while maintaining complete local control over your data processing pipeline.
Syllabus
- The problem with naive chunking
- Chunking pipeline overview
- Chunk dataclass & metadata structure
- Chunking and enrichment with Ollama
- Looking at the resulting chunks
- Token inflation & trade-offs
Taught by
Venelin Valkov