sthayi
AI memory you own.
A sovereign, local-first memory / skills / MCP-registry plane — so supported AI clients on your machine can read and write one shared local memory that you own.
sthayi (Sanskrit): permanent, enduring. The sthāyī bhāva is the enduring emotion beneath transient states; the sthāyī in Hindustani music is the refrain a raga always returns to. Pronounced "STAY-ee."
Your memory today can be scattered across Claude, ChatGPT, Gemini, Cursor, and CLI agents — multiple apps, multiple fragments, none of them yours. Sthayi is not another silo and not a replacement: it coexists with each app's built-in memory — in addition, not instead — as one shared local memory exposed to supported clients over MCP. There is no hosted Sthayi service and no Sthayi account — only the local MCP server running on your machine. Theirs stay theirs. This one is yours.
Quickstart
Prerequisite: Node.js 22 or 24
Sthayi v0.1.3 supports Node.js 22 and 24, with Node 24 LTS recommended, and requires npm. Check both before installing:
node --version
npm --version
node --version must begin with v22. or v24.. If Node is missing or reports any other major
version—including Node 25—install Node 24 LTS from the
official Node.js download page using the normal/default location
offered for your operating system. npm is included with the standard Node.js distribution. Reopen
your terminal afterward, then run both checks again. Sthayi refuses an unsupported Node major
before loading its native SQLite dependency and explains this repair.
Node.js does not need to be installed inside Sthayi's prefix. Installing Node.js is a separate
prerequisite and may require administrator approval, depending on the operating system and install
method. Once Node.js and npm are available, the Sthayi installation below stays in user space and
needs neither sudo nor administrator rights.
Install and initialize
Sthayi v0 uses a
better-sqlite3-backed local store. The user-space command below first refuses any Node major other than 22 or 24, then requests the npmlatesttag explicitly and makes npm enforce the package's engine declaration. Those two npm qualifiers prevent an unsupported Node runtime from silently selecting an older compatible release. Do not substitutenpx sthayi init.
Contributing from a source checkout instead? Use the Development workflow.
# macOS / Linux — bash or zsh
node -e "const m=Number(process.versions.node.split('.')[0]);if(m===22||m===24){}else{console.error('Sthayi requires Node.js 22 or 24 (24 LTS recommended). Detected '+process.version+'. Install Node.js 24 LTS: https://nodejs.org/en/download');process.exit(1)}" && npm install -g --prefix "$HOME/.local" --engine-strict sthayi@latest && "$HOME/.local/bin/sthayi" init
One line: install once somewhere durable, then detect your AI clients and wire them in one keystroke.
After the wizard completes, verify the default installation and state directory:
"$HOME/.local/bin/sthayi" doctor
This invokes the package from the durable install prefix; doctor reports the configured state
directory, including a custom absolute STHAYI_HOME when one is set.
Why the npm flags, and what they do not touch. --prefix and --engine-strict are
per-invocation flags: they tell this one npm install where to put the package and to refuse an
unsupported engine, while changing nothing in your npm
configuration. No ~/.npmrc is written, npm config get prefix reads exactly what it read before,
and every other npm command you run is unaffected. The install lands under your home directory, so
installing Sthayi itself needs no admin rights once Node.js and npm are available — including on
machines where npm's default global prefix is root-owned and a plain npm install -g sthayi fails
with EACCES.
Where things land:
| Path | What |
|---|---|
~/.local/lib/node_modules/sthayi |
the package itself — the durable install the launcher pins |
~/.local/bin/sthayi |
npm's shim, a relative symlink into the line above |
~/.sthayi/ |
your memory — sthayi.db, the vault key, journal.checkpoint, skills/, bin/ |
The package and the memory are two separate directories, and they are removed by two separate
acts: npm uninstall takes the first, and the second is yours alone (see
Upgrade & uninstall).
No account. No required API key for ordinary core operation. No telemetry. No administrator rights
for the Sthayi user-space install once Node.js and npm are available. Wiring, however, edits each
AI client's own config file (after saving a *.sthayi-bak-* backup beside it) — so removing Sthayi
starts with sthayi unwire, which restores or surgically updates those configs as described below.
Removal of the state directory itself is a separate decision, and one Sthayi leaves to you; see
“Upgrade & uninstall” below.
npx sthayi init is refused, and this is why. npx runs the CLI out of npm's download
cache, which is pruned without warning. init writes launchers that pin the exact CLI they were
written from, so a launcher pinned into that cache is wiring that breaks the next time npm cleans
up. Sthayi refuses to write one and tells you where to install instead — onboarding is a durable
install first, then sthayi init. (Commands that write no launcher — npx sthayi@latest status,
npx sthayi@latest doctor, npx sthayi@latest search — do run from the cache. search is not
read-only, though: every search journals a memory_retrieve, bumps recency, and strengthens the
association graph.)
What “durable” means: anywhere you keep, not anywhere privileged. Only three locations are
ephemeral — an _npx/_cacache path, your system temp directory, and your npm cache. Everything
else is pinned exactly where it stands. No Sthayi installation route below needs admin rights or
sudo once Node.js and npm are available — where a route cannot proceed it fails outright, and
the answer is a different route, never elevation. Each is one copy-pasteable bash/zsh line that
runs as typed:
# 1. THE HEADLINE ROUTE — a prefix inside your own home. This is the durable user-space route.
node -e "const m=Number(process.versions.node.split('.')[0]);if(m===22||m===24){}else{console.error('Sthayi requires Node.js 22 or 24 (24 LTS recommended). Detected '+process.version+'. Install Node.js 24 LTS: https://nodejs.org/en/download');process.exit(1)}" && npm install -g --prefix "$HOME/.local" --engine-strict sthayi@latest && "$HOME/.local/bin/sthayi" init
# 2. npm's default global prefix. Available ONLY when your account can already write that prefix
# — version managers normally put it inside your home. A default single-user Homebrew install
# normally makes its prefix writable by the installing user. Check: npm config get prefix.
# If your account cannot write that prefix, use route 1; never add sudo. Its bin is usually on PATH.
node -e "const m=Number(process.versions.node.split('.')[0]);if(m===22||m===24){}else{console.error('Sthayi requires Node.js 22 or 24 (24 LTS recommended). Detected '+process.version+'. Install Node.js 24 LTS: https://nodejs.org/en/download');process.exit(1)}" && npm install -g --engine-strict sthayi@latest && sthayi init
# 3. A plain local install is durable too. Its binary lives in node_modules/.bin.
mkdir ~/sthayi && cd ~/sthayi && node -e "const m=Number(process.versions.node.split('.')[0]);if(m===22||m===24){}else{console.error('Sthayi requires Node.js 22 or 24 (24 LTS recommended). Detected '+process.version+'. Install Node.js 24 LTS: https://nodejs.org/en/download');process.exit(1)}" && npm i --engine-strict sthayi@latest && ./node_modules/.bin/sthayi init
Route 1 is the headline because a normal per-user home is the most reliable writable location. Route 2 is the shorter line, and it is worth using when you know the prefix is writable by your account — but it is not universally admin-free.
PATH is optional, and irrelevant to the MCP integration. Your AI clients invoke
~/.sthayi/bin/sthayi-mcp by absolute path, so wiring works whether or not anything is on your
PATH. PATH only decides whether you can type sthayi in a terminal. init also writes
~/.sthayi/bin/sthayi, a launcher pinned to the same install, so the sthayi <command> forms
below work by full path (~/.sthayi/bin/sthayi status) — or on PATH, once. Both launchers live in
your state directory, so where you have set $STHAYI_HOME they are $STHAYI_HOME/bin/… instead;
sthayi doctor reports the home in use:
export PATH="$HOME/.sthayi/bin:$PATH" # add this line to your shell profile
Windows: the same architecture and the same user-space prefix. The per-shell forms below are host-validated (evidence recorded at v0.1.0) with the checksum-verified packed tarball under a standard (non-administrator) account. That packed-tarball evidence does not itself cover delivery from the npm registry; the npm package-name fetch smoke is a separate pre-announcement release gate. Sthayi never modifies PATH itself, on any platform.
Windows security scope. Sthayi's hardened filesystem discipline — the trust boundary that
protects your state directory — is a POSIX (macOS/Linux) guarantee. Windows has neither uids
nor POSIX mode bits, and no O_NOFOLLOW, so every part that depends on them is skipped there. On
Windows there is no ownership check, no permission-bit policy, no hard-link check, no ancestor
ownership/writability check, and no trust-boundary directory-identity check: a state directory
deleted and recreated at the same pathname is accepted, and Sthayi claims
no root-replacement protection on Windows. What applies on every platform: symlink and
non-directory refusals at any depth, one-level-at-a-time creation, exclusive-create temp names,
atomic rename, and descriptor-level re-validation with byte caps. Full statement:
docs/sthayi-v0-spec.md §1.
Windows commands — one shell per block, never mixed. The three Windows shells disagree about
statement separators and about how an environment variable is spelled, so each block below is
written for exactly one of them. Do not paste a line from one block into another. In particular
Windows PowerShell 5.1 has no && operator at all. Its separator is ;, which runs the next
statement unconditionally — so that block checks the install's success state ($?) and its
exit code ($LASTEXITCODE), both, before it runs init. Both are needed because they fail in
different ways: $LASTEXITCODE is written only by a native command that actually ran, so an npm
that could not be resolved at all never touches it and an exit-code-only gate reads a stale zero
left by some earlier command. $? reports the immediately preceding statement's success, and it is
captured into $ok before anything else can overwrite it. Without both checks a failed install is
followed by an init attempt against
whatever stands at the shim path, which on a prefix you have installed into before is a shim from
that earlier attempt, still pinned at an entry this install never refreshed.
# PowerShell 7
node -e "const m=Number(process.versions.node.split('.')[0]);if(m===22||m===24){}else{console.error('Sthayi requires Node.js 22 or 24 (24 LTS recommended). Detected '+process.version+'. Install Node.js 24 LTS: https://nodejs.org/en/download');process.exit(1)}" && npm install -g --prefix "$env:LOCALAPPDATA\sthayi" --engine-strict sthayi@latest && & "$env:LOCALAPPDATA\sthayi\sthayi.cmd" init
# Windows PowerShell 5.1
node -e "const m=Number(process.versions.node.split('.')[0]);if(m===22||m===24){}else{console.error('Sthayi requires Node.js 22 or 24 (24 LTS recommended). Detected '+process.version+'. Install Node.js 24 LTS: https://nodejs.org/en/download');process.exit(1)}"; $nodeOk = $?; if ($nodeOk -and $LASTEXITCODE -eq 0) { npm install -g --prefix "$env:LOCALAPPDATA\sthayi" --engine-strict sthayi@latest; $installOk = $?; if ($installOk -and $LASTEXITCODE -eq 0) { & "$env:LOCALAPPDATA\sthayi\sthayi.cmd" init } }
:: Windows cmd
node -e "const m=Number(process.versions.node.split('.')[0]);if(m===22||m===24){}else{console.error('Sthayi requires Node.js 22 or 24 (24 LTS recommended). Detected '+process.version+'. Install Node.js 24 LTS: https://nodejs.org/en/download');process.exit(1)}" && npm install -g --prefix "%LOCALAPPDATA%\sthayi" --engine-strict sthayi@latest && "%LOCALAPPDATA%\sthayi\sthayi.cmd" init
After init completes, verify the default state directory with the block for your shell:
# PowerShell 5.1 or 7
& "$env:LOCALAPPDATA\sthayi\sthayi.cmd" doctor
:: Windows cmd
"%LOCALAPPDATA%\sthayi\sthayi.cmd" doctor
These invoke the package from the durable install prefix; doctor reports the configured state
directory, including a custom absolute STHAYI_HOME when one is set.
Windows layout differs from POSIX, by npm's own design. With --prefix <dir> on Windows npm
puts the command shims directly in <dir>\ and the package under <dir>\node_modules —
there is no lib/node_modules and no bin/ level, which is why the invocation above is
<dir>\sthayi.cmd rather than <dir>\bin\sthayi. By default, your memory lives at
%USERPROFILE%\.sthayi\, with launchers under its bin\ directory. If STHAYI_HOME is set, the
state and launchers live under that absolute directory instead. Invoke Sthayi by full path, or add
the applicable bin\ directory to your user Path once (Settings → search “environment
variables” → edit Path → New) for a persistent sthayi command in new terminals.
The Windows user-space prefix, layout, shim and init path is host-validated (evidence recorded at v0.1.0) on
Windows 11 Pro 24H2 x64 under Node 22.23.2, using a standard (non-administrator) account and the
checksum-verified packed tarball. Windows PowerShell 5.1, PowerShell 7.6.4 and cmd.exe all
completed their install-and-init forms; the CLI, native SQLite binding, MCP server and
reinstall/repin/unwire/uninstall lifecycle also passed. That packed-tarball evidence does not itself
cover delivery from the npm registry; the npm package-name fetch smoke is a separate
pre-announcement release gate.
Then ask any wired assistant: "Use Sthayi memory: what do you know about my current projects?" — and they all answer from the same memory.
Memory bill of rights
Your memory is:
- Portable — Sthayi uses an open, versioned SQLite schema. A memory pack is a masked context document, not a restorable backup.
- Private — ordinary core operation is local and sends nothing to Sthayi. An explicitly invoked Oracle job sends bounded, masked batches to your chosen provider; a pack leaves the machine only when you deliberately export or share it.
- Inspectable — an append-only, hash-chained journal records every write and retrieval.
- Deletable — your memory is one local state directory (
$STHAYI_HOMEwhen you set it,~/.sthayiotherwise;sthayi doctorreports the one in use). Sthayi keeps its state in that local directory and retains no hosted copy, so the end of it is yours alone to decide and needs no permission from anyone.sthayi unwirerestores client configs (untouched-since-wire configs come back byte-exact; edited ones lose only the Sthayi entry and preserve the other edits). Sthayi does not yet ship a validated erase command, and this page publishes no procedure for erasing a state directory by hand — see Upgrade & uninstall for why a printed location is not a verified removal target. - Yours — MIT-licensed, no CLA, no lock-in; run it forever without us.
Never-paywall list
These are free and open forever:
- the store · the schema · the MCP server · the importers · the prompt pack
How it works
AI clients (Claude Desktop/Code, Cursor, Gemini CLI, Codex)
│ stdio MCP by default
▼
packages/cli ── wizard / commands / MCP server entry
│
packages/core ── domain logic (browser-clean: no fs/net/process imports)
│ StorageDriver port
better-sqlite3 driver → ~/.sthayi/sthayi.db (+ key file, config.json, bin/)
sthayi serve --http optionally serves the same MCP tools over authenticated loopback HTTP at
127.0.0.1; it is not a hosted or remote Sthayi endpoint. Exposing that listener through a tunnel,
reverse proxy, Tailscale, or VPS is an explicit user action outside Sthayi.
- The diary (journal). Every change is written to an append-only, tamper-evident log — you can always answer "why does it think that?"
- The safe (vault). Secrets are detected on write and masked to pseudonyms; detected canonicals remain encrypted locally, while Oracle batches and packs contain their pseudonyms instead.
- The front door (MCP). Supported AI clients connect through one standard plug; wiring is one command. Unwire restores an untouched-since-wire configuration byte-for-byte. If it changed afterward, unwire removes only Sthayi's entry, preserves the other edits, and retains the pre-wire backup.
- The housekeeping (consolidation). Duplicates merge, stale facts fade — every action journaled and reversible.
- Keyless core. Ordinary store, search, write, deterministic consolidation, and MCP operation
need zero API keys. Only explicitly invoked Oracle jobs and
sthayi qualifyneed a provider key and contact your selected provider. Oracle sends bounded, masked memory batches;qualifysends the shipped synthetic conformance fixtures, not user memories. - Lexical FTS5 search ranked by
bm25 × confidence × recency. Search is lexical: matching is done by SQLite's FTS5 index over your text. There are no embeddings — no vectors are computed, stored, or queried anywhere in Sthayi, and no model is called to search.sthayi search <query> --scope <scope>restricts results to a single scope (e.g.--scope useror--scope project:acme). - Associative recall (Samskara). Memories retrieved together wire together: every search
strengthens a Hebbian association graph derived purely from the journal, and spreading
activation then surfaces memories that share zero keywords with your query — keyless and
offline. The graph accumulates associations from co-retrievals as you use it.
sthayi index rebuildre-creates this derived state from the journal bit-for-bit;--no-assocgives you plain lexical ranking. - The oracle proposes; the runtime disposes. The Oracle is Sthayi's optional bring-your-own-LLM memory-consolidation pass: it examines bounded, masked batches of your memories and proposes merges, archives, distilled memories, and contradictions — nothing more. Sthayi validates every response against a schema before applying anything, and records each applied change in the journal (one command to roll back). Deterministic consolidation works without any Oracle provider at all.
Upgrade & uninstall
Upgrading never requires rewiring clients: they are wired to the stable launcher
~/.sthayi/bin/sthayi-mcp, not to npx or a versioned path. A launcher pins a pathname, not a
version. It names a Node binary and the CLI entry path it was written from, and it executes
whatever file stands at that pathname each time a client starts it — it reads no manifest and
compares no version. Upgrade the package the same way you installed it: for the headline route
that is npm install -g --prefix "$HOME/.local" --engine-strict sthayi@latest, which r
