Chunking: The Hidden Backbone of RAG | Basics of Chunking Part 1
📚 Chunking: The Hidden Backbone of RAG — Blog Series
Chunking: The Hidden Backbone of RAG | Basics of Chunking Part 1

📚 Chunking: The Hidden Backbone of RAG — Blog Series
Part 1: Basics of Chunking (you are here)
Part 2: Chunking Strategies https://medium.com/p/24fa03356109/edit
In the above image, we see vegetables being diced for a salad. Diced, sliced, or julienned vegetables not only enhance the taste and presentation of the salad but also make it easier to consume. Similarly, chunking breaks large pieces of text into smaller, meaningful parts, making the information easier to process and understand.
1. Understanding the Building Blocks of RAG
A typical RAG architecture consists of two main components: the Retriever and the Generator and follows certain steps to achieve it.

Fig 1 RAG architecture (Created by author)
1. Data Ingestion and Chunking
The process begins by collecting documents such as PDFs, websites, text files, or databases. Since large documents cannot be processed efficiently as a whole, they are divided into smaller, meaningful sections called chunks. Chunking improves retrieval accuracy by ensuring that only relevant portions of text are searched and retrieved.
2. Embedding Generation
Each chunk is converted into numerical vector representations called embeddings using embedding models. These embeddings capture the semantic meaning of the text, enabling similarity-based searches rather than exact keyword matching.
3. Vector Database Storage
The generated embeddings are stored in a vector database such as ChromaDB, FAISS, Pinecone, or Weaviate. Vector databases are optimized for fast similarity searches and help retrieve the most relevant chunks based on user queries.
4. User Query Processing
When a user asks a question, the query is also converted into an embedding using the same embedding model. This allows the system to compare the query embedding with stored document embeddings.
5. Retrieval Phase
The retriever searches the vector database and identifies the most semantically similar chunks related to the query. Instead of searching entire documents, RAG fetches only the most relevant information.
6. Augmentation
The retrieved chunks are combined with the user query and passed as additional context to the Large Language Model. This step enhances the model’s knowledge with external information.
7. Response Generation
Finally, the LLM generates a response using both its pre-trained knowledge and the retrieved contextual information. This produces more accurate, reliable, and context-specific answers.
2. What is chunking and Why It Matters in RAG?
Chunking is the process of splitting a large document into smaller, meaningful sections called chunks, where each chunk contains sufficient contextual information for effective retrieval. Instead of processing an entire document at once, chunking helps retrieval systems focus on relevant portions of text, improving search accuracy and response quality. Proper chunking ensures that important context is preserved within each chunk, making it easier for embedding models and vector databases to retrieve semantically relevant information during a query.

Created by author
3. Need for Chunking
- Fits Within Context Window: Embedding models have token limits (context windows). Chunking ensures the text stays within this limit and prevents loss of information due to truncation.
- Improves Retrieval Accuracy: Smaller chunks allow the system to retrieve only the most relevant information instead of an entire large document.
- Preserves Semantic Meaning: Properly designed chunks maintain contextual information, making embeddings more meaningful and improving similarity search.
- Faster Processing and Search: Searching through smaller chunks is computationally more efficient than processing full documents.
- Better Response Generation: In RAG systems, retrieved chunks provide focused and relevant context to the LLM, leading to more accurate and context-aware responses.
- Efficient Storage in Vector Databases: Chunk-based embeddings are easier to store, index, and retrieve from vector databases such as ChromaDB, FAISS, or Pinecone.
4. Key Factors to Consider for Chunking
4.1 Context window:
Embedding models have a fixed context window, which defines the maximum number of tokens they can process at a time.
4.2 Chunk size:
If a sentence, paragraph, or document exceeds this limit, the extra tokens may be truncated or ignored, resulting in loss of important information. This can negatively affect the quality of embeddings, as missing context may prevent relevant information from being retrieved during similarity search. Therefore, chunk size is important for preserving context.

On the other hand, when the context window is large, unchunked documents can be used, but this increases latency and computational cost. Long-context models may also suffer from the “lost-in-the-middle” problem, where important information hidden within large documents is overlooked. Therefore, optimal chunking helps improve retrieval quality, reduce latency, and enhance response accuracy.
4.3 Chunk overlap
Chunk overlap is a technique used in document chunking where a small portion of text from one chunk is repeated in the next chunk to preserve contextual continuity. Instead of dividing a document into completely independent sections, overlapping ensures that important information appearing near chunk boundaries is not lost.
Balancing chunk size and overlap is important for preserving context during retrieval. A small overlap, typically 10–20% of the chunk size, is sufficient for most retrieval tasks, while larger overlaps help retain deeper contextual information. However, excessive overlap can introduce redundancy and increase storage and computational costs.

Created by author using ChunkViz.com
5. Chunking Strategies for RAG Pipeline
Chunking strategies play a crucial role in modern AI applications, especially in Retrieval-Augmented Generation (RAG), semantic search, and question-answering systems. The quality of chunking directly impacts retrieval accuracy, context preservation, and the overall performance of language models. Different chunking techniques such as fixed-size, recursive, and semantic chunking are designed to handle different types of documents and use cases. Choosing the right chunking strategy helps maintain contextual coherence while improving information retrieval efficiency. In Part 2, these chunking strategies will be discussed in detail along with their working mechanisms, advantages, disadvantages, and real-world use cases.
Next read: Part 2 Chunking Strategies
EndNote:
Thanks for reading the blog. Have thoughts or questions? We’d love to hear from you! Feel free to leave a comment below.
Looking forward to staying in touch through Linkedin. Mail me here for any queries.
Stay tuned for more exciting content. Till then, Happy reading!!!!
I believe in the power of continuous learning and sharing knowledge with the community. Your contributions are invaluable in helping me create meaningful content and resources that benefit everyone. Join me on this journey of exploration and innovation in the fascinating world of data science by donating to Buy Me a Coffee.
메타데이터
- post_id
- f4e40bdff59f
- slug
- chunking-the-hidden-backbone-of-rag-basics-of-chunking-part-1-f4e40bdff59f
- url
- https://medium.com/@find.pallavipadav/chunking-the-hidden-backbone-of-rag-basics-of-chunking-part-1-f4e40bdff59f
- canonical_url
- https://medium.com/@find.pallavipadav/chunking-the-hidden-backbone-of-rag-basics-of-chunking-part-1-f4e40bdff59f
- author_url
- https://medium.com/@find.pallavipadav
- status
- ok
- fetched_at
- 2026-06-09 15:37:30