Skip to main content

A lightweight, zero-config local pipeline engine for AI data ingestion, semantic chunking, embeddings, and vector search.

Project description

RAGMill

PyPI CI License: MIT Python

A lightweight, zero-config local pipeline engine for AI data ingestion, semantic chunking, embeddings, and vector search.

Install

pip install ragmill[all]   # includes PDF + DOCX + embeddings support
# or
pip install ragmill        # core only (txt/md), zero dependencies

Developing locally instead? Clone the repo and use an editable install:

pip install -e ".[dev]"
pytest tests/ -v

Usage

Ingest + chunk

from ragmill import RAGEngine

engine = RAGEngine(chunk_size=500, overlap=50)
chunks = engine.execute_pipeline("./my_documents")

for chunk in chunks:
    print(chunk["metadata"]["filename"], chunk["content"][:80])

Supports .txt, .md, .log, .rst, .pdf, and .docx out of the box.

Embed + search locally

Requires the embeddings extra (pip install -e ".[embeddings]"). The model (a quantized MiniLM ONNX export, ~23MB) downloads once to ~/.cache/ragmill/models and runs fully offline after that.

from ragmill import RAGEngine
from ragmill.embeddings import EmbeddingModel
from ragmill.vector_store import VectorStore

chunks = RAGEngine().execute_pipeline("./my_documents")

model = EmbeddingModel()
vectors = model.embed([c["content"] for c in chunks])

store = VectorStore("my_documents.db")   # or VectorStore() for in-memory
store.add(chunks, vectors)

query_vector = model.embed(["how does the overlap window work?"])[0]
for result in store.search(query_vector, top_k=3):
    print(round(result["score"], 3), result["metadata"]["filename"], "->", result["content"][:80])

Filter a search to a specific file or a time window:

store.search(query_vector, top_k=3, filename="report.pdf")
store.search(query_vector, top_k=3, modified_after=1704067200.0)  # since 2024-01-01

Keep a store in sync with a folder

Re-embedding every file on every run is wasteful once a folder is large. sync_directory tracks a content hash per file and only touches what actually changed:

from ragmill.sync import sync_directory

result = sync_directory("./my_documents", engine, model, store)
print(result)  # {"added": 2, "updated": 1, "skipped": 40, "deleted": 1}

Unchanged files are skipped without re-embedding. A changed file has its old chunks replaced with new ones. A file removed from disk has its chunks removed from the store on the next sync.

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

ragmill-0.2.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

ragmill-0.2.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file ragmill-0.2.0.tar.gz.

File metadata

  • Download URL: ragmill-0.2.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ragmill-0.2.0.tar.gz
Algorithm Hash digest
SHA256 40ad83fd70ce60c5223261cad7515f4ff497f754720ad14477a8333ee4e4cb26
MD5 e702e195bbefd4bcaf758d26fcd49bd0
BLAKE2b-256 1557073d0d81b0fca09032c043ce9ca445b096cca04fc33714a70602a457fcbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragmill-0.2.0.tar.gz:

Publisher: publish.yml on Abdullahbinaqeel/RAGMill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ragmill-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ragmill-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ragmill-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e21821a28d2d8e5d848baa4938d0daec15693220726a8e24e95ed9ce90897dc
MD5 26029f193adf66c2f0bab7566fb12642
BLAKE2b-256 e4df2118e422a50ad100d9eb20576103847bf45132e1fe65bc4b690f9fe79631

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragmill-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Abdullahbinaqeel/RAGMill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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