SovereignRAG is a fully local, zero-egress vulnerability assessment system designed for regulated and air-gapped environments where sensitive network telemetry cannot be transmitted to external cloud services.
The project combines:
- Nmap-based network scanning
- Parent-Child Retrieval-Augmented Generation (RAG)
- Local Large Language Models (LLMs)
- ChromaDB vector retrieval
- Cross-Encoder reranking
- OWASP Top 10 knowledge grounding
All inference executes locally using quantized open-source models, ensuring compliance with data sovereignty requirements such as HIPAA, PCI-DSS, and NIST SP 800-171.
Title: Empirical Evaluation of Retrieval-Augmented Generation for Sovereign Vulnerability Assessment in Air-Gapped Environments
Authors:
- Kislay Mishra
- Priyanshu Bajpai
- Madhav Goyal
- Neha Gupta
- No cloud APIs
- No external network calls
- Fully local inference
- 2,000-character parent documents
- 400-character child chunks
- 50-character overlap
- ChromaDB vector storage
- Dense vector retrieval
- Top-k candidate selection
- Cross-Encoder reranking
- Parent document expansion
Supported models:
- Llama 3 8B (Q4)
- Gemma 2 9B (Q4)
Served through Ollama.
- OWASP Top 10 (2025)
- NVD CVE Database
- High-severity vulnerabilities (CVSS ≥ 8)
Nmap Scan
│
▼
XML Parser
│
▼
FastAPI Service
│
▼
Parent-Child RAG
│
┌──┴─────────┐
│ ChromaDB │
│ Reranker │
└──┬─────────┘
│
▼
Local LLM
│
▼
Remediation Report
| Component | Configuration |
|---|---|
| Embedding Model | all-MiniLM-L6-v2 |
| Chunk Size | 400 |
| Overlap | 50 |
| Retrieval | Top-15 |
| Reranker | ms-marco-MiniLM-L-6-v2 |
| Final Context | Top-3 Parents |
- Hit Rate@3: 68.57%
- MRR: 0.4333
- Cross-Encoder reranking produced the largest improvement.
- Domain-specific embeddings underperformed general embeddings.
- Long-context loading caused complete attention collapse at ~32k tokens.
- Context windows above 8k tokens significantly increased latency.
- Python
- FastAPI
- LangChain
- ChromaDB
- Sentence Transformers
- Nmap
- Ollama
- Llama 3 8B
- Gemma 2 9B
- RSCORE Framework
- Hit Rate@3
- Mean Reciprocal Rank (MRR)
git clone https://github.com/your-username/SovereignRAG.git
cd SovereignRAGpython -m venv venv
source venv/bin/activate
# Linux/Mac
venv\Scripts\activate
# Windowspip install -r requirements.txtollama pull llama3:8b
ollama pull gemma2:9buvicorn app.main:app --reloadnmap -sV target-ip -oX scan.xmlUpload the generated XML to the API endpoint for remediation analysis.
- MITRE ATT&CK integration
- Vendor advisory ingestion
- Multi-hardware benchmarking
- Improved RSCORE validation
- Agentic remediation workflows
If you use this work, please cite:
@article{sovereignrag2026,
title={Empirical Evaluation of Retrieval-Augmented Generation for Sovereign Vulnerability Assessment in Air-Gapped Environments},
author={Mishra, Kislay and Bajpai, Priyanshu and Goyal, Madhav and Gupta, Neha},
year={2026}
}MIT License