Chunking Strategy: Sliding Window

Overview

RAGv2 uses a “Sliding Window” strategy. This prevents text from being split awkwardly mid-sentence. It moves back a defined “overlap” amount before starting the next chunk.

Flow / Behavior

graph TD
    Text["📜 Raw Document Text"] --> Parent["✂️ Split into Parent Chunks"]
    Parent --> Child["✂️ Split Parents into Child Chunks"]
    Child --> Vector["🔢 Convert Children to Vectors"]

Configuration

ParameterTypeDefaultDescription
PARENT_CHUNK_SIZEint2000Context given to the AI. Contains full paragraphs.
PARENT_OVERLAPint250Overlap for Parents to ensure smooth transitions.
CHILD_CHUNK_SIZEint250Specific target size for FAISS vectors.
CHILD_OVERLAPint75Overlap for Children.
TOP_Kint4Number of Parent chunks retrieved.

Last Updated: 2026-05-01