# Stack

Source: https://aunysillyme.dev/projects/shared-agent-memory/docs/stack/

Written before the first commit. Each line is a decision the rest of the repo builds on, and each budget that must keep holding is a test.

1. **Runs on:** the command line (Node) on every computer whose AI memory gets shared, plus one long-running server process on one of them.
2. **The user already has:** Node, for most people who use AI coding hosts. The embedding model (Ollama) and the secret scanner (gitleaks) are companions: setup prints each vendor's own install command and never installs them.
3. **Install path:** `npx shared-agent-memory` for setup; the same package runs `collect` from the system scheduler (launchd, systemd or cron) and `serve` for the server.
4. **Budgets:** 1 runtime dependency (`sqlite-vec`, which ships a prebuilt extension per platform); 1 install command and 1 confirm; packed tarball at most 300 KB; installed dependencies at most 2 MB; `--help` cold start at most 300 ms on the CI Ubuntu runner; a `collect` run over 1,000 unchanged files in under 2 s; server idle memory at most 150 MB, not counting the embedding model; uninstall leaves 0 files it wrote.
5. **Pick:** JavaScript ESM, type-checked by `tsc --noEmit --checkJs`, with TypeScript as the only devDependency. No build step, so the published files are the reviewed files. Storage is Node's built-in `node:sqlite` with the `sqlite-vec` extension: on 2026-12-03 Node 22.23.4 loaded sqlite-vec 0.1.9 with `allowExtension` and answered a nearest-neighbour query, and the dependency installed at 192 KB. `engines.node >=22`; CI runs Node 22, 24 and 26 and repeats that extension check on each.
6. **Budget tests:** `test/budgets.test.mjs` checks the dependency count, the packed size from `npm pack --dry-run --json`, the installed dependency size, the `--help` timing and the unchanged-run timing; `test/sqlite-vec.test.mjs` repeats the extension check; `test/uninstall.test.mjs` checks that uninstall leaves nothing it wrote.
