Skip to main content

Data preprocessing library for Retrieval-Augmented Generation (RAG) systems.

Project description

Klovis Logo

The framework for unified document processing pipelines.

MIT License PyPI Version Build

Klovis is a modular framework for loading, cleaning, chunking and transforming heterogeneous documents for Retrieval-Augmented Generation pipelines. It provides consistent abstractions and production-ready components so that developers can build robust data ingestion workflows without dealing with low-level parsing or text normalization details.

pip install klovis

Documentation:

  • Official documentation: incoming
  • API reference: incoming

Discussions: Community channels will be published soon.

Why use Klovis?

Klovis provides a structured approach to transforming unstructured data into RAG-ready chunks. It helps developers build reliable preprocessing pipelines using standardized modules for each stage of document handling.

Use Klovis for:

  • Consistent document ingestion. Load text, HTML, JSON, PDF, or an entire directory tree using a unified API. Integrations preserve metadata and ensure predictable output formats across sources.
  • Robust text cleaning. Apply standardized cleaning pipelines including HTML stripping, Unicode normalization, emoji removal, and whitespace correction. Each cleaner is modular and composable.
  • Flexible chunking strategies. Split documents using Markdown headings, character windows, paragraphs or other strategies. Merge chunks intelligently while respecting size constraints.
  • Structured transformations. Convert processed chunks into Markdown or custom output structures for storage, indexing or model ingestion.
  • Extensibility. Every module in Klovis inherits from a base abstraction, allowing developers to extend or replace behaviors with minimal friction.
  • Reproducible pipelines. Implement deterministic preprocessing flows that remain stable across formats and document structures.

Klovis ecosystem

Although Klovis can be used as a standalone preprocessing framework, it integrates naturally with downstream components in a RAG workflow.

Pair Klovis with:

  • Vector databases such as FAISS, Weaviate or Chroma for chunk storage.
  • Embedding models for encoding processed text.
  • LLM frameworks for querying indexed content.
  • Orchestration tools for pipeline automation.

Klovis focuses exclusively on document ingestion, empowering other layers of the stack with clean, structured and consistent input.

Installation

pip install klovis

Or with Poetry:

poetry add klovis

Quick Start

from klovis.loaders import DirectoryLoader
from klovis.cleaning import HTMLCleaner, TextCleaner
from klovis.chunking import MarkdownChunker
from klovis.transforming import MarkdownTransformer

loader = DirectoryLoader(path="data/", recursive=True)
documents = loader.load()

cleaner = HTMLCleaner()
documents = cleaner.clean(documents)

chunker = MarkdownChunker(max_chunk_size=1200)
chunks = chunker.chunk(documents)

transformer = MarkdownTransformer()
output = transformer.transform(chunks)

Project structure

klovis/
    base/                 Base interfaces for loaders, cleaners, chunkers, transformers
    loaders/              Format-specific document loaders
    cleaning/             Cleaning and normalization utilities
    chunking/             Document chunking strategies
    transforming/         Output formatting and transformation modules
    models/               Core data structures for documents and chunks
    utils/                Logging and shared helpers
    tests/                Test suite

Running tests

pytest

Contributing

Contributions are welcome. To contribute:

  1. Fork the repository.
  2. Create a feature branch.
  3. Implement your changes and update or add tests.
  4. Submit a pull request with a clear explanation of the modification.

License

This project is released under the MIT License.

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

klovis-0.1.0.tar.gz (166.0 kB view details)

Uploaded Source

Built Distribution

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

klovis-0.1.0-py3-none-any.whl (206.1 kB view details)

Uploaded Python 3

File details

Details for the file klovis-0.1.0.tar.gz.

File metadata

  • Download URL: klovis-0.1.0.tar.gz
  • Upload date:
  • Size: 166.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.5.0-1027-oem

File hashes

Hashes for klovis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa775cabc93c06e80e9bee70f87f4aed1205dd488b52970bdb4fb9f706cb360e
MD5 d74720dbcf9f4474db6093b16b8d022e
BLAKE2b-256 d5495e3f45387dc34b6a44e6c45af275bda68a52a200f8b35ed28b6d9e30146f

See more details on using hashes here.

File details

Details for the file klovis-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: klovis-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 206.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.5.0-1027-oem

File hashes

Hashes for klovis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c24dcd26d9721ff6cb77a512587743a35c812f4dfeb5f28dbe32b6513571916b
MD5 7241af21d7ec6ca0c6315a53db05a30f
BLAKE2b-256 7246b82d083b0b38eb4a46711598e848ac2d517f8248e4f970c80fd71360b846

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