Advanced text chunking libraries

Updated Nov 21, 2026ChatGPT and Google AI Mode
Mention rate, on ChatGPT and Google AI Mode
  • LangChainChatGPTChatGPT 100%Google AI ModeGoogle AI Mode 100%
  • UnstructuredChatGPTChatGPT 100%Google AI ModeGoogle AI Mode 100%
  • LlamaIndexChatGPTChatGPT 67%Google AI ModeGoogle AI Mode 100%
  • ChonkieChatGPTChatGPT 100%Google AI ModeGoogle AI Mode 50%
  • DoclingChatGPTChatGPT 83%Google AI ModeGoogle AI Mode 50%

Questions and answers

  • ChatGPTNov 21, 2026

    1. 1Chonkie
    2. 2LangChain
    3. 3Docling
    4. 4Unstructured
    5. 5LlamaIndex Connectors
    6. 6Haystack (deepset)

    Top-rated text chunking tools and frameworks for RAG (2026)

    For sophisticated Retrieval-Augmented Generation (RAG) systems, I would shortlist Chonkie, LlamaIndex, LangChain, Docling, and Unstructured.

    The important distinction is that some tools specialize in chunking algorithms, while others provide complete document-ingestion pipelines. If you're implementing advanced strategies such as semantic, hierarchical, contextual, late, or structure-aware chunking, that distinction matters.

    My recommendation is to consider Chonkie and LlamaIndex first for advanced chunking, and Docling if your corpus contains complex PDFs, tables, and Office documents.

    1. Top tools compared

    ToolBest capabilityAdvanced chunking
    ChonkieDedicated chunking libraryExcellent
    LlamaIndexSophisticated RAG ingestionExcellent
    LangChainFlexible splitting ecosystemVery good
    DoclingStructure-aware document chunkingExcellent
    UnstructuredDocument-aware preprocessingVery good
    HaystackModular production pipelinesVery good

    These are capability-based recommendations, not a universal benchmark ranking. A recent November 2026 comparison independently identifies the same six libraries as leading options for RAG chunking.

    2. Detailed evaluation

    • Chonkie 实用的 RAG 分块库,轻量级、速度快,可随时对文本进行分块 - CodeNews

    1. Chonkie

    (Best dedicated chunking library)

    Open source · Python · MIT

    GitHub: approximately 4.8k stars in the retrieved snapshot.

    GitHub repository ·

    Chonkie is particularly interesting because it focuses on chunking rather than trying to be an entire RAG framework.

    Supported approaches include:

    • Token-based chunking.
    • Sentence-based chunking.
    • Recursive chunking.
    • Semantic chunking.
    • Late chunking.
    • Neural and LLM-driven chunking.
    • Code and table chunking.

    Why I recommend it: You can experiment with several chunking strategies independently of your embedding model, vector database, and orchestration framework.

    Source:


    • LlamaIndex IA - Construye agentes LLM sobre datos empresariales

    2. LlamaIndex

    (Best for sophisticated RAG architectures)

    Open source · Python and TypeScript

    GitHub repository ·

    LlamaIndex provides a rich node parsing and document-ingestion ecosystem.

    Particularly useful capabilities:

    • SentenceSplitter: preserves sentence boundaries.
    • SemanticSplitterNodeParser: identifies semantic boundaries using embeddings.
    • HierarchicalNodeParser: creates multiple levels of document granularity.
    • Markdown and HTML-aware parsing.
    • Parent-child relationships between chunks.
    • Metadata extraction and propagation.

    Why I recommend it: Its hierarchical node architecture is particularly useful for systems that need both precise retrieval and broader contextual information.

    For example, retrieve a small paragraph but provide the parent section to the LLM for additional context.

    Source:


    • LangChain Logo PNG Vector (SVG) Free Download

    3. LangChain

    (Best for integration flexibility)

    Open source · Python and JavaScript/TypeScript

    GitHub repository ·

    LangChain's text-splitting ecosystem is mature and widely used.

    Useful splitters include:

    • RecursiveCharacterTextSplitter
    • TokenTextSplitter
    • MarkdownHeaderTextSplitter
    • HTMLHeaderTextSplitter
    • Language-specific code splitters.
    • Semantic chunking integrations.

    Why I recommend it: It is a good choice when chunking is one component of a larger system involving multiple retrievers, rerankers, agents, and vector databases.

    Its recursive splitter is a sensible baseline because it tries to preserve paragraphs and sentences before splitting into smaller units.

    Source:


    • Alibaba Cloud OCR官网入口、公司介绍与详细资料 - AIBestBox 智模导航

    4. Docling

    (Best for complex documents)

    Open source · Python · MIT

    GitHub repository ·

    Docling's HybridChunker is particularly useful for sophisticated document processing.

    Features include:

    • Document hierarchy preservation.
    • Layout-aware parsing.
    • Token-aware chunk sizing.
    • Table and heading preservation.
    • Combining smaller document elements into appropriately sized chunks.

    Why I recommend it: Traditional text splitting can destroy the relationships between headings, paragraphs, tables, and captions. Docling helps preserve these relationships before indexing.

    Source:


    • Unstructured Darmowe pobrania SVG, P... · LobeHub

    5. Unstructured

    (Best for heterogeneous data)

    Open source · Python · Apache 2.0

    GitHub repository ·

    Unstructured is primarily a document ingestion and preprocessing framework.

    Its chunking capabilities include:

    • Basic chunking.
    • By-title chunking.
    • Element-based chunking.
    • Preservation of document metadata.
    • Handling of PDFs, DOCX, HTML, and other document formats.

    Why I recommend it: Particularly useful when documents originate from many sources and need to be converted into structured elements before chunking.

    Source:


    • adding the Haystack logo · deepset/should-i-follow at b707cdc

    6. Haystack

    (Best for modular production pipelines)

    Open source · Python · Apache 2.0

    GitHub repository ·

    Haystack offers modular indexing and retrieval pipelines.

    Useful capabilities:

    • Document preprocessing.
    • Recursive splitting.
    • Metadata-aware processing.
    • Integration with specialized chunkers.
    • Explicit, inspectable indexing pipelines.

    Why I recommend it: It is attractive for production RAG systems where ingestion, retrieval, and evaluation need to be independently configurable.

    Source:

    3. Advanced chunking strategies worth implementing

    Choosing a framework is only half the decision. These are the strategies I'd investigate for a sophisticated RAG architecture.

    StrategyHow it worksBest application
    Semantic chunkingSplits when semantic similarity changesLong-form documents
    Hierarchical chunkingCreates parent, child, and sometimes grandchild chunksComplex questions
    Late chunkingEmbeds larger context before pooling token representations into chunksContext-sensitive retrieval
    Contextual chunkingAdds document and section context to individual chunksFragmented documents
    Structure-aware chunkingRespects headings, tables, paragraphs, and document layoutPDFs and technical documents
    Agentic chunkingUses an LLM to decide meaningful boundariesHighly unstructured documents
    Sliding-window chunkingUses overlapping windowsContinuous narratives and logs

    A few particularly interesting approaches:

    A. Hierarchical retrieval (small-to-big)

    Parent document

    Technical documentation: Database architecture

    Each child can be split into smaller retrieval units.

    Retrieved leaf chunks

    Precise matches returned to the retrieval system

    The retriever searches smaller chunks, then retrieves their parent context for generation. This balances precision and context.

    B. Semantic chunking

    Instead of splitting every 500 tokens, calculate similarity between adjacent sentences or groups of sentences. Create a boundary when semantic similarity drops sufficiently.

    This helps prevent unrelated topics from appearing in the same chunk.

    C. Contextual chunking

    Attach contextual information to each chunk, for example:

    • Document title.
    • Section heading.
    • Parent section summary.
    • Relevant entity names.
    • Document type and source.

    This helps chunks remain meaningful even when retrieved independently.

    D. Late chunking

    An especially interesting technique: encode a larger document first, then pool token-level embeddings into chunk embeddings.

    This allows individual chunk embeddings to retain information from their surrounding document context. It requires an embedding model that exposes suitable token-level representations.

    4. My recommended architecture for sophisticated RAG

    If I were building a production-grade RAG system today, I'd combine specialized tools rather than rely on one framework.

    Recommended ingestion architecture

    1. Document ingestion

    PDF, DOCX, HTML, Markdown, databases

    Docling / Unstructured

    2. Structure extraction

    Headings, tables, metadata, document hierarchy

    3. Advanced chunking

    Chonkie / LlamaIndex

    Semantic + hierarchical + contextual chunking

    4. Embedding generation

    Dense embeddings, optionally late chunking

    5. Vector and hybrid indexing

    Vector database + keyword index + metadata

    6. Retrieval and reranking

    Hybrid retrieval + parent-child retrieval + reranking

    7. LLM generation

    Context assembly, citations, grounded responses

    For orchestration, I'd choose LlamaIndex or LangChain depending on the existing application architecture.

    5. How to evaluate chunking quality

    Don't select a chunking framework solely by GitHub stars or implementation convenience.

    I'd benchmark the following:

    MetricWhat it measures
    Recall@KWhether relevant chunks are retrieved
    Precision@KWhether retrieved chunks are relevant
    MRRHow highly the first relevant result ranks
    Context precisionHow much retrieved context is useful
    Context recallWhether retrieved context covers the answer
    FaithfulnessWhether generated answers are grounded
    Indexing latencyCost of creating chunks and embeddings
    Retrieval latencyCost of finding relevant chunks

    I'd also compare multiple chunk sizes rather than assume one is optimal. A reasonable experimental starting point is:

    • 256 tokens
    • 512 tokens
    • 768 tokens
    • 1,024 tokens

    Use approximately 10–20% overlap as an initial baseline, then tune against your evaluation dataset. These are starting points, not universal optimal values.

    6. Final recommendations

    My strongest recommendation: Start with Chonkie for chunking experimentation, LlamaIndex for hierarchical and semantic retrieval, and Docling for document parsing where necessary. Evaluate the combined pipeline against a representative question-and-answer dataset before committing to it.


    7. One important question about your RAG system

    What kind of documents are you primarily indexing?

    1. Document types


    2. Primary objective


    3. Technology stack

    [Design my RAG chunking architecture]

    I can use those details to narrow this down to a concrete architecture, including the actual chunking algorithms and framework integrations worth implementing.

    Pages cited in this answer 19

    Google AI ModeNov 5, 2026

    1. 1LlamaIndex
    2. 2LangChain
    3. 3Unstructured
    4. 4NVIDIA
    5. 5Docugami
    6. 6NVIDIA NeMo Data Designer

    The top-rated frameworks and tools for implementing sophisticated text chunking strategies in a Retrieval-Augmented Generation (RAG) system are categorized below by their primary approach and technical capabilities.

    Top Frameworks & Tools for RAG Chunking

    • LlamaIndex
      • Best for: Semantic splitting, hierarchical parsing, and node relationships.
      • Key Capabilities: Provides out-of-the-box support for SemanticSplitterNodeParser (which groups consecutive sentences by embedding similarity), hierarchical chunking (linking parent summary chunks to child detail chunks), and node-level metadata preservation.
    • LangChain
      • Best for: Recursive character splitting, layout-aware parsing, and modular pipelines.
      • Key Capabilities: Offers flexible text splitters (RecursiveCharacterTextSplitter, MarkdownHeaderTextSplitter, HTMLSectionSplitter ) that respect natural document grammar, headers, and code blocks before falling back to fixed-size token or character limits.
    • UnstructuredUnstructured ( Unstructured.ioUnstructured.io )
      • Best for: Complex multi-format document ingestion (PDFs, DOCX, PPTX, images).
      • Key Capabilities: Automatically extracts structural elements like titles, narrative text, tables, and embedded charts, allowing you to chunk by document layout or partition elements without breaking table boundaries.
    • NVIDIA NeMo / RAG Blueprints
      • Best for: Enterprise evaluation, microservices architecture, and benchmarked strategies.
      • Key Capabilities: Provides reference implementations and blueprints to benchmark different chunking strategies (such as page-level vs. token-based vs. section-level chunking) while standardizing embedding and reranking microservices.
    • Docugami
      • Best for: XML/tree-based semantic chunking of long-form business and financial documents.
      • Key Capabilities: Generates semantic XML trees from complex contracts, leases, and reports to preserve deep document architecture rather than slicing text blindly.

    Comparison of Core Chunking Strategies

    If you'd like to narrow this down, tell me:

    • What type of documents you are working with (PDFs, web scrapes, legal contracts, code)?
    • Are you prioritizing maximum retrieval accuracy or low processing latency/cost?
  • ChatGPTNov 21, 2026

    1. 1Chonkie
    2. 2Docling
    3. 3LlamaIndex
    4. 4LangChain
    5. 5Unstructured

    If you're moving beyond naive fixed-size chunking, I'd focus on semantic, structure-aware, hierarchical, and late chunking rather than simply increasing chunk size or overlap.

    As of November 2026, there are several strong open-source options. My shortlist would be Chonkie, Docling, LlamaIndex, LangChain, and Unstructured.

    The important distinction is that these tools solve slightly different problems: some identify semantic boundaries, some preserve document structure, and others provide multiple retrieval-oriented segmentation strategies.

    1. Top text segmentation libraries

    Here is my practical ranking based on capability, flexibility, and suitability for RAG pipelines—not a universal benchmark ranking.

    • 学习 SurfSense 的数据入库流程 - 日习一技

    1. Chonkie

    (Best standalone chunking toolkit)

    • Semantic, recursive, sentence, token, code, table, neural, and late chunking.
    • Lightweight and designed specifically for chunking.
    • Good for experimenting with different segmentation strategies without adopting an entire RAG framework.

    Best when you want a dedicated chunking layer.

    GitHub repository


    • Information Extraction (Tests on a Beta API) from Docling | by Alain Airom (Ayrom) | Medium

    2. Docling

    (Best structure-aware segmentation)

    • HybridChunker respects document hierarchy and token limits.
    • Preserves headings, tables, lists, and document relationships.
    • Particularly useful for PDFs, technical documents, and Office files.

    Best when document layout matters as much as text content.

    GitHub repository ·


    • LlamaIndex partners with Microsoft Azure to power the future of AI-forward data solutions | Microsoft Customer Stories

    3. LlamaIndex

    • SemanticSplitterNodeParser.
    • HierarchicalNodeParser.
    • SentenceSplitter and SentenceWindowNodeParser.
    • Supports parent-child relationships between chunks.

    Best for hierarchical retrieval and context-aware RAG.

    GitHub repository ·


    • LangChain - Partner Ecosystem | MongoDB

    4. LangChain

    • RecursiveCharacterTextSplitter.
    • MarkdownHeaderTextSplitter.
    • HTMLHeaderTextSplitter.
    • Token-aware and code-aware segmentation.
    • Semantic chunking integrations.

    Best for an existing LangChain-based RAG stack.

    GitHub repository ·


    • IBM Ventures

    5. Unstructured

    • Element-based partitioning.
    • by_title chunking strategy.
    • Combines document elements while respecting structural boundaries.
    • Handles PDFs, HTML, DOCX, PPTX, and other formats.

    Best for heterogeneous enterprise document collections.

    GitHub repository ·

    These choices are consistent with recent comparative tool roundups and documentation, although the rankings above are my engineering recommendations rather than independently verified ratings.

    2. Advanced segmentation techniques worth exploring

    The library matters, but the segmentation algorithm matters even more.

    StrategyHow it worksMain advantage
    Semantic chunkingDetects topic shifts using embedding similarityPreserves conceptual coherence
    Hierarchical chunkingCreates parent, child, and sometimes grandchild chunksSupports broad and precise retrieval
    Late chunkingEmbeds larger text first, then pools token embeddings into chunksPreserves surrounding context
    Structure-aware chunkingSplits using headings, sections, tables, and document layoutPreserves document organization
    Agentic/LLM chunkingUses an LLM to identify logical content boundariesHandles complex narrative structures
    Proposition chunkingBreaks text into atomic factual statementsImproves precise factual retrieval

    A few deserve particular attention:

    Semantic chunking

    Instead of splitting every 500 tokens, compare adjacent sentences using embeddings. When semantic similarity drops below a threshold, create a new chunk.

    Useful for:

    • Long-form articles.
    • Knowledge bases.
    • Research papers.
    • Documents with frequent topic changes.

    Hierarchical chunking

    Create multiple levels of segmentation:

    Parent chunk: Database Architecture

    Child 1

    Indexing strategies

    Child 2

    Query optimization

    Child 3

    Replication

    Child 4

    Consistency models

    Retrieve a precise child chunk, then optionally expand its parent for additional context.

    LlamaIndex is particularly useful for implementing this approach.

    Late chunking

    This is an especially interesting approach if you're trying to improve retrieval without losing contextual information.

    Traditional chunking:

    1. Split document.
    2. Embed each chunk independently.
    3. Store embeddings.

    Late chunking:

    1. Tokenize and embed the larger document.
    2. Obtain contextualized token embeddings.
    3. Define chunk boundaries.
    4. Pool the relevant token embeddings for each chunk.

    This allows a chunk's embedding to reflect context from outside its own boundaries. It requires an embedding model that exposes suitable token-level embeddings.

    3. My recommended technology combinations

    Rather than selecting one library to do everything, I'd consider these combinations:

    Use caseRecommended combination
    General-purpose RAGChonkie + your existing vector database
    Complex PDF ingestionDocling + HybridChunker
    Hierarchical retrievalLlamaIndex + hierarchical node parsing
    Enterprise document ingestionUnstructured + custom chunking
    Semantic segmentation experimentsChonkie + embedding model
    Existing LangChain pipelineLangChain splitters + Chonkie

    One particularly promising combination is Docling for document extraction followed by Chonkie for additional semantic segmentation.

    The benefit is separating two distinct problems:

    • Understanding the document's structure.
    • Determining the best retrieval boundaries.

    4. How to benchmark these approaches

    Don't assume semantic chunking automatically produces better RAG results. A 2026 IEEE survey identifies inconsistent evaluation practices as a major challenge in comparing chunking strategies.

    I'd benchmark at least these five approaches:

    1. Fixed-size baseline.
    2. Recursive character splitting.
    3. Semantic chunking.
    4. Hierarchical chunking.
    5. Late chunking.

    Measure:

    MetricWhat it tells you
    Recall@5 / Recall@10Whether relevant information is retrieved
    Precision@KWhether retrieved chunks are relevant
    MRR / NDCGWhether relevant results rank highly
    Answer faithfulnessWhether answers remain grounded
    Context utilizationHow much retrieved context is useful
    Indexing latencyCost of preparing documents
    Storage overheadEmbedding and metadata footprint

    Keep the embedding model, retrieval configuration, test questions, and reranker constant while comparing chunking methods.


    5. My final recommendation

    If I were building a sophisticated RAG pipeline today, my starting architecture would be:

    Source documents

    PDF · HTML · DOCX · Markdown

    Docling / Unstructured

    Parsing and structural extraction

    Chonkie / LlamaIndex

    Semantic and hierarchical segmentation

    Embedding and indexing

    Context-aware embeddings and metadata

    Hybrid retrieval + reranking

    Vector search · BM25 · parent-child retrieval

    6. One question that would help narrow this down

    What kind of documents does your RAG pipeline primarily ingest?

    Document types


    Current technology stack


    Primary objective

    [Build my recommended architecture]

    With those details, I can narrow this down to an actual implementation rather than just a list of libraries.

    Google AI ModeNov 21, 2026

    1. 1Chonkie
    2. 2LlamaIndex
    3. 3LangChain
    4. 4Unstructured
    5. 5Marker
    6. 6Docling

    To move beyond naive fixed-size chunking, use specialized open-source libraries that handle semantic boundaries, structure, and token efficiency.

    Top-Rated Tools & Libraries

    • Chonkie : A lightweight, dedicated Python library built strictly for text chunking. It supports fast SIMD-based splitting, sentence chunking, recursive rules, semantic chunking, code segmentation, and late-chunking strategies with minimal bloat.
    • LlamaIndex : Built specifically for data-centric RAG systems, it offers advanced NodeParsers that handle hierarchical chunking, markdown/code-aware parsing, and metadata extraction out of the box.
    • LangChain : A general framework featuring diverse TextSplitters (such as SemanticChunker, RecursiveCharacterTextSplitter , and language-specific code splitters) that fit easily into broader agentic workflows.
    • Unstructured / Marker / Docling : Document-parsing libraries that extract layout, tables, and hierarchical headings first, allowing you to segment text strictly by logical document structure rather than arbitrary character counts.

    Core Alternative Strategies to Implement

    • Semantic Chunking: Calculates embedding distance or cosine similarity between consecutive sentences and cuts a chunk whenever the semantic drift crosses a threshold.
    • Recursive Character / Sentence Chunking: Tries to split on large natural boundaries (paragraphs) first, falling back to smaller boundaries (sentences, then words) only if a chunk exceeds your token limit.
    • Hierarchical / Parent-Child Chunking: Indexes small, fine-grained chunks for high-precision vector search, but feeds the larger parent paragraph or section to the LLM to preserve context.
    • Late Chunking: Embeds the entire long-form document context first (using long-context embedding models) and derives chunk representations afterward to prevent loss of global context.

    What type of documents (e.g., PDFs, codebases, legal contracts) are you primarily processing, and what embedding model or vector database are you using?

