← All work

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
Links
Diagram: AI clients connect to one MCP endpoint on Lisa (NixOS server) serving files with stable IDs and encrypted backups, git memory, email, calendar and a passkey-only web dashboard

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

1. The agent gateway — Badulaque−66% cost

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.

2. Shared memory — cli-memoriaApache-2.0

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.

3. Files as source of truth, stable IDs and selective syncSQLite · Restic · Syncthing

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.

4. Web dashboard and personal servicesReact · Node · WebAuthn

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

DevicesLaptop and phone via selective Syncthing and on-demand WebDAV.
Lisa (NixOS)
  • files with stable IDs
  • git memory & dashboard
  • Badulaque + code VM
AI agentsSee only permitted data in ephemeral sandboxes and cite files by ID.
Encrypted backupHourly restic off-site, unreadable without my local key.

Operations and security by design

Declarative with auto-rollbackNixOS flake

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.

Least privilege at every layerIsolation

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.

No reusable passwordsPasskeys · TLS

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.

Zero plaintext cloud lock-inE2E encrypted

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.