Package #5 in my small open-source series, and the first one with a direct RAG/AI angle.
Every RAG pipeline starts the same way: take a long document, split it into pieces small enough to embed, and hope the split points don't wreck the meaning inside each piece. A naive fixed-size split has no idea where a sentence or paragraph actually ends, so it happily cuts a chunk in half mid-thought - and a chunk that starts "...and that's why the deadline was moved" with no antecedent for "that" embeds as a blurry average of two unrelated ideas. It retrieves worse for both.
chunk-lite makes the boundary-aware version the default.
import { chunkText } from 'chunk-lite';
const chunks = chunkText(longDocument, {








