Skip to main content

ragkitframe

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 ragkitframe

# 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 ragkitframe 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 ragkitframe 0.1.0
File Size Uploaded Provenance Actions
ragkitframe-0.1.0.tar.gz 10.1 kB Without provenance Details for ragkitframe-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.8 kB

Release files / ragkitframe-0.1.0.tar.gz

Download URL ragkitframe-0.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0691912744b8129f69d4cedfbfa4c83a231088c1039050ba52fa915e25433a5a
BLAKE2b-256 checksum
How to use checksums
7a36d022a865b54aed7697bf3c8115581bb665ffe2682179f1dd7d4fadf1384c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

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

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

Security for ragkitframe 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