Systems RAG is an experimental, memory-safe cybersecurity daemon that bridges the gap between low-level Linux kernel observability and Generative AI.
By utilizing eBPF to trace system calls with zero overhead, and local Large Language Models (LLMs) to analyze behavior, this tool acts as an autonomous, localized threat-hunting agent.
This project is built on a highly optimized, air-gapped pipeline:
- Kernel Tracing (C/eBPF): Hooks directly into the Linux
execvetracepoint to capture process executions before they hit user space. - High-Speed IPC (Rust/Aya): Streams kernel telemetry to a user-space daemon via asynchronous Ring Buffers.
- Vector Embeddings (ONNX/FastEmbed): Converts raw OS logs into mathematical vectors (Cosine Similarity) to detect deviations from a normal system baseline.
- Local LLM Analysis: Feeds mathematical anomalies into a local LLM to generate professional, actionable security reports.
- Unix Domain Sockets: Provides a secure, lightning-fast CLI interface to query the background daemon.
- Systems Programming: Rust, C
- Kernel Observability: eBPF, Aya Framework
- AI/Machine Learning: ONNX Runtime, FastEmbed, Ollama
- Concurrency & Networking: Tokio (Async Rust), Reqwest
- A Linux environment (required for eBPF)
clangandllvminstalled for compiling BPF bytecode- Rust (
cargo) installed - Ollama running locally with the Llama 3 model (
ollama run llama3)
The project uses a unified Makefile to compile both the C kernel bytecode and the Rust workspace.
git clone https://github.com/kashbix/systems-rag.git
cd systems-rag
make build
The daemon requires root privileges to inject the eBPF program into the kernel. It runs as a background engine, listening on /tmp/sysrag.sock.
sudo ./target/release/sysrag-daemon
Open a new terminal and use the CLI to instantly analyze the most recent anomaly caught by the kernel. The CLI features a custom-built, retro-terminal UI for data visualization.
sudo ./target/release/sysrag-cli investigate
Or, check the general health of the system:
sudo ./target/release/sysrag-cli status
Because this tool relies on local LLMs and local Vector Databases, no kernel telemetry ever leaves your machine. Your OS logs are analyzed entirely air-gapped from the cloud, ensuring strict compliance and data privacy.
This is an active experimental architecture. Current roadmap items include:
- Automated Quarantine: Automatically issue
SIGKILLto high-threat PIDs based on AI consensus. - Persistence Layer: Integrate SQLite or SurrealDB to maintain anomaly history across system reboots.
- Network Tracing: Extend eBPF hooks to
sys_enter_connectto correlate process execution with outbound IP connections.
Please support this project by contributing and architectural reviews are highly encouraged.