Chonkie

feyninc/chonkie β€” a lightweight, fast chunking library for RAG pipelines (mascot: a pygmy hippo). It covers the β€œsplit source text into good retrieval units” step end-to-end: fetch β†’ CHONK β†’ refine β†’ embed β†’ ship to your vector DB. The pitch is no-bloat and β€œjust works”: small install, quick chunking, and 32+ integrations with embedders and vector stores out of the box, across 56 languages.

In the LLM App Engineering Stack this is the chunking lane β€” the piece between document parsing (Marker for files, Crawl4AI for web) and vector storage (Qdrant). Chunk quality is one of the biggest hidden levers on retrieval quality, which is why it gets its own tool rather than a hand-rolled text.split().

Description

Download or use

pip install chonkie            # minimal
pip install "chonkie[all]"     # all chunkers + integrations
from chonkie import SemanticChunker
 
chunker = SemanticChunker()          # groups by meaning, not fixed size
chunks = chunker.chunk(long_text)
# self-host the API server
pip install "chonkie[api,semantic,code,catsu]"
docker compose up

πŸ—’οΈ Description

🧩 Chunkers

A family of strategies so you can match the chunker to the content:

  • Token / Sentence / Recursive β€” classic size- and structure-based splitting.
  • Semantic β€” groups by embedding similarity so chunks are meaning-coherent.
  • Code β€” structure-aware splitting for source files.
  • Late / SDPM / Neural β€” advanced strategies for higher retrieval fidelity.

🧩 Pipeline extras

  • Refinery β€” post-chunk overlap/merge refinement.
  • Embeddings + porters β€” embed and ship straight into vector DBs.
  • Cloud or local β€” run in-process, as a self-hosted API server, or on Chonkie Cloud.
  • AI agent skills & plugins + published benchmarks for chunker comparison.

✍️ Reasoning for

  • Retrieval quality lever β€” bad chunk boundaries wreck recall; a semantic chunker often beats fixed-size for the same embedding model. Cheap upgrade to any RAG stack (e.g. over Brain via LightRAG).
  • Light footprint β€” small dependency surface vs pulling a whole framework just to split text.
  • Vector-DB agnostic β€” ships to Qdrant and 30+ others without custom glue.

Weak points: it’s one link in the chain (still need parsing + a vector DB + a retriever); β€œbest” chunker is workload-dependent, so expect to benchmark; semantic chunking costs extra embedding calls at ingest.

Alternatives considered

  • LangChain / LlamaIndex text splitters β€” bundled with the big frameworks; heavier, less specialised.
  • Unstructured.io chunking β€” tied to its ETL pipeline.
  • PageIndex β€” sidesteps chunking entirely with a vectorless hierarchical index; different philosophy for long docs.
  • RecursiveCharacterTextSplitter by hand β€” fine baseline, but you leave semantic/structure-aware gains on the table.

πŸ”— Resources


Template: tool