Skip to main content

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.2.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragchunker-0.1.2-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file ragchunker-0.1.2.tar.gz.

File metadata

  • Download URL: ragchunker-0.1.2.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for ragchunker-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bc2a16681ad8d26b691043304b58e1228374f0fdd3747907defd0621485c8bf0
MD5 88c406602225cd95207b1a6e5badb8c8
BLAKE2b-256 beb7e2576e8e65277264d07c45f90dfebfa19ac294c74dbceeeab06c54f92360

See more details on using hashes here.

File details

Details for the file ragchunker-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ragchunker-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for ragchunker-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d32e102274aa81f560275f0beec98d733f2633553eb3cd00f7b5509b1afe94e6
MD5 d5af15b519cdc113e0c6e27605c6df9f
BLAKE2b-256 28ad030bde6e35abdcb988a4dd33f200470855bb76005080c8554aa82c8e1aec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page