La Retrieval-Augmented Generation (RAG) e' una tecnica che combina modelli linguistici con recupero di documenti esterni. Il processo RAG si divide in due fasi principali: indicizzazione e inferenza. Nella fase di indicizzazione, i documenti vengono suddivisi in chunk, convertiti in embedding e salvati in un vector store. Durante l'inferenza, la query dell'utente viene convertita in embedding,
_RAG Chunking Visualizer
Paste your text and visually compare 8 chunking strategies for RAG pipelines. Jaccard similarity heatmap included. 100% client-side - no data transmitted.
Configuration
Split ogni N caratteri. Semplice e deterministico.
Input text
Chunk prodotti (3)
vengono recuperati i chunk piu' simili e il modello genera una risposta contestualizzata. La scelta della strategia di chunking impatta significativamente la qualita' dei risultati RAG. Chunk troppo piccoli perdono contesto, chunk troppo grandi riducono la precisione del retrieval. Le strategie piu' comuni includono: split fisso per semplicita', split per frase per coerenza semantica, split per
paragrafo per testi strutturati, e sliding window per massimizzare il contesto disponibile.
Guide to the 8 strategies
| Strategy | When to use it | For | Against |
|---|---|---|---|
| Fixed Size | Plain texts without structure | Deterministic, fast | Cut sentences at meta' |
| Sentence | Articles, News, Narrative Texts | Non capisco la richiesta. Puoi fornire il testo da tradurre? | Variable-sized chunks |
| Paragraph | Structured documents | Natural Semantics | Long or short paragraphs |
| Recursive | Variable-structured mixed documents | Flexible, adaptable | More complex logic |
| Semantic Cosine | Mixed-topic texts | Semantically coherent chunks | Approximated without actual embeddings |
| Sliding Window | Technical QA on texts, maximum context. | No context lost | Redundancy, more called embeddings |
| Markdown Header | Documentation, READ ME, Wiki | Respect the Markdown hierarchy | Only for markdown texts |
| Token Bucket | Token Count Control | Respect word boundaries | Ignore semantic structure. |
Come utilizzare RAG Chunking Visualizer
Attach text or load example
Insert your text into the input area, or click "Load example" to use a pre-written text on the topic of RAG.
Choose strategy, size and overlap
Choose one of the 8 chunking strategies from the menu, adjust the chunk size (100-2000 characters), and set the sliding window overlap percentage (0-50%).
Analyze product chunks
The list of chunks updates automatically showing number, estimated tokens and character range for each block.
Activate heat map of similarity
Click "Show Similarity Heatmap" to visualize the Jaccard matrix between chunks and understand semantic overlap.
Suggerimenti
- For technical documentation (README, wiki), test Markdown headers first: preserve hierarchical title structure.
- Notice small chunks or those cutting sentences in half; increase chunk size or switch to sentence/paragraph strategy.
- Use heatmaps to identify excessive overlap between adjacent chunks when working with Sliding Window: too high overlap increases embedding calls without proportional benefits.
Domande frequenti
What is the difference between the 8 chunking strategies?
Fixed Size divides by fixed length (fast but cuts sentences), Sentences and Paragraphs respect natural text boundaries, Recursive is adaptive for mixed documents, Semantic Cosine groups similar content, Sliding Window adds overlap to preserve context, Markdown Header follows title hierarchy, Token Bucket precisely counts token tokens. The comparison table on the page summarizes pros and cons of each.
Does the heatmap use real embeddings?
No. The similarity shown is calculated using the Jaccard coefficient on token sets (deduplicated words) of every chunk pair, not with true vector embeddings. It's a useful approximation for quick qualitative comparison between strategies, not for production decisions.
Which strategy should I choose for my RAG pipeline?
Depends on the type of document: use Paragraph or Markdown Header for structured content (blog, wiki, documentation), Sentence for narrative text, Sliding Window when context between chunks is critical for retrieval (e.g. technical QA), Fixed Size only for rapid prototyping.
What happens if the text is very short or empty?
If the text field is empty, it will display an empty state with an example load invitation. For very short texts, some strategies (like Paragraph) may produce only one chunk; try reducing the chunk size to get a more granular division.
Are my data sent to a server or an AI model?
No, the tool is 100% client-side: chunking, token counting estimation, and Jaccard calculation occur entirely in the browser. No text is sent to external servers or LLM models.