Simple RAG and the five ways to chunk
A 20,000-line document in a 2,000-line window remembers only the last 2,000 lines. RAG is how you stop losing the rest.
The knowledge base is built once - chunk, embed, store in a vector database - and the query -> retrieve -> generate loop runs per question, unlike a custom GPT that re-reads the whole file. The storage-room analogy: one unsorted pile retrieves badly; drawers (embeddings) labelled by meaning hold files (chunks). Chunking choices: fixed length; sliding window with overlap for continuity; sentence-based; semantic, split by meaning with embeddings and recommended for ~90% of cases despite the compute; recursive, by headings then paragraphs then sentences.
Chunking is the first design decision in any RAG build and the one most people default badly.