
Written as part of our AI Upskilling Program
This article was created as part of the Global Devoteam AI Upskilling Program, where employees share their knowledge to accelerate their learning. The program’s key objective is to provide a foundation in AI for every employee and apply these new skills in our work. Do you want to work with us? Check out our career opportunities.
Retrieval-Augmented Generation (RAG) promises to make Large Language Models (LLMs) truly useful for your specific needs. The idea is brilliant: connect an LLM to your own up-to-date documents or data, giving it the information it needs to answer questions accurately and relevantly, without needing constant retraining. Think of it as transforming a closed-book exam for your LLM into an open-book one, allowing it to consult specific knowledge before answering.
Sounds great, right? But if you’ve worked with RAG, you might have felt… well, a bit frustrated. Despite the potential, RAG systems often stumble. Answers can be inaccurate, oddly incomplete, miss the context entirely, or worse, confidently make things up (hallucinate).
Here’s the often-overlooked culprit: it’s frequently not the LLM’s generation skills that are lacking, but the retrieval step failing. The system simply pulls back the wrong snippets of information. And why does retrieval fail? More often than not, it traces back to how the source documents were prepared – specifically, how they were chunked.
What you’ll read in this article
What is chunking?
Chunking is a technique that breaks down large documents into smaller pieces for the RAG system to search through. It enhances the efficiency, accuracy, and scalability of AI-driven applications. By structuring data into well-defined segments, AI models can retrieve and process information more effectively, resulting in better performance, lower costs, and improved user experiences.
Chunking is absolutely fundamental. Get it wrong, and you hamstring your RAG before it even starts. This highlights a crucial point: the real bottleneck in many RAG systems isn’t the AI’s ability to write, but its ability to find the right information in the first place, and that hinges on well-prepared data.
Optimising chunking isn’t just a minor tweak; it’s addressing a core weakness in the RAG pipeline.

