- Basic chunking strategies
Fixed-size character, character + overlap, fixed-size word, greedy word, sentence, paragraph, and recursive. - Interactive visualizer
Paste any text, tune each method's parameters with per-card sliders, and watch the chunks update live. - Zero dependencies
Python stdlib only; the web app is a single static page that deploys anywhere.
| # | Function | Splits by |
|---|---|---|
| 1 | basic_chunk |
a fixed number of characters |
| 2 | overlap_chunks |
characters, with overlap between chunks |
| 3 | word_chunks |
a fixed number of words |
| 4 | greedy_word_chunks |
words, greedily filled up to a char budget |
| 5 | sentence_chunks |
whole sentences |
| 6 | paragraph_chunks |
blank-line paragraphs |
| 7 | recursive_chunks |
the largest separator first, recursing down |
Try it online: https://januaryofmine.github.io/rag-bites/
Run the visualizer locally (Python stdlib, no install):
git clone https://github.com/januaryofmine/rag-bites
cd rag-bites
python -m http.server 8000 # -> http://127.0.0.1:8000Use the chunkers directly in Python:
import chunk
text = "Your document text..."
print(chunk.recursive_chunks(text, max_chars=150))| File | Role |
|---|---|
chunk.py |
the 7 chunkers, pure Python (reference) |
chunk.js |
1:1 JS port that powers the static demo |
index.html |
the visualizer UI |
app.py |
original Python /api/chunk server (kept for reference) |