secrag is a personal hobby project โ an experimental testbed for secure, self-hosted retrieval-augmented Q&A. It explores what regulated-institution-style requirements (envelope encryption at rest, phishing-resistant MFA, self-hosted open-weight inference) could look like in practice. Not production, not audited โ please use only synthetic, throwaway documents.
See it in action
Mockup of the real screens, same design system as the running app. Filenames and answers below are fictional demo data, not a real deployment.
Three features, built in sequence
Each feature shipped with its own written spec, implementation plan, data model, and API contract before a line of code was written โ the full artifacts are in specs/ in the repo. All of it built as a hobby experiment to test secure-RAG ideas end to end, not as a production system.
Upload a PDF โ antivirus scan โ envelope encryption with a fresh per-document key wrapped by Vault Transit โ encrypted blob on disk. Nothing document-derived is ever stored, or logged, in plaintext.
Read spec.md โAdmin-provisioned accounts, password + phishing-resistant MFA (WebAuthn passkeys preferred, TOTP fallback), step-up re-authentication before sensitive actions, lockout, and admin-mediated password reset.
Read spec.md โAsk a plain-language question; the system retrieves your own relevant chunks and grounds a locally-generated, streamed answer in them โ with page-level citations naming exactly where each fact came from.
Read spec.md โHow this was built
Every feature followed spec-kit's workflow inside Claude Code โ a written spec and an implementation plan (checked against this project's own constitution) existed before any code did. Nothing here is a prompt-and-pray prototype.
User stories, requirements, explicit non-goals โ agreed before any plan existed.
Architecture, data model, API contract, checked against the project constitution.
A dependency-ordered breakdown, each task small enough to verify on its own.
Live-verified against the real Postgres/Vault/ClamAV/Ollama stack โ not just a code read-through.
Architecture
Document-touching inference โ embedding and generation both โ runs on Ollama, on infrastructure the project controls. No document content, extracted text, or embedding ever crosses a third-party API boundary.
Security ideas under test
Every feature is checked against a written project constitution before implementation โ not aspirational guidelines, structural constraints the schema and code enforce. All of it experimental: interesting to study, not to trust with real data.
Tech stack
A deliberately small surface โ one backend, one Postgres database, static frontend files with no build step.