Private AI Investigation Agent
SentinelRAG is a local-first desktop investigation workbench that turns private, multimodal evidence into cited findings, correlated entities, an incident timeline, an explainable risk assessment, and an exportable report.
The application is designed to keep sensitive evidence on the investigator's machine. Deterministic parsers and security rules establish the facts; local retrieval and local language models help connect, explain, and report them.
Most AI assistants summarize one document at a time and require users to trust an opaque answer. SentinelRAG is built for investigations:
- Local and offline by default
- Evidence-level provenance and integrity hashes
- Format-aware parsing and hierarchical chunking
- Dense, sparse, and metadata-filtered hybrid retrieval
- Clickable citations for every generated conclusion
- Cross-evidence indicator correlation
- Deterministic event timeline and risk factors
- Explicit separation of facts, inferences, and recommendations
- Prompt-injection-resistant treatment of evidence and web content
The first vertical slice is intentionally focused:
- Create an investigation case.
- Import text, email, PDF, screenshot, or log evidence.
- Extract text, metadata, indicators, and timestamps.
- Chunk and index the evidence locally.
- Ask an investigation question.
- Retrieve and rerank supporting evidence.
- Display a cited answer, timeline, risk factors, and report.
Live threat feeds, unrestricted web crawling, multi-user authentication, and distributed services are roadmap features, not MVP dependencies.
We are building a privacy-first AI investigation agent for phishing, scams, and small security incidents. The product accepts messy evidence such as emails, logs, screenshots, PDFs, notes, and curated security references. It extracts facts deterministically, indexes them with a serious RAG pipeline, retrieves the right evidence for each question, and then generates cited findings, a timeline, risk factors, and a professional report.
The demo should prove three things quickly:
- Sensitive evidence can stay local.
- Every important answer is backed by citations.
- The system connects evidence across files better than a normal chatbot.
Ollama is the default provider so the application works offline. OpenAI API is an optional provider for better report synthesis and judge-facing demos when a teammate supplies their own API key. Deterministic extraction, timeline, risk scoring, and citations must still work without OpenAI.
PySide6 Desktop Application
|
Investigation Orchestrator
/ | | \
Evidence RAG Intelligence Reporting
| | | |
Parsers Milvus Timeline Templates
\ | | /
SQLite + Local Files
|
Ollama Local LLM / Optional OpenAI API
SentinelRAG is a modular monolith. Domain packages communicate through typed contracts and can later be exposed through an API without rewriting the core.
- Python 3.11 or 3.12
- PySide6 for the cross-platform desktop application
- SQLite and SQLAlchemy for transactional application data
- Milvus Lite through
pymilvusfor local vector and hybrid retrieval - Sentence Transformers for local embeddings and reranking
- Ollama for local language-model inference
- Optional OpenAI API provider for higher-quality synthesis during demos
- Tesseract for initial OCR
- PyMuPDF and standard-library parsers for evidence extraction
- Pytest, Ruff, and MyPy for quality gates
See Architecture and Architecture Decisions.
src/sentinelrag/ Product domains and application services
knowledge/ Versioned, licensed reference-source manifests
demo/ Reproducible demonstration investigations
tests/ Unit, integration, evaluation, and security tests
docs/modules/ Contributor-ready module contracts
docs/architecture/ System, data-flow, and security architecture
docs/adr/ Architecture Decision Records
scripts/ Cross-platform bootstrap and validation helpers
The live ownership board and module index are in MODULES.md.
Detailed implementation contracts live in docs/modules/MODULE-###-*.md.
Every issue, branch, commit, and pull request should reference one module ID
and its phase.
- Git
- Python 3.11 or 3.12 stable
- Ollama current stable release for model-backed workflows
- Tesseract OCR 4.1 or newer for OCR/parser workflows
Docker is optional. Milvus Lite runs in-process and does not require a server.
Install Python and Tesseract with the package manager for your distribution. For example, on Ubuntu or Debian:
sudo apt update
sudo apt install python3.11 python3.11-venv tesseract-ocrCreate a project-specific environment:
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
cp .env.example .envInstall Python, Ollama, and Tesseract using their official installers or Homebrew. On Apple Silicon, use an arm64 Python installation consistently.
python3.11 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
cp .env.example .envInstall Python using the Windows launcher, then install Ollama and Tesseract.
Add Tesseract to PATH, or configure its executable path locally when the OCR
module is implemented.
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
Copy-Item .env.example .envDo not reuse another contributor's virtual environment or commit .venv.
Dependencies are declared in pyproject.toml; requirements.txt and
requirements-dev.txt are compatibility entry points for tools that require
requirements files. Use requirements.txt instead when only runtime
dependencies are needed.
The default install is intentionally lightweight for foundation work and quick PR validation. Install extras only for the module you are working on:
python -m pip install -e ".[desktop]" # MODULE-019 desktop UI
python -m pip install -e ".[ingestion]" # MODULE-004/005 parsing and OCR
python -m pip install -e ".[rag]" # MODULE-007/008/010 retrieval
python -m pip install -e ".[reporting]" # MODULE-018 report generation
python -m pip install -e ".[security]" # MODULE-020 keyring/crypto work
python -m pip install -e ".[cloud]" # optional OpenAI providerTo enable the optional OpenAI provider, install the cloud extra and set a local
API key in .env. Never commit real keys.
python -m pip install -e ".[cloud]"Start Ollama, then download the recommended local generator:
ollama pull qwen3:4b
ollama listSentence Transformers is the default in-process embedding provider. An Ollama embedding model may be configured later without changing retrieval contracts. OpenAI embeddings are optional for cloud-enabled experiments, but local embeddings remain the default to preserve offline behavior.
Model downloads require internet access. Normal application operation should remain offline after dependencies and models are installed.
python scripts/doctor.py
python scripts/check_modules.py
pytestThe desktop command requires the desktop extra:
python -m pip install -e ".[desktop]"
python -m sentinelragUntil feature modules are implemented, it opens the initial application shell.
ruff check .
ruff format --check .
mypy src
pytestRead CONTRIBUTING.md before taking a module. New behavior requires tests, typed public interfaces, and an update to the relevant module acceptance criteria.
- Imported evidence is untrusted data, never executable instruction.
- Cases are isolated by
case_idat storage and retrieval boundaries. - Original evidence is immutable and SHA-256 hashed.
- URL acquisition rejects private-network targets and unsafe schemes.
- Generated claims must cite retrieved evidence or be marked as inference.
- Secrets and machine-specific paths never enter version control.
See Threat Model.
This project targets the Codex Community Hackathon - Pune on Loops House. Before using the Loops CLI, authenticate and check the current submission:
loops auth status
loops project get --hackathonSlug codex-community-hackathon-puneAfter the GitHub repository exists, create or update the Loops submission with the repo URL, tagline, description, demo URL, and video URL. Loops credentials and API keys must stay local.
SentinelRAG is in active hackathon development. Interfaces and schemas may change rapidly until the first end-to-end investigation flow is complete.
SentinelRAG is licensed under the Apache License 2.0. See LICENSE.