Getting started
Memory works inside an existing project. This page gets you from install to a
working product graph: local .memory/ storage, a generated product map in
your agent instruction files, and the ongoing query/save/sync loop.
What you need
Section titled “What you need”- Homebrew, or Node.js
>=22when installing with npm - A repo you work on with AI coding agents
Check Node with:
node --versionInstall
Section titled “Install”Install with Homebrew on macOS/Linux:
brew install aictx/tap/memoryOr install globally with npm when Node.js >=22 is already available:
npm install -g @aictx/memoryA project-local dependency is useful when a repo needs to pin its own Memory version:
pnpm add -D @aictx/memorynpm install -D @aictx/memoryWhen memory is not on PATH, run it through the package manager or local
binary:
pnpm exec memory statusnpm exec memory status./node_modules/.bin/memory statusnpx --package @aictx/memory -- memory statusInitialize
Section titled “Initialize”From the project root, run:
memory initinit does four things:
- Creates
.memory/storage with a starterprojectnode and empty graph. - Installs two marker sections into
AGENTS.mdandCLAUDE.md: a short guidance block (how agents should use Memory) and a generated product map (initially a placeholder). - Starts the local viewer.
- Prints the indexing brief — the instructions a coding agent follows to build the initial product graph.
Useful variants:
memory init --dry-run # preview without writing anythingmemory init --no-view # skip viewer startupmemory init --no-agent-guidance # skip AGENTS.md/CLAUDE.md changesmemory init --brief # print only the indexing brief, touch nothingmemory init --force # discard existing storage and start overBuild the first graph
Section titled “Build the first graph”Init itself stays mechanical; building the graph is the agent’s job. Give the printed brief to your coding agent (or paste the first-time setup prompt). The brief tells the agent to:
- Explore the repo: README, package manifests, entrypoints, docs, recent git log.
- Draft 3–10
featurenodes — what the product does for its users — each with astage(idea,building,shipped,paused,dead) andanchors(repo-relative path globs likesrc/billing/); plus keydecisionnodes with their reasons, knowngotchanodes, and openquestionnodes. - Interview you for what the repo cannot tell it: product intent, the real stage of each feature, decisions and why, what is abandoned versus merely paused.
- Save everything in one call:
memory save --stdin <<'JSON'{"task": "initial product graph", "nodes": [ {"kind": "feature", "title": "PDF render API", "body": "Renders invoice templates to PDF over HTTP.", "stage": "shipped", "anchors": ["services/render/"]}, {"kind": "decision", "title": "Retries run in the worker", "body": "Webhook retries execute in the queue worker, not the HTTP handler, so handler latency stays flat."}, {"kind": "question", "title": "Where do rendered PDFs live long-term?", "body": "Local disk works for single-node; S3 is unresolved."} ]}JSON- Verify with
memory statusandmemory check. The product map inAGENTS.md/CLAUDE.mdrefreshes automatically on save.
The interview step matters. Stage and rationale are exactly the things the code cannot answer — that is why they are worth storing.
The ongoing loop
Section titled “The ongoing loop”Mid-task, when an agent (or you) needs product context, query instead of preloading:
memory query "why do webhook retries run in the worker?"memory query "what is the state of batch exports?" --budget 1200After product-meaningful changes — feature behavior added or changed, a decision taken, a gotcha discovered, a question opened or answered:
memory save --stdinA task that changed no product reality needs no save.
At session end, or after merging others’ work:
memory syncsync diffs the tree since the last sync marker, verifies every anchor, and
reports nodes whose anchored code changed, dead anchors, and coverage gaps —
with a pre-filled save skeleton when something needs reconciling.
Check where things stand any time:
memory status # this project: features by stage, open questions, stale anchorsmemory status --all # one row per registered projectmemory view # local browser viewermemory diff # tracked and untracked .memory/ changes- Mental model — how the graph, map, query, and sync fit together, and what is worth saving.
- CLI guide — every verb and flag.
- MCP guide — the four MCP tools for clients that run
memory-mcp.