Self-hosted AI assistant
Lisa, a declarative NixOS home server centralising my files with stable IDs, git memory, email, calendar and one MCP gateway for any AI agent.
- Role
- Solo project
- When
- Sept 2026 – present
- Stack
- NixOS · TypeScript · Node.js · React · SQLite · MCP · WebAuthn · Syncthing · Restic · WebDAV · CalDAV
I switch AI clients constantly — Claude Code, claude.ai, Codex — and didn’t want tools, files and memory scattered across cloud silos and isolated sessions. The constant is Lisa, a declarative NixOS home server that acts as my personal source of truth; the client and model are whatever fits that day.
How the four pieces fit together
One MCP endpoint with a key per agent and two tools — a server-enforced read-only tool and a write tool — running inside ephemeral bubblewrap sandboxes with agent-oriented CLIs. Real secrets never enter the sandbox: a proxy injects them on exit only towards their authorised domain.
Around 300 pure-Markdown notes in git — no LFS, no OCR — shared across every agent, with lexical search (SQLite FTS5) and write rules enforced in code. Instead of embedding binaries, notes cite documents in the file store by stable ID.
Personal documents live on the server with no plaintext cloud mirror. A SQLite index assigns every document a permanent ID — tracked across renames via inode and SHA-256 — and maintains a cross-reference table with the memory: moving a file automatically updates its citations in notes. The CLI also reads PDFs, office formats and handwritten .xopp notebooks.
Coursework lives separately and syncs in a star topology via Syncthing from my laptop: the server keeps notes and PDFs (available to agents and mobile) while an isolated development VM keeps only code and git repositories, filtering build artefacts on every node. On-demand mobile and desktop access runs over WebDAV, and hourly encrypted restic backups replicate documents, coursework, memory and code off-site with weekly automated restore checks.
One control panel for the whole server: unified email (Gmail, iCloud, Microsoft 365 and IMAP), file browser with encrypted backup status, memory viewer, health metrics, an on-demand remote browser I can take over anytime, and per-agent controls. Calendar, reminders and contacts sync over CalDAV and CardDAV without needing my laptop or phone awake. Dashboard login is passkey-only (Face ID / Touch ID), with passwords disabled.
How data flows
- files with stable IDs
- git memory & dashboard
- Badulaque + code VM
Operations and security by design
Both the server and its development VM are built from a single reproducible flake. Remote deployments activate with a timed, lock-serialised automatic rollback so a bad network or config change reverts cleanly on its own.
Each service runs under its own Unix user with systemd sandboxing; secrets stay out of git and the Nix store and are injected at startup. Administration is restricted to a private mesh VPN with key-only SSH.
The dashboard enforces user-verified WebAuthn passkeys with single-use out-of-band recovery. Syncthing authenticates peers by TLS certificate with relays and global discovery off, and remote file access layers geo-restriction, brute-force blocking and login alerts.
No plaintext two-way sync with third-party clouds: if an external provider fails or changes terms, the canonical data stays at home and off-site backups remain end-to-end encrypted.
The benchmarks and papers behind the gateway and memory architecture are collected in this blog post.