Lennart Urkens
Data Engineer & Scientist
But what if there was a smarter way? Enter Agentic Chunking. It’s an approach that uses the LLM’s own intelligence to segment documents more effectively, preserving meaning and context. Ready to explore how your AI could prepare its own ‘study notes’ better?
Why Traditional Chunking Methods Fall Short for RAG
Before diving into Agentic Chunking, let’s understand why the usual methods often cause headaches in RAG applications.
1. Fixed-Size Chunking: The Blunt Instrument
This is the most basic approach. You take your document and chop it into pieces of a fixed length – say, 500 characters or tokens per chunk. Sometimes, we add a small overlap by repeating a few characters from the end of one chunk at the beginning of the next to preserve some context.
- Pros: It’s simple, fast, and computationally cheap.
- Cons for RAG: It’s like slicing a complex diagram with a bread knife. Fixed-size chunking pays no attention to sentence structure or meaning. It frequently cuts sentences—or even words—in half, destroying the coherence within a chunk. Crucial context needed to understand a point might end up in a completely different chunk, making it impossible for the RAG system to retrieve the full picture.
2. Recursive Chunking: A Bit Smarter, Still Limited
Recursive chunking tries to be more refined. It uses a list of separators (like double line breaks for paragraphs, then single line breaks, then spaces) and attempts to split the text along these natural boundaries first. If a resulting chunk is still too large, it recursively applies the next separator in the list until it reaches the desired size.
- Pros: It’s better at keeping sentences and paragraphs intact than fixed-size chunking, preserving some structure. It’s more flexible.
- Cons for RAG: While an improvement, it still operates based on predefined rules and chunk size limits. It doesn’t understand the content. It can still split logical arguments or related ideas across chunks, especially in complex documents lacking consistent separators. It fundamentally ignores the semantic meaning and flow of the text.
3. Semantic Chunking: Getting Closer
Recognising the need for meaning-aware splitting, Semantic Chunking emerged. This method uses language model embeddings (numerical representations of meaning) to group related sentences together. It calculates the similarity between adjacent sentences or blocks of text and splits them when the semantic similarity drops below a certain threshold, indicating a topic shift.
- Pros: It creates chunks that are much more semantically coherent, preserving meaning better. This improves retrieval accuracy as chunks align better with query intent.
- Cons for RAG: It can be more computationally expensive and complex to set up than simpler methods. Its effectiveness heavily depends on the quality of the embedding model and requires careful tuning of the similarity threshold. It primarily looks at local similarity between adjacent sentences, potentially missing broader connections.
These traditional methods essentially impose an external, often arbitrary structure (size limits, separators) onto the document. For RAG to truly excel, the way we prepare the data needs to align better with the internal, semantic structure of the information itself. This is where Agentic Chunking comes in.
Table: Chunking Strategies Compared for RAG
| Strategy | Mechanism | Context Handling | Semantic Coherence | Key RAG Pro | Key RAG Con |
|---|---|---|---|---|---|
| Fixed-Size | Fixed character/token count; optional overlap | Prone to fragmentation | Low | Simple, fast processing 9 | Loses meaning/context 9 |
| Recursive | Hierarchical separators; recursive splitting | Better structure preservation | Medium | Keeps sentences intact 18 | Can still split topics 15 |
| Semantic | Embedding similarity thresholds | Good context preservation | High | Meaningful chunks 9 | Complex, costly, tuning 9 |
| Agentic Chunking | LLM judgment on mini-chunks; semantic grouping | Designed for context | Very High | Adapts to content 26 | Higher setup/LLM cost 34 |
Agentic Chunking: Letting AI Structure Your Data Intelligently
1. What exactly is Agentic Chunking?
Think of it as delegating the task of outlining or summarising a document to an AI assistant before it even gets indexed for RAG. Instead of relying on rigid rules or simple similarity scores, Agentic Chunking employs an LLM to analyse the document and decide how to break it down into the most logical, semantically coherent pieces. The goal is to group related ideas and concepts together, preserving the natural flow and context, much like a human would when trying to understand the text.
2. How Does Agentic Chunking Work (Under the Bonnet)?
While implementations vary, the core process generally involves these steps :
- Mini-Chunk Creation: The document is first broken down into very small, manageable units, often using Recursive Text Splitting to ensure basic sentence integrity is maintained. These are sometimes called “mini-chunks”.
- Marking (Optional but Helpful): Unique markers might be added between these mini-chunks to help the LLM clearly identify the boundaries. LLMs are good at pattern recognition.
- LLM Analysis & Grouping: The sequence of (marked) mini-chunks is fed to an LLM, along with specific instructions. The LLM is prompted to analyse the content and group adjacent mini-chunks that belong together semantically. It identifies core ideas or propositions and bundles the relevant mini-chunks to form larger, meaningful final chunks.
- Chunk Assembly & Overlap: The final chunks are assembled based on the LLM’s grouping decisions. Often, a degree of overlap (e.g., including the last mini-chunk of the previous final chunk or the first mini-chunk of the next one) is intentionally created between these final chunks to ensure smooth contextual transitions.
- Guardrails & Fallbacks: Robust implementations include safeguards. Maximum chunk sizes might still be enforced to fit model context windows. Very long documents might be processed in segments. Validation checks ensure no mini-chunks are lost. If the LLM fails, the system might fall back to a simpler method like Recursive Chunking.
Key Characteristics That Make a Difference:
- Dynamic & Adaptive: Unlike fixed methods, Agentic Chunking adapts its strategy based on the actual content it encounters. The LLM uses its understanding to make decisions.
- Context-Preserving: The primary goal is to maintain the flow of meaning and keep related information together.
- Meaning-Driven: Decisions are based on semantic coherence – what the text is about – rather than arbitrary character counts or separators.
- Task-Oriented Potential: The LLM’s instructions can potentially be tailored to create chunks optimised for the specific types of questions or tasks the RAG system will handle downstream.
This approach treats the input document not just as a string of text, but as structured knowledge to be interpreted and reorganised intelligently. This makes it inherently better suited for the knowledge-intensive nature of RAG, especially when dealing with complex or nuanced information found in legal texts, technical manuals, or research papers.
The Payoff: How Agentic Chunking Supercharges Your RAG System
So, you’ve invested a bit more effort upfront using an LLM to chunk your documents. What’s the return? How does this smarter chunking actually improve your RAG system’s performance? Agentic Chunking directly tackles the retrieval bottleneck by providing higher-quality source material. Here’s how it translates into tangible benefits:
Better chunks lead to better retrieval, and better retrieval leads to better, more reliable RAG outputs.

