Synapse
Next.jsSQLiteTypeScript
The problem
Personal knowledge management tools are either too generic (Notion, Obsidian) or locked in someone else's cloud. I wanted a system that I fully owned — memories, notes, and an AI layer grounded in my own data.
What it does
Synapse is the backend of timeogilson.be. It stores memories in SQLite with real vector embeddings, exposes them via an MCP server (for Claude integration), and powers a public `/ask` interface that answers questions grounded in my verified memories with calibrated refusals.
Key architecture decisions
- Single domain service (`lib/memories.ts`) — all mutations go through one layer that validates, audits, snapshots, and invalidates embeddings
- Provider-agnostic embeddings — OpenAI-compatible or Gemini, configured via env; BM25 lexical fallback when no key is set
- Fail-closed auth — bearer token OR session cookie; open only in dev when no token is configured
- Versioned migrations (`lib/migrate.ts`) — replaces ad-hoc PRAGMA checks
Stack
Next.js, SQLite (better-sqlite3), TypeScript, Tailwind CSS 4, deployed on a Contabo VPS via Docker Compose.