RAG Chunk Visualizer
Scopri come un documento viene suddiviso in chunk per RAG: dimensione dei chunk, sovrapposizione, conteggio dei token, costi di embedding e contesto recuperato
Come il RecursiveCharacterTextSplitter di LangChain: tenta di tagliare prima sulle righe vuote, poi su a capo, frasi e parole, per preservare al meglio il significato semantico dei chunk.
- Chunk
- 3
- Token del documento
- 232
- Media token / chunk
- 81
- Min / max token
- 46 / 126
- Token per l'embedding
- 242
- Fattore di sovrapposizione
- 1.04×
Costo di embedding stimato: $0.000005
Contesto aggiunto a ciascun prompt: 323 token
Mappa del documento (giallo = sovrapposizione con il chunk precedente)
Le righe alternate facilitano la distinzione tra chunk adiacenti.
- #170 token280 caratteri0–280
# Retrieval-Augmented Generation Retrieval-Augmented Generation (RAG) gives a language model access to knowledge it was not trained on. Instead of fine-tuning, you split your documents into chunks, embed each chunk, and store the vectors in a database. ## Why chunking matters
- #2126 token503 caratteri255–75825 caratteri di sovrapposizione
## Why chunking matters At query time the question is embedded and the closest chunks are retrieved. If a chunk is too large, it dilutes the meaning and wastes context window. If it is too small, it loses the surrounding context and the answer gets cut in half. A common starting point is 256 to 512 tokens with 10 to 20 percent overlap. Overlap repeats the end of one chunk at the start of the next, so a sentence that straddles a boundary is still found whole in at least one chunk. ## Trade-offs
- #346 token184 caratteri743–92715 caratteri di sovrapposizione
## Trade-offs Larger overlap improves recall but increases the number of tokens you embed and store. Always measure retrieval quality on your own questions before settling on a size.
I conteggi dei token sono stime (~4 caratteri per token per l'inglese, ~1 per caratteri non latini), non l'output esatto del tokenizer di un modello. I costi dipendono dai prezzi attuali del tuo provider.