Text Chunker

v0.1.0Added Sep 26, 2026Sample data

Recursive text splitter for RAG. Splits documents on paragraph, sentence and word boundaries into chunks of a target size, with overlap.

Sample data. These figures are placeholders, not measurements.

cargo install kura-rs
kura add text-chunker

Copies 2 source files into your project. You own the code from then on.

If another tool already installs a kura command, run cargo install kura-rs --bin kura-rs and use kura-rs add instead.

use crate::parts::text_chunker::Chunker;

let chunker = Chunker::new(1_000).overlap(200);

for chunk in chunker.split(&document) {
    index.add(chunk.text, chunk.range);
}

Verification

Sample data

Checked against langchain-text-splitters 0.3.8 (Python) using differential testing: the same inputs go to both implementations and the outputs are compared.

Reference
langchain-text-splitters
Python 0.3.8
Test cases
2,400
Differential testing
Passed
2,400 / 2,400
All cases match
Last run
Sep 26, 2026
UTC

These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.

Benchmarks

Sample data

kura-rs (Rust) against langchain-text-splitters across input sizes. Faster at every measured input size, up to 26× faster.

These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.

kura-rs (Rust)langchain-text-splitters
Wall time per run (lower is better).
Show data table
Input sizekura-rs (Rust)langchain-text-splittersSpeedup
10.08 ms0.9 ms11×
100.4 ms6.2 ms16×
1003.1 ms71 ms23×
1,00029 ms720 ms25×
10,000290 ms7.4 s26×

Files

  • parts/text_chunker/mod.rs
  • parts/text_chunker/boundaries.rs

Crate dependencies