Since Oct 6Data through Nov 21, 2026Based on 10 AI answers

How we measure
For agents: this page as Markdown, parse.gl/topics/advanced-text-chunking-libraries.md. JSON, MCP · free for the last 90 days, checks from $0.01

This page

Reuse: Figures and tables on this page are free to republish with attribution: a link to https://parse.gl/topics/advanced-text-chunking-libraries beside them. A standard followed link (dofollow) is preferred.

Read and search

Every brand's share on this topic, with 95% ranges: GET agent.parse.gl/v1/tools/query_metrics?args=%7B%22measures%22%3A%5B%22share_named%22%5D%2C%22by%22%3A%5B%22brand%22%5D%2C%22filter%22%3A%7B%22topic%22%3A%5B%22top_675adc28-1729-439e-ac34-1bf113e522ca%22%5D%7D%7D
Search the index: GET parse.gl/api/public/search?q=<words>

Connect

Connect an assistant: agent.parse.gl/mcp
CLI check: npx -y parse-gl check <domain>

An agent can save work before signup: POST https://agent.parse.gl/v1/workspaces

What it costs

No account: Public figures and up to 5 examples per list, about 120 brands a day per address.
Free account: $2 verified-email starter credits, 90-day Parse Index reads, your brand's first check (20 buyer questions), and a free weekly check.
Prepaid credits (from $20): Exports, deeper search results, live checks, verified contacts, and daily tracking ($12 a month).
Live checks: $0.01 per standard check/live page/judgment; $0.05 per frontier check (Gemini, Claude) or verified contact.
Full public answers and pages: 25 free per day, then $0.01 each.
Public answers older than 90 days: $0.01 each the first time your workspace counts or lists one, then yours.