Skip to main content

Configuration

Split ogni N caratteri. Semplice e deterministico.

1002000

Input text

891 caratteri
3product chunks
297 Total tokens
297 Media chunk/character

Chunk prodotti (3)

~Token 99 396 char

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,

~Token 99 397 char

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

~Token 23 91 char

paragrafo per testi strutturati, e sliding window per massimizzare il contesto disponibile.

Guide to the 8 strategies

Comparing Chunking Strategies for the RAG Pipeline
StrategyWhen to use itForAgainst
Fixed SizePlain texts without structureDeterministic, fastCut sentences at meta'
SentenceArticles, News, Narrative TextsNon capisco la richiesta. Puoi fornire il testo da tradurre?Variable-sized chunks
ParagraphStructured documentsNatural SemanticsLong or short paragraphs
RecursiveVariable-structured mixed documentsFlexible, adaptableMore complex logic
Semantic CosineMixed-topic textsSemantically coherent chunksApproximated without actual embeddings
Sliding WindowTechnical QA on texts, maximum context.No context lostRedundancy, more called embeddings
Markdown HeaderDocumentation, READ ME, WikiRespect the Markdown hierarchyOnly for markdown texts
Token BucketToken Count ControlRespect word boundariesIgnore 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.