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.0.2.tar.gz (84.3 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.0.2-py3-none-any.whl (91.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: krionis_pipeline-1.0.2.tar.gz
  • Upload date:
  • Size: 84.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for krionis_pipeline-1.0.2.tar.gz
Algorithm Hash digest
SHA256 56a990a2b25dea250704ab17546dd50d3de86cbe4ad9304a45478f44aa43fc74
MD5 f6edc4e593c590cca45d11fa37b12ad6
BLAKE2b-256 066407be61e51621f3a1e383cd2a5aaab52c0a4f44ccb27ce5c964d40f3184fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for krionis_pipeline-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 248fc36a5f4774d0fc3d7d4e77ba64231f6c121c1d01f7ad04a0dcea21f4b51b
MD5 72d8b2f4e061c5c6c0fa86b278c2e69b
BLAKE2b-256 76abbc02f0de527c15c6179b630df3058b1a96e7b108abee9b6757bddedc58f2

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