Skip to main content

Privacy-first, fully offline AI document assistant secured by tiered safety guardrails

Project description

🛡️ GuardRAG

Privacy-First, Fully Offline AI Document Assistant

Secured by a Tiered Safety Guardrails System
v1.1.5 — High-Performance, Secure, and Minimalist


Python Ollama FAISS License


Upload any document. Ask anything. Get answers — entirely on your local machine.
No cloud dependencies. No API keys. No data ever leaves your device.


💡 Use Cases

GuardRAG is designed for professionals and organizations that handle sensitive data and require the power of LLMs without compromising privacy.

  • 🔒 Secure Document Analysis: Chat with confidential contracts, internal financial reports, or legal documents without uploading them to a cloud provider.
  • 🏥 Healthcare & Privacy: Analyze medical records or research data locally, ensuring compliance with privacy standards like HIPAA or GDPR through integrated PII detection.
  • 💻 Offline Research: Work on-the-go or in air-gapped environments. Once the models are downloaded, no internet connection is required.
  • 🛠️ Developer Productivity: Quickly query local documentation or large codebases (via text/PDF) using a streamlined CLI or Web interface.

⚙️ Data Sensitivity Tiers

Protect your information using our built-in safety engine:

Level Protection Scope
🟢 Public Detects jailbreaks and basic prompt injections.
🔵 Internal Adds detection for API keys, credentials, and tokens.
🟡 Confidential Protects SSNs, emails, phone numbers, and credit card info.
🔴 Restricted Strict protection for medical history, HIPAA/GDPR, and financial data.

📥 Installation

Install the package directly from PyPI:

# Recommended stable version
pip install guard-rag==1.1.5

Prerequisites

  1. Ollama: Download and install from ollama.com.
  2. Model: Pull a model to use locally (e.g., ollama pull gemma3:1b or llama3.2:1b).

🚀 Commands & Usage

GuardRAG provides a flexible CLI to interact with your documents.

1. Launch the Web Interface

Simply run the command with no arguments to start the local server and open the UI in your browser:

guard-rag

2. Chat with a Document via CLI

Start an interactive chat session directly in your terminal:

guard-rag --pdf path/to/my_document.pdf

3. Advanced Configuration

Customize the model, server, and safety levels:

guard-rag --pdf report.pdf --model llama3 --sensitivity Confidential --chunk-size 1000

📖 Available CLI Options

Argument Description Default
--pdf <file> Path to the PDF document you want to analyze. Required for CLI
--model <name> The Ollama model to use for inference. gemma3:1b
--ollama-host The URL of your Ollama server. http://localhost:11434
--sensitivity Safety level: Public, Internal, Confidential, Restricted. Internal
--chunk-size Size of document chunks for processing. 1000
--no-guardrails Disable all safety checks (not recommended). False
--help Show all available commands and flags. -

🛠️ Quick Example Session

# Start a confidential session with a specific model
guard-rag --pdf Q4_Internal_Report.pdf --model llama3 --sensitivity Confidential

# Chatbot: [Q4_Internal_Report.pdf Loaded] How can I help you?
# You: What were the total earnings mentioned in the summary?
# Chatbot: Based on the document, the total earnings for Q4 were $2.4M...

Built with ❤️ by Sowmiyan S

GitHub · PyPI · Documentation

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

guard_rag-1.1.5.tar.gz (52.5 kB view details)

Uploaded Source

Built Distribution

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

guard_rag-1.1.5-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file guard_rag-1.1.5.tar.gz.

File metadata

  • Download URL: guard_rag-1.1.5.tar.gz
  • Upload date:
  • Size: 52.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for guard_rag-1.1.5.tar.gz
Algorithm Hash digest
SHA256 9c5d3f73ef5277d049aa9dd7b3835a2d046ed6981c5ed3a17566f4e9656f06a0
MD5 43b57c5063603fb3178e03c8c1842d6f
BLAKE2b-256 506de49fb9e788e7b11b09f4635578ddef5097b0f2fc997a55b81d9e5bf8ee51

See more details on using hashes here.

File details

Details for the file guard_rag-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: guard_rag-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for guard_rag-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 27cae33d5ef160ecb76a98554e5a1468f93da39fe056c6af1dd31db4f5a245d3
MD5 36397706e2384a5b3f1f4d75bc1c9850
BLAKE2b-256 c1623b7cf2c2c7d06e244f5d942f9b3a9caa4b522162a7921bfd5831305e59ae

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