Skip to main content

ragkit-local

A modular, pip-installable reliability layer for Retrieval-Augmented Generation (RAG) pipelines.

Why ragkit?

  • 100% Fully Local: Requires zero external API calls, zero hosted LLM inference, and runs completely offline.
  • Privacy-First: No data leaves your machine; uses local NLP rules and lightweight, open-source sentence-transformers NLI models.
  • Framework-Agnostic: Plugs directly into LangChain, LlamaIndex, or any custom pythonic RAG pipeline.
  • Import-Only-What-You-Need: Extremely fast import times with lazy loading of all underlying model dependencies on first invocation.

Installation

# Install the library in editable/dev mode or directly
pip install ragkit-local

# Download the required local English spaCy pipeline
python -m spacy download en_core_web_sm

Quickstart Examples

1. Query Decomposition

Split compound queries into atomic questions before retrieval.

from ragkit import QueryDecomposer

decomposer = QueryDecomposer()
sub_questions = decomposer.decompose("What is climate change and how does it affect oceans?")
print(sub_questions)
# Output: ['What is climate change?', 'How does it affect oceans?']

2. Confidence Scoring (Hallucination Detection)

Verify if the generated answer is supported by the retrieved document chunks.

from ragkit import ConfidenceScorer

scorer = ConfidenceScorer()  # Uses tiny 100MB model by default
chunks = ["Photosynthesis uses sunlight to convert water and CO2 into oxygen and glucose."]
answer = "Plants convert carbon dioxide and water into glucose using sunlight. They also produce helium."

result = scorer.score(answer, chunks)
print(f"Score: {result['score']}/100 | Verdict: {result['verdict']}")
# Output: Score: 50/100 | Verdict: partially_grounded
print("Reasoning:", result["reasoning"])

# For better accuracy, use the larger model:
# scorer = ConfidenceScorer(model_name="cross-encoder/nli-deberta-v3-base")

Metadata

Release files for ragkit-local 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ragkit-local 0.1.0
File Size Uploaded Provenance Actions
ragkit_local-0.1.0.tar.gz 10.1 kB Without provenance Details for ragkit_local-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ragkit-local 0.1.0
File Interpreter ABI Platform Actions
ragkit_local-0.1.0-py3-none-any.whl Python 3 none any Details for ragkit_local-0.1.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / ragkit_local-0.1.0.tar.gz

Download URL ragkit_local-0.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9b2cae03b29a5dbb3b302d4e368a7f6284b6ce195bc0fbabf56706dc0e744753
BLAKE2b-256 checksum
How to use checksums
2665b0bb21e7a6130d39d830ed8564d54bf849fef506515eae40e3e79bac5dfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ragkit_local-0.1.0-py3-none-any.whl

Download URL ragkit_local-0.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbe537a9aff1a4e22e3cbe35965a9a924ea5837db25c31ad458f13a267159ce3
BLAKE2b-256 checksum
How to use checksums
c473b27808ecc98e7d53fff6c58452819b1a7f69c0c345bcb483cdf98d131719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for ragkit-local 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page