Lennart Urkens
Data Engineer & Scientist
- Preserves Crucial Context: By intelligently grouping related sentences and ideas, Agentic Chunking ensures that the chunks retrieved during a search contain the necessary surrounding information. This gives the LLM the context it needs to grasp nuances, understand relationships, and generate accurate, well-informed answers. It significantly reduces the chances of the LLM getting confused by isolated fragments of text.
- Boosts Retrieval Relevance & Accuracy: Because the chunks are formed around coherent semantic themes, they align better with the meaning and intent behind a user’s query, not just matching keywords. This means the RAG system is far more likely to retrieve the truly relevant passages of text. It also cuts down on the “noise” of retrieving partially relevant but ultimately unhelpful chunks.
- Handles Complex Documents Better: Traditional methods often struggle with documents that don’t have simple, linear structures. Agentic Chunking, leveraging an LLM’s ability to understand different content types (like headings, lists, Q&A sections, code blocks), is much better equipped to handle the diversity and complexity found in real-world business documents, technical specifications, legal contracts, or financial reports.
- Reduces Errors & Improves Completeness: This is a major payoff. By avoiding awkward mid-sentence breaks and ensuring related information stays together, Agentic Chunking directly combats common RAG failure modes. One study reported a 92% reduction in incorrect assumptions made by the AI, as it was less likely to draw faulty conclusions from fragmented context. It also leads to more complete answers, especially for queries related to longer explanations or procedures. This translates to more reliable and trustworthy RAG outputs.
Example of Agentic Chunking
Imagine asking your RAG system about the specific conditions under Clause 7.b in a lengthy service agreement, or the steps to troubleshoot error code X-42 in a dense technical manual.
- Fixed-size chunking might give you the middle part of Clause 7.b, missing the crucial introductory sentence, or just steps 3 and 4 of the troubleshooting guide.
- Agentic Chunking, having understood the document’s structure during preprocessing, is far more likely to retrieve the entirety of Clause 7.b or the complete, sequential troubleshooting steps for X-42, because it recognised these as coherent, self-contained units of information.
This ability to provide semantically complete units of information allows the LLM in the RAG pipeline to perform its task – whether it’s answering, summarising, or analysing – far more effectively. It reduces the need for the LLM to guess or ‘fill in the gaps’, which is often where hallucinations and inaccuracies creep in.
While Agentic Chunking enhances any RAG system, it’s particularly synergistic with more advanced Agentic RAG architectures. These systems use AI agents for more complex tasks like breaking down queries, planning multi-step retrieval strategies, or reflecting on retrieved information. Providing these sophisticated agents with well-structured, context-rich chunks gives them much better ‘tools’ to work with, enabling more powerful reasoning and problem-solving.
Getting Started with Agentic Chunking
Intrigued? The good news is that Agentic Chunking isn’t just a theoretical concept anymore. Many development frameworks integrate it:
- Framework Support: Libraries like LangChain and LlamaIndex are incorporating agentic or LLM-driven chunking methods, making them more accessible for developers to experiment with.
- Emerging Solutions: Dedicated tools and platforms offering sophisticated agentic chunking capabilities are also starting to appear.
Challenges of Agentic Chunking
- Complexity & Cost: Implementing Agentic Chunking is generally more involved than just setting a character limit. It requires LLM calls during the data preprocessing stage (indexing), which adds computational cost and potentially latency compared to simpler methods. You’ll also need to think about prompt engineering for the chunking LLM and selecting an appropriate model for the task.
- Investment, Not Just Expense: View the extra effort and potential cost as an investment in the quality and reliability of your RAG system. By optimising this critical preprocessing step, you can potentially save significant costs and headaches downstream caused by poor retrieval, inaccurate answers, and user frustration. Fixing retrieval issues early is often more efficient than trying to patch up flawed generation later.
- Experimentation is Key: There’s no single “perfect” chunking strategy for every situation. The best approach depends heavily on the nature of your documents (structure, complexity, length) and the types of queries your RAG system needs to handle. Agentic Chunking is a powerful contender that should be part of your evaluation toolkit alongside other methods.
The fact that these advanced chunking methods are becoming mainstream signals a growing understanding in the AI community: sophisticated data preparation is non-negotiable for building truly robust and capable RAG systems.
Conclusion: Chunk Smarter, Not Harder for Better RAG
We’ve seen how Retrieval-Augmented Generation holds immense promise, but often falls short due to limitations in how we prepare the underlying data. Traditional chunking methods, while simple, can inadvertently sabotage RAG performance by fragmenting context and ignoring the semantic meaning of your documents.
Agentic Chunking offers a compelling alternative. By leveraging the intelligence of an LLM during the preprocessing stage, it aims to create chunks that are semantically coherent, contextually rich, and better aligned with how language models actually process information. It represents a shift from simply splitting text to intelligently structuring knowledge for retrieval.
The payoff? More relevant search results, better context provided to the generator, reduced errors and hallucinations, and ultimately, a more accurate, reliable, and powerful RAG system.
So, take a critical look at your current RAG pipeline. Is your chunking strategy helping or hindering? Could letting your AI assist in structuring its own knowledge base be the key to unlocking significantly better performance? It might just be time to chunk smarter, not harder.
What are your experiences with chunking for RAG? Have you tried Agentic Chunking? Get in touch with us to discuss your project.
Over 80% of AI projects fail. Yours don’t have to.

Download our AI Strategy Playbook:
- Learn why AI projects often fail (and how to avoid it).
- Follow 10 clear steps for a strong AI plan.
- Focus on solving business problems (not just using AI).
- Find the best AI uses for your business (includes 100+ examples).
- Learn how to measure AI results (GenAI projects average ~3.7x return).
- Get your tech foundations ready (Cloud, Data, and AI Security).
- Help your team adapt to AI (and see how we train our staff).
- Use AI responsibly (covering fairness, bias, and environmental thoughts).