Install
Needs: Rust stable (≥ 1.75), protoc, OpenSSL / pkg-config, macOS or Linux (WSL OK).
Python 3.10+ is recommended so install can set up the Laya System-1 sidecar
out of the box (typed decide / conflict / query router).
Build from source
Section titled “Build from source”git clone https://github.com/sanudatta11/statefulmemory && cd statefulmemorymake prereqs && make install # → ~/.local/bin/statefulmemory (+ smem)export PATH="$HOME/.local/bin:$PATH"statefulmemory --version # same binary: smem --versionThe daemon auto-starts on first use (self-host default: Unix domain socket).
Put ~/.local/bin on your PATH permanently if statefulmemory / smem is not
found after install. Team TCP self-host and StatefulMemory Cloud (managed SaaS): see
Self-hosting and Cloud.
What install puts where
Section titled “What install puts where”| Path | Role |
|---|---|
~/.local/bin/statefulmemory (+ smem) |
CLI binary (same code) |
~/.statefulmemory/ |
Data dir (created on first use) |
~/.statefulmemory/config.toml |
Written/merged by install (includes [laya] when missing) |
~/.statefulmemory/laya-sidecar/ |
Laya FastAPI app (unless --no-laya) |
~/.statefulmemory/laya-venv/ |
Dedicated Python venv for Laya |
Wire agents, git hooks, and Laya
Section titled “Wire agents, git hooks, and Laya”From any project directory (after the binary is on PATH):
statefulmemory install # or: smem installstatefulmemory install --no-git-hooks # skip post-commit / post-merge / post-checkoutstatefulmemory install --no-laya # skip Python venv / sidecar spawnWhen cwd is a git repo, install adds hooks that run statefulmemory verify --quiet
after commit, merge, and checkout. That keeps code-anchored memories marked
when HEAD moves. Uninstall strips the statefulmemory blocks from those hooks.
install also writes a bootstrap ~/.statefulmemory/config.toml (hybrid search,
conflict judge, extract, Laya) without clobbering keys you already set.
Laya details: repo tools/laya-sidecar/README.md.
Full agent matrix: Wire into your agent.
Sanity checks
Section titled “Sanity checks”statefulmemory daemon statusstatefulmemory doctor # includes Laya enabled / url / healthNext steps
Section titled “Next steps”- Getting started: end-to-end tour
- Wire into your agent: MCP tools and hooks
- Config:
[laya]and other knobs - GitHub: source, issues, and releases