DOCS

Everything the CLI already knows,
on one page.

This page is generated by hand from the same source the CLI's own memhouse --help and README.md come from, kept here so it works whether or not you have access to the source repository. Install, concepts, the full command reference, team & sharing, staying current, troubleshooting.

Getting started

One command, no flags, no compiler — Node 24's own node:sqlite covers every adapter that used to need a native binding.

# install
$ npm install -g memhouse

# no ClickHouse yet? stand one up locally, loopback-bound
$ memhouse deploy --local

# the wizard: discover → configure → ship → start
$ memhouse onboard
  ✓ 16 adapters · 9 with sessions on this machine
  ✓ sessions shipped · open the dashboard: memhouse dashboard

# read-only preflight — writes nothing
$ npx -y memhouse discover

Already have a ClickHouse — your own server, ClickHouse Cloud, one provisioned by an ultimagent kernel? memhouse setup --yes --url … --user … --password … --db … writes the config directly, no wizard.

Joining a house someone else runs? They send you invite-<you>.env. Run memhouse install --env invite-<you>.env — or just memhouse in the folder that holds it, and it offers to join.

Every command is dual-mode: interactive for a human, --yes / flags / --json for an agent. An agent can install its own memory, unattended.

Concepts

A house is a ClickHouse database — mem by default. Each member owns rooms named for them in it. Everything else follows from that.

House, rooms, member

A member's rooms are mem.<member>_sessions, _messages and _tool_calls — real typed columns for what other tools derive at query time, plus one extra JSON escape hatch per table so no adapter field is ever dropped — with _meta and _events beside them for bookkeeping. A member is a ClickHouse user with one grant, on mem.<member>_*: their own rooms, to write, evolve and share, and nothing beyond. memhouse instance shows which house, member and rooms this machine uses.

Provenance no client can fake

user_id is MATERIALIZED currentUser() — the server stamps it during the insert, with async inserts pinned off so the stamp cannot be skipped. host is a fingerprint derived from the machine itself (kept in ~/.memhouse/host.json), not from the hostname — two laptops both called MacBook-Pro stay two machines, renaming one doesn't split its history, and a reinstall keeps the same identity.

One person: WHERE user_id = 'alice'. One machine: WHERE host = 'my-laptop-1f2e3d4c'. The whole house: no filter.

Rows carry an epoch — nothing is deleted to make room

A re-ship that comes back shorter used to overwrite the longer parse it replaced. Now every row in messages/tool_calls carries an epoch: unchanged sessions keep their epoch, a changed session writes under a new one, and the old epoch stays complete and queryable. Reads default to the current epoch only; sessions is the deliberate exception — one row per session, no epoch in its key. Rows also carry origin (ship vs import). The shipper is insert-only — a session that grew ships just its new rows — so it never touches history it didn't write.

Commands

Every command is scriptable. --help or -h on any of them prints this same reference instead of running anything.

CommandWhat it does
onboardInteractive wizard: discover → configure → ship → start.
installScriptable setup — --url --user --password --db [--yes] [--no-ship]. --env FILE installs from an invite file.
invite <name>Mint a member on the server — the user and one grant on mem.<name>_* — and write invite-<name>.env for their install. Uses your own credential when it may create users, otherwise --admin-user --admin-password. This machine untouched; the admin credential is never stored.
share <user>Let a housemate read your rooms — all of them, or --only project=… | session=… | since=… (row policies). --revoke withdraws; --list shows who can read.
instanceWhich memhouse this is: binary, house, member, rooms, host, daemons, and the playbooks bound to it.
passwdRotate this member's password and rewrite the env file. Admin-assisted (--admin-user --admin-password) or --print-sql to run it yourself.
setup(Re)write the connection config only. --yes skips every prompt.
discoverRead-only preflight: editors found, sessions on disk, reachable ClickHouses. Writes nothing.
uninstallStop daemons + service, clear runtime state. Default tier keeps config and host identity — --credentials also forgets the house, --full-removal takes everything (asks first). No tier touches house data.
updateUpgrade the package, bring the house to the new schema, repoint an install whose rooms moved, refresh /mem, restart the daemons. --check compares versions only; --no-install when the files are already in place.
resetClear the shipper's rows and re-ship everything (asks; --yes skips). Imported rows are kept unless --all-origins. Sessions whose transcripts are no longer on disk cannot be re-shipped — reach for this last.
nightlyBuild an installable, version-stamped tarball from this checkout. Publishes nothing. [--out DIR]
shipOne incremental pass. --full re-ships everything; --loop [sec] runs continuously.
statsPer-source session/message/token counts.
search <terms…>Full-text search across every session.
resume <session-id>Print (not run) the command that reopens that session in its editor.
sessions-queryPrint the session-rollup SQL for the configured credential.
start / stopShipper loop + dashboard as background (pidfile) daemons.
statusDaemons, connection, counts, freshness. --json for scripts.
doctorDiagnose the whole pipeline — schema, fleet, pricing coverage, daemons.
pluginslist / install claude [--target DIR] / remove claude — acts on every Claude config dir found (~/.claude, CLAUDE_CONFIG_DIR, every ~/.claude-playbooks/*), all selected by default.
promptPrint the memory system-prompt snippet. --install prints an install prompt for an agent instead.
deploy --localRun ClickHouse in docker/podman, bound to loopback, then install. --down removes it (container + volume).
migrate / migrate-roomsRun every migration the house still needs (or just the rooms) — copy + atomic swap, deletes nothing. [--dry-run] [--yes]
convert(Operator.) Move a house from the old database-per-member layout into rooms in mem — a rename, nothing copied; grants and shares carried across. --dry-run first.
service installRun the shipper as a real user service (systemd --user / launchd). Also stop | start | restart | uninstall | status.

Config resolves: flags > MEMHOUSE_* env > ~/.memhouse/env > defaults. There is no house-shaped default — with nothing configured, commands that touch memory refuse rather than guess localhost:8123.

Team & sharing

Two different things: owning a house (invite) and reading someone else's (share).

Bringing in a housemate

memhouse invite <name> creates the ClickHouse user and one grant on mem.<name>_* — their rooms, with the rights to write, evolve and share them, and nothing beyond: they cannot CREATE USER or read a housemate's rooms. It writes invite-<name>.env; an admin credential, if one was needed, is never stored anywhere. The invitee runs one command, which offers to rotate the password to one only they know and then deletes the file:

$ memhouse invite alice --url https://house.example.com
  ✓ invite written: invite-alice.env

# alice runs, on her own machine:
$ memhouse install --env invite-alice.env

Reading a housemate's memory without owning it

memhouse share bob grants Bob SELECT on your rooms — for asking "how did alice fix this" without handing anyone write access. --only project=… narrows it with row policies, and memhouse share bob --revoke withdraws it. Members can also see who else is on the server (GRANT SHOW USERS ON *.*), so /mem:house can answer "everyone on this ClickHouse" without an admin.

Rotating your own password

$ memhouse passwd
  ✓ password rotated and ~/.memhouse/env updated
  • every OTHER machine shipping under this user now needs the new
    password too — run `memhouse setup --password …` there.

memhouse passwd --help prints this reference instead of rotating anything — every command honors --help / -h before it touches the house.

Staying current

A bare npm i -g memhouse@latest does about two-thirds of the job.

memhouse update upgrades the package, brings your rooms to the new schema, repoints an install whose rooms were moved, refreshes the /mem skills, and restarts the daemons (which otherwise keep parsing with the code they booted with — one shipper here ran 1d16h out of a directory that had been moved). update --check compares versions and changes nothing, and status says when a newer version is out. Each daemon also checks on its own, once per pass, and hands over when it's behind — exiting under a supervisor (systemd/launchd) so it restarts on the new code, or re-executing itself when nothing is supervising it.

When the house itself needs to change

memhouse migrate runs whatever this house still needs — detected from the house's own _meta record, not from anything the client remembers. Every migration is copy + atomic swap; the old room is kept as <room>_pre_epoch for you to drop once you've checked it. migrate --dry-run shows the plan without touching anything.

When the operator moves the house

If whoever runs your ClickHouse converts it to the current layout (memhouse convert — your rooms are renamed from alice.messages to mem.alice_messages, nothing copied), your next memhouse update — or the shipper, on its next start — notices and rewrites MEMHOUSE_DB itself. Nothing ships in between, and nothing is lost: the transcripts are still on disk, and the first good pass sends everything that was missed.

Troubleshooting

An editor reads zero sessions

Five adapters — cursor, zed, opencode, goose, antigravity — read sessions out of SQLite files. On versions before node:sqlite that meant a native binding and an easy-to-forget --allow-scripts flag; that failure class is gone now. What can still go wrong is one store at a time — a locked state.vscdb, a corrupt file, a schema an editor release changed — and it's never silent: memhouse discover and memhouse doctor both name the skipped adapter and say why, while every other adapter keeps working.

EACCES on install

Check who owns the prefix root, not the path: ls -ld "$(npm prefix -g)". Owned by root (a system-managed Node) — re-run with sudo. Owned by you (Homebrew, fnm, nvm, volta) — the prefix is already yours, and the root-owned file npm tripped on is a stray from an earlier sudo npm; fix just that path with chown instead of adding another sudo.

Daemons don't survive a reboot

memhouse start detaches with pidfiles, which outlive the shell but not a restart. memhouse service install writes a real user service — systemd --user on Linux, a launchd agent on macOS — and takes over. On Linux, a --user unit stops at logout unless lingering is enabled; install detects that and prints the exact loginctl command.

Still stuck

memhouse doctor diagnoses the whole pipeline in one pass — schema, fleet health, pricing coverage, daemon state — and says in words what's wrong rather than leaving you to infer it from a low number.