KRAG | I Built the World's First 100% Private RAG Platform
Saurabh Jain
Published
KRAG: The World’s First 100% Serverless & Private RAG Platform
Live Architecture Breakdown:
Source Code: GitHub Repository
📌 Project Overview
The greatest bottleneck with enterprise AI today is the tradeoff between data privacy and decent results; companies are forced to send their intellectual property to external foundational models. To solve this, I engineered and open-sourced KRAG under the GPL3 license. It is a fully serverless, locally-hosted Retrieval-Augmented Generation (RAG) platform that guarantees zero data leakage while delivering state-of-the-art multi-modal performance.
🏗️ Core Architecture & Technical Stack
Unlike standard wrapper APIs, KRAG is built on a highly optimized, custom multi-modal pipeline designed for maximum security and zero idle costs.
- Serverless Compute Engine: The entire heavy lifting runs on Modal serverless GPUs. The infrastructure ensures you only pay for active execution time, completely eliminating expensive idle server costs.
- Advanced Multi-Modal Parsing: The pipeline utilizes the Marker PDF parser to accurately extract dense document content into Markdown, heavily outperforming basic parsers. Furthermore, it integrates Florence-2 for high-fidelity image summarization, ensuring the RAG agent contextualizes visual data natively.
- Precision Retrieval & Reranking: Implements parent-child chunking combined with BGE-M3 embeddings. The retrieval pipeline optimizes for vector and keyword search, passing results through an mxbai reranker to guarantee only the highest quality chunks reach the citation extractor.
- Sliding Window Memory: Maintains an 8,000-token context window, dynamically preserving 4,000 tokens exactly as they are while summarizing the remaining 4,000 to maintain deep conversational context without blowing up compute.
🔒 Enterprise-Grade Security
Security is baked into the foundation. The platform utilizes 3-tier encryption, ensuring that embeddings are inherently encrypted at rest. With encryption toggled on, all parsed data saved to the database is completely secured, keeping you as the absolute master of your own proprietary data.
Engineered to push the limits of automated, secure retrieval. I write manual orchestrating layers—no black boxes.