Skip to main content

Chunking Strategies

Hystersis uses intelligent chunking to break large text inputs into optimal segments for memory extraction, embedding, and retrieval.

Why Chunking Matters

Large text inputs need to be broken into smaller segments because:
  1. LLM context windows have size limits for extraction
  2. Vector embeddings work best on focused content
  3. Retrieval accuracy improves with well-scoped chunks
  4. Compression is more effective on targeted segments

Chunking Methods

Fixed-Size Chunking

Splits text into fixed-size segments with optional overlap:
Pros: Predictable sizing, simple implementation Cons: May split mid-sentence, loses semantic boundaries

Sentence-Level Chunking

Splits text at sentence boundaries:
Pros: Preserves sentence integrity, good semantic boundaries Cons: Variable chunk sizes, may be too granular

Paragraph-Level Chunking

Splits text at paragraph boundaries:
Pros: Maintains topic coherence, good for most content Cons: Very long paragraphs still need sub-chunking

Semantic Chunking

Groups related sentences into semantically coherent chunks:
Pros: Best topic coherence, preserves meaning Cons: Higher processing cost, requires embedding model

Recursive Chunking

Combines multiple strategies with fallback:
Pros: Robust for varied content, good fallback behavior Cons: More complex, variable results

Chunking Configuration

Best Practices

  1. Use semantic chunking for unstructured content (articles, transcripts)
  2. Use paragraph chunking for well-structured documents
  3. Set overlap to 10-20% for retrieval continuity
  4. Keep chunks between 200-1000 tokens for optimal embedding quality
  5. Avoid very small chunks (under 100 tokens) as they lack context

See Also