# Dzielenie dokumentów

EN: **Document chunking** · id `chunking`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Aplikacje LLM i agenci](https://aiatlasgraph.com/t/applications.md) › [Wyszukiwanie i RAG](https://aiatlasgraph.com/t/retrieval.md) › Dzielenie dokumentów

## Description

- PL: Cięcie dokumentów na fragmenty do indeksu, najlepiej według struktury i z metadanymi.
- EN: Cutting documents into indexable pieces, preferably by structure and with metadata.

## In one sentence

- PL: To dzielenie dokumentów na mniejsze fragmenty, które można osobno odnaleźć i podać modelowi.
- EN: This splits documents into smaller passages that can be found individually and given to a model.

## Problem it solves

- PL: Potrzebna odpowiedź ginie w długim dokumencie, a przekazywanie całego tekstu zajmuje miejsce i zwiększa koszt.
- EN: The answer you need is buried in a long document, while sending the whole text takes space and costs more.

## What it does

- PL: Może dzielić tekst według nagłówków i zachowywać informację, z którego dokumentu oraz miejsca pochodzi każdy fragment.
- EN: It can split text at headings and keep a record of the document and location each passage came from.

## Everyday example

- PL: Pytasz o konserwację pralki, a asystent otrzymuje rozdział o czyszczeniu filtra z długiej instrukcji obsługi.
- EN: You ask about washing machine maintenance, and the assistant receives the filter cleaning section from a long manual.

## This concerns you if you…

- PL: pracujesz z długimi instrukcjami lub umowami
- PL: chcesz znajdować konkretne fragmenty zamiast całych dokumentów
- EN: work with long manuals or contracts
- EN: want specific passages instead of entire documents

## Keywords

header-based splitting · recursive text splitting · semantic chunking · chunk overlap · token-based splitting · document loaders · chunk metadata

## How it works

- PL: Dokument dzieli się według długości, nagłówków lub granic znaczeniowych, zachowując identyfikator i położenie fragmentów. Fragmenty otrzymują embeddingi lub wpisy indeksu słów, a opcjonalne nakładanie zakresów pomaga zachować informacje przecinające granicę podziału.
- EN: Documents are split by length, headings or semantic boundaries while retaining passage identifiers and locations. Passages receive embeddings or lexical index entries, and optional overlap helps preserve information crossing a split boundary.

## Limits

- PL: Małe fragmenty tracą kontekst, a duże mogą zawierać wiele niepowiązanych treści. Nakładanie zwiększa rozmiar indeksu i powtarzalność wyników; rozmiar podziału należy oceniać na rzeczywistych pytaniach.
- EN: Small passages lose context, while large ones can contain unrelated material. Overlap increases index size and result duplication; chunk size should be evaluated on actual questions.

## Key terms

- PL: **chunk**: Fragment dokumentu traktowany jako jednostka wyszukiwania.
- PL: **overlap**: Wspólny zakres treści sąsiednich fragmentów.
- PL: **metadane fragmentu**: Informacje o pochodzeniu, położeniu i właściwościach fragmentu.
- EN: **chunk**: A document passage treated as a retrieval unit.
- EN: **overlap**: Content shared between neighboring passages.
- EN: **chunk metadata**: Information about a passage's origin, location and properties.

## Know first

- [Tokenizacja tekstu (BPE, WordPiece, SentencePiece) (Text tokenisation (BPE, WordPiece, SentencePiece))](https://aiatlasgraph.com/t/tokenization.md)
- [Ekstrakcja tekstu ze stron i PDF (Text extraction from HTML and PDFs)](https://aiatlasgraph.com/t/textextraction.md)

## Examples

- PL: po nagłówkach · rekurencyjnie · metadane · ładowanie formatów
- EN: by header · recursive · metadata · format loaders

## Related topics

Untyped, symmetric "see also" links.

- [Analiza układu i parsowanie dokumentów (Document layout analysis and parsing)](https://aiatlasgraph.com/t/layoutanalysis.md)

## Sources

- [LLM Course (Maxime Labonne)](<https://github.com/mlabonne/llm-course>) `mlabonne-llm-course` · by Maxime Labonne

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/chunking · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
