RAG Chunk Visualizer
Observa cómo se divide un documento en fragmentos para RAG: tamaño del fragmento, superposición, recuento de tokens, coste de incrustación y contexto recuperado
Similar a RecursiveCharacterTextSplitter de LangChain: intenta cortar primero en líneas en blanco, luego saltos de línea, frases y palabras, manteniendo los fragmentos lo más semánticos posible.
- Fragmentos
- 3
- Tokens del documento
- 232
- Promedio de tokens / fragmento
- 81
- Mín. / máx. tokens
- 46 / 126
- Tokens a incrustar
- 242
- Factor de superposición
- 1.04×
Coste estimado de incrustación: $0.000005
Contexto añadido a cada prompt: 323 tokens
Mapa del documento (amarillo = superposición con el fragmento anterior)
Las filas alternas facilitan la distinción entre fragmentos adyacentes.
- #170 tokens280 caracteres0–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 tokens503 caracteres255–75825 caracteres de superposición
## 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 tokens184 caracteres743–92715 caracteres de superposición
## 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.
Los recuentos de tokens son estimaciones (~4 caracteres por token en inglés, ~1 por carácter no latino), no la salida exacta del tokenizador de un modelo. Los costes dependen de las tarifas actuales de tu proveedor.