Skip to main content

Krionis Pipeline - multimodal RAG pipeline for low-compute, local, real-world deployment

Project description

Krionis Pipeline 1.0

Krionis Pipeline is a local-first Retrieval-Augmented Generation platform for controlled, auditable AI workflows. It is designed for secure and airgapped environments where teams need API-driven retrieval, human review controls, traceability, and a practical operator experience without depending on cloud infrastructure.

Backward compatibility is preserved:

  • import rag_llm_api_pipeline still works
  • rag-cli still works
  • krionis-cli is available as the branded CLI entry point

What Is New In 1.0

  • Mandatory HITL gating for flagged outputs
  • Review queue persistence with original and final responses stored separately
  • Append-only audit tracing across query, retrieval, generation, and signoff
  • SQLite-backed result metadata for Good and Bad feedback plus review outcomes
  • API-driven index visibility and manual cache rebuild operations
  • Split operator UX for control, telemetry, runtime, configuration, records, and review
  • CPU-friendly quantized default model profile for local deployment
  • Isolated generation worker to keep the API responsive during model load or failure
  • Docker packaging for integrated platform deployment
  • Expanded API documentation for custom frontend development

Core Capabilities

🔍 Retrieval-Augmented Generation (RAG)

  • FAISS/HNSW vector indices
  • SentenceTransformers embeddings

🧠 Flexible LLM Integration

  • HuggingFace open-source models (Qwen, Mistral, LLaMA, etc.)
  • Mixed precision: fp32, fp16, bfloat16
  • Dynamic model/device/precision switching via YAML

🔧 1-line YAML Configuration

  • System-specific documents
  • Embedding & generation model selection
  • CPU/GPU inference toggle
  • Index rebuilding, token limits, chunking

📂 Multimodal Input Support

  • PDFs
  • Plain text
  • Images (OCR via Tesseract)
  • Audio (.wav)
  • Video (.mp4)

💻 Multiple Interfaces

  • CLI (rag-cli / krionis-cli) for single-line querying
  • FastAPI-powered REST API for local serving
  • Lightweight HTML Web UI for interactive search

Quickstart

Required Setup

Before starting the platform, make sure your working directory contains:

  • config/system.yaml
  • data/manuals/

Install:

pip install krionis-pipeline

Build the retrieval index and start the API:

krionis-cli build-index --system TestSystem
uvicorn rag_llm_api_pipeline.api.server:app --host 127.0.0.1 --port 8000

Open:

  • http://127.0.0.1:8000/ for the operator console
  • http://127.0.0.1:8000/api/docs for the API reference
  • http://127.0.0.1:8000/ui/reviews for the review queue

Installation

pip install krionis-pipeline

🛠️ Setup Instructions (Windows + Anaconda)

1. Create Python Environment

conda create -n rag_env python=3.10
conda activate rag_env

2. Install Dependencies

Via Conda (system-level tools):

conda install -c conda-forge ffmpeg pytesseract pyaudio

Via Pip (Python packages):

pip install -r requirements.txt

Ensure Tesseract is installed and in your system PATH. You can get it from https://github.com/tesseract-ocr/tesseract.


🚀 Usage

Please review the quickstart guide.


🐧 Setup Instructions (Linux)

1. Create Python Environment

python3 -m venv rag_env
source rag_env/bin/activate

Or with conda:

conda create -n rag_env python=3.10
conda activate rag_env

2. Install System Dependencies

sudo apt update
sudo apt install -y ffmpeg tesseract-ocr libpulse-dev portaudio19-dev

Optional: install language packs for OCR (e.g., tesseract-ocr-eng).

3. Install Python Packages

pip install -r requirements.txt

🔁 Running the Application on Linux

CLI

python cli/main.py --system TestSystem --question "What is the restart sequence for this machine?"

API Server

uvicorn rag_llm_api_pipeline.api.server:app --host 0.0.0.0 --port 8000

cURL Query

bash curl -X POST http://localhost:8000/query
-H "Content-Type: application/json"
-d '{"system": "TestSystem", "question": "What does error E204 indicate?"}'


## 📚 How it Works

1. **Index Building**:
   - Files are parsed using `loader.py`.
   - Text chunks are embedded with MiniLM.
   - FAISS index stores embeddings for fast similarity search.

2. **Query Execution**:
   - User provides a natural language question.
   - Relevant text chunks are retrieved from the index.
   - LLM generates an answer based on retrieved context.

---

## 🧠 Model Info

- All models are open-source and run offline.

> You can replace with any local-compatible Hugging Face model.

---

## 🔐 Security & Offline Use

- No cloud or external dependencies required after initial setup.
- Ideal for OT environments.
- All processing is local: embeddings, LLM inference, and data storage.

---

## 📜 License

MIT License

---

## 📧 Contact

For issues, improvements, or contributions, please open an issue or PR.

## Documentation

The repository includes a documentation portal scaffold for developers building on top of the Krionis API.

- Interactive API docs: `/api/docs`
- ReDoc reference: `/api/reference`
- Static docs source: `docs/`
- Docs build config: `mkdocs.yml`

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

krionis_pipeline-1.1.0.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

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

krionis_pipeline-1.1.0-py3-none-any.whl (95.5 kB view details)

Uploaded Python 3

File details

Details for the file krionis_pipeline-1.1.0.tar.gz.

File metadata

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

File hashes

Hashes for krionis_pipeline-1.1.0.tar.gz
Algorithm Hash digest
SHA256 640faf917ca5c47e1644b2d6045b79da480e4f5bc8de6ffa97f941df6d8b50e2
MD5 19575da5de5a72dda2c58b163f087743
BLAKE2b-256 66e61f790655d3c874e2848aa164737d3debf773948503e2c4fa5c50324c89ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for krionis_pipeline-1.1.0.tar.gz:

Publisher: pypi-release.yml on pkbythebay29/krionis-platform

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

File details

Details for the file krionis_pipeline-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for krionis_pipeline-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad9fe3441e6cccdf202b0756d3d0348d9609025cd06ee9af9c83b2f0b3cb8008
MD5 4c9edbc2adc213830fbf8e1f511c58eb
BLAKE2b-256 4ff40d7da528d46d20625f813608194ffe5e5740b8193fef48a490b8b278e016

See more details on using hashes here.

Provenance

The following attestation bundles were made for krionis_pipeline-1.1.0-py3-none-any.whl:

Publisher: pypi-release.yml on pkbythebay29/krionis-platform

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