What is CHOMP?
CHOMP (CHOnkie’s Multi-step Pipeline) is our standardized architecture for document processing:1
Fetcher
Retrieve raw data from files, APIs, or databases
2
Chef
Preprocess and transform raw data into Documents
3
Chunker
Split documents into manageable chunks
4
Refinery (Optional)
Post-process and enhance chunks
5
Porter/Handshake (Optional)
Export or store chunks
Pipelines automatically reorder components to follow CHOMP, so you can add them in any order.
Quick Start
Single File Processing
Directory Processing
Process multiple files at once:Direct Text Input
Skip the fetcher and provide text directly:Asynchronous Execution
For high-throughput applications (e.g., web servers, batch processing), usearun():
Pipeline Methods
fetch_from()
Fetch data from a source:process_with()
Process data with a chef:chunk_with()
Chunk documents (required):refine_with()
Refine chunks (optional, can chain multiple):export_with()
Export chunks to formats (optional):store_in()
Store in vector databases (optional):Advanced Examples
RAG Knowledge Base
Build a complete RAG ingestion pipeline:Semantic Search Pipeline
Process documents with embeddings for search:Code Documentation
Process code with specialized chunking:Markdown Processing
Handle markdown with table and code awareness:Recipe-Based Pipelines
Load pre-configured pipelines from the Chonkie Hub:Recipes are stored in the chonkie-ai/recipes repository.
Best Practices
Always specify chunk_size
Always specify chunk_size
Explicitly set
chunk_size for predictable behavior:Match chunkers to content type
Match chunkers to content type
Choose chunkers appropriate for your content:
Use refineries for RAG applications
Use refineries for RAG applications
Add overlap refineries for better retrieval context:
Filter extensions in directory mode
Filter extensions in directory mode
Always specify file extensions to avoid unwanted files:
Chain refineries for complex processing
Chain refineries for complex processing
Multiple refineries can be chained:
Pipeline Validation
Pipelines validate configuration before execution: ✅ Must have: At least one chunker ✅ Must have: Fetcher OR text input viarun(texts=...)
❌ Cannot have: Multiple chefs (only one allowed)
Return Values
Pipeline behavior depends on input:- Single file/text: Returns
Document - Multiple files/texts: Returns
list[Document]
Error Handling
Pipelines provide clear error messages:Component Overview
Available Components
Explore each component type:Fetchers
Connect to data sources (files, APIs, databases)
Chefs
Preprocess text, markdown, tables, etc.
Chunkers
Split text with various strategies
Refineries
Add overlap, embeddings, and more
Porters
Export to JSON, Datasets, etc.
Handshakes
Store in Chroma, Qdrant, Pinecone, etc.
What’s Next?
1
Explore Fetchers
Learn how to connect different data sources in Fetchers
2
Choose Your Chunker
Find the right chunking strategy in Chunkers
3
Enhance with Refineries
Improve chunk quality in Refineries
4
Store Your Chunks
Ingest into vector databases with Handshakes
