A lightweight RAG chunking and preprocessing library
Project description
ragchunker
A modular Python package for Retrieval-Augmented Generation (RAG) preprocessing. It supports:
- File Ingestion: Load documents from various formats (TXT, PDF, DOCX, PPTX, images with OCR, audio with Whisper, CSV/Excel/Parquet, HTML, JSON, ZIP/TAR).
- Chunking: Split documents into chunks using fixed-length, semantic, or recursive strategies.
- Provenance: Track metadata, checksums, and token counts for chunks.
- Embeddings: Generate embeddings using Sentence-Transformers or OpenAI.
- Storage: Save chunks and embeddings to JSONL, Parquet, SQLite, NumPy, or FAISS; optional integration with Pinecone or ChromaDB.
Installation
Install the core package:
pip install ragchunker
For Testing:
from ragchunker.rag_pipeline import run_rag_pipeline
result = run_rag_pipeline(
data_dir="data", # Folder with your PDFs, docs, or txt files
output_dir="output", # Where JSONL, Chunks and embeddings will be saved
chunk_strategy="semantic", # or "fixed", "recursive"
chunk_size=800,
overlap=100,
embed_model="all-MiniLM-L6-v2", # or any other
embed_provider="sentence-transformers",
openai_api_key=None # or "sk-your-openai-key" if using OpenAI
)
print("\n✅ Pipeline executed successfully!")
result = run_rag_pipeline(
data_dir="data", # Folder with your PDFs, docs, or txt files
output_dir="output", # Where JSONL, Chunks and embeddings will be saved
chunk_strategy="semantic", # or "fixed", "recursive"
chunk_size=800,
overlap=100,
embed_model="text-embedding-3-small", # or any other
embed_provider="openai",
openai_api_key="" # or "sk-your-openai-key" if using OpenAI
)
print("\n✅ Pipeline executed successfully!")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ragchunker-0.1.1.tar.gz
(24.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragchunker-0.1.1.tar.gz.
File metadata
- Download URL: ragchunker-0.1.1.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec9fc46620a709c05c28bcd0e0f5199252e635ba0762ff77ebbf64b1d2432619
|
|
| MD5 |
046ccc489dce90d5b2a405e1baee46f3
|
|
| BLAKE2b-256 |
a98ffc0c962747f3ee52689675ae3fe4e1802b343ed08e06068e84f79491b183
|
File details
Details for the file ragchunker-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ragchunker-0.1.1-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1c0d53731a3dc61058179e927e56107727ae6868dc7240d1ec8354ea3089974
|
|
| MD5 |
7a700897eba92f96a156ff0ee3442b06
|
|
| BLAKE2b-256 |
0b20bcb9e2bba76c6332a59a2262dea63c13af006ac9d64d927a5398e3595146
|