liveBook · Manning

Text chunk

As explained in MongoDB 8.0 in Action, Third Edition

A text chunk is a bounded, coherent segment of source text, such as a paragraph or section, treated as one unit for processing.

A text chunk is a small, coherent segment of a source document, often a paragraph or section. In retrieval-augmented generation (RAG), chunks make detailed documents easier to process and help the system retrieve information relevant to a question. section 14.1

A chunk moves through a RAG workflow in four steps:

  • Parse a document to extract its text, then divide that text into coherent chunks. section 14.1
  • Pass each chunk through an embedding model and store its vector representation in a vector database. section 14.1
  • Embed a user's query and use vector search to find relevant document chunks. section 14.1
  • Place retrieved chunks in the prompt so the language model can ground its response in the source documents. section 14.1

Chunking a source document

A PDF or Microsoft Word document can be parsed into text and segmented so that a paragraph or section forms one complete piece of information for later retrieval. section 14.1

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Explains chunking within a high-level retrieval workflow but does not specify a segmentation algorithm or chunk-size rule.
Examples
Uses PDFs and Microsoft Word documents as sources, with paragraphs and sections as possible chunks.
What it assumes
Starts with text-based documents and introduces parsing before chunk embedding; assumes no precomputed vectors.
What you can do after
Evaluate/understand how coherent source-text segments become retrievable context for a grounded response.
How it connects
Connects document parsing and text chunks to embeddings, vector databases, vector search, prompts, and language models.

Also explained in

Compare how 19 books explain text chunk →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.