Primary operating guide for coding agents that need to install, configure, bind, and use Memorix correctly.
This document is written for AI coding agents, not for human-first browsing. If you are an agent helping a user adopt Memorix, use this file as the execution guide before you attempt installation, integration, or troubleshooting.
Memorix is an open-source cross-agent memory layer for coding agents via MCP.
It is designed for software work, not generic chat memory. Its core value is that multiple coding agents and IDEs can share:
- Observation Memory: what changed, how something works, gotchas, problem-solution notes
- Reasoning Memory: why a decision was made, alternatives, trade-offs, risks
- Git Memory: structured engineering truth derived from commits
It supports:
- stdio MCP (
memorix serve) - HTTP control plane + dashboard (
memorix background startormemorix serve-http --port 3211) - local-first project-scoped memory
- cross-agent recall across Cursor, Claude Code, Codex, Windsurf, Gemini CLI, GitHub Copilot, Kiro, OpenCode, Antigravity, and Trae
If you used Memorix before 1.0.8, the operator-visible changes worth knowing are:
- session, search, detail, and timeline now expose a clearer
L1 / L2 / L3retrieval model - compact evidence surfaces better distinguish repository-backed signals, synthesized analysis, and citation-lite support
- retrieval is more task-line aware inside a single repo and less likely to surface the wrong subdomain
- obvious credentials are sanitized on write and redacted on retrieval surfaces
- retention, stale review, audit, and resolve now form a clearer cleanup/remediation loop
- OpenCode compaction guidance now preserves structured continuation context without falsely implying automatic MCP tool calls
memorix_session_startis now lightweight by default: it binds the project, opens the session, and restores context without auto-registering a team identity- team participation is now explicit: use
joinTeam: trueonmemorix_session_startor callteam_manage(join)directly - Memorix is now CLI-first for operators: every Memorix-native operator capability has a terminal route, while MCP remains the integration protocol for IDEs and agents
- Agent Team page is an autonomous CLI agents status surface (not an org backend or IDE-window chat room): shows explicitly joined autonomous agents, open tasks, handoffs, and a "Continue This Project" resume area
- Docker now has an official HTTP control-plane deployment path; when running in a container,
projectRootmust be visible inside that container or project-scoped semantics will fail closed
For human operators, prefer memorix ... commands first. In 1.0.8, the CLI covers all Memorix-native operator capabilities across session, memory, reasoning, retention, formation, audit, transfer, skills, team, task, message, lock, handoff, poll, sync, and ingest workflows.
Do not ask memory-only users to join the Agent Team. A lightweight session is enough for memory, retrieval, reasoning, and continuation. Join only for explicit task/message/lock coordination or for autonomous CLI-agent work managed by memorix orchestrate.
Use MCP when:
- an IDE or agent needs tool calls
- you are integrating Memorix into an MCP-capable client
- you need the optional graph-compatibility tools that intentionally remain MCP-only
Use the CLI when:
- a human is operating Memorix directly
- you are on SSH / Docker / CI / NAS and want direct control
- you want readable, stable command namespaces instead of raw tool payloads
Memorix is project-scoped by default.
Important:
projectRootis a detection anchor- Git identity is the final project identity
If the workspace is not a Git repository:
- project-safe memory will not bind correctly
- some commands may fail closed
- the right first step is usually:
git initDo not assume a plain folder path is enough.
There are four practical operator entry points:
memorixfor the interactive local workbench in a TTYmemorix servefor stdio MCP hostsmemorix background startfor an optional long-lived HTTP control planememorix serve-http --port 3211for foreground HTTP control-plane work
The two server runtime modes are:
Use:
memorix servewhen the MCP host launches Memorix directly from the current workspace and stdio transport is enough.
Prefer:
memorix background startwhen the user wants:
- HTTP MCP transport
- dashboard
- multiple agents or sessions
- team/task/message features
- one shared control-plane process
Default recommendation: if the user just wants memory inside one IDE or terminal, start with memorix or memorix serve. Reach for HTTP only when a shared background service, multi-client MCP access, or a live dashboard endpoint is actually needed.
Use:
memorix serve-http --port 3211when the user wants the same HTTP control plane in the foreground for debugging, manual supervision, or a custom port.
At the beginning of a new project session, call:
{
"agent": "your-agent-name",
"projectRoot": "ABSOLUTE_WORKSPACE_PATH"
}through memorix_session_start.
Do not assume the HTTP connection alone tells Memorix which project the user means.
The HTTP control plane is normally started with memorix background start; the same project-binding rules apply when you run memorix serve-http --port 3211 in the foreground.
HTTP MCP sessions idle out after 30 minutes by default. If the user's HTTP MCP client is sensitive to stale session IDs after long idle periods, set MEMORIX_SESSION_TIMEOUT_MS before starting or restarting the control plane. Example: MEMORIX_SESSION_TIMEOUT_MS=86400000 keeps sessions alive for 24 hours.
Memorix intentionally supports both:
- project-level settings and integrations
- global-level defaults
Your job as an agent is to choose the smallest scope that matches the user's goal.
Use this path when the user wants the quickest possible adoption.
npm install -g memorixIf not:
git initmemorix initmemorix init is a scope selector, not just a project-local generator. It lets the user choose between:
Global defaultsProject config
Memorix uses:
memorix.ymlfor behavior and project settings.envfor secrets such as API keys
If the user wants the local interactive workbench first, they can also run:
memorixUse that for local browsing, commands, and quick validation in a TTY.
Inside the TUI workbench, slash commands are available: /chat (or just type a question), /search, /remember, /recent, /resume (or /resume 2 for thread #2), /new, /clear, /doctor, /project, /background, /dashboard, /integrate, /configure, /cleanup, /ingest, /help, /exit. Most have short aliases (e.g. /s, /r, /v, /d, /q).
memorix serveGeneric stdio MCP example:
{
"mcpServers": {
"memorix": {
"command": "memorix",
"args": ["serve"]
}
}
}Generic HTTP MCP example:
{
"mcpServers": {
"memorix": {
"transport": "http",
"url": "http://localhost:3211/mcp"
}
}
}⚠ serverUrl mode requires the background control plane to already be running.
The serverUrl config is a pure HTTP client — it connects to an endpoint but does NOT start the server.
If the control plane is down, the MCP client receives ECONNREFUSED with no auto-recovery.
To guarantee the server is available before the IDE connects, use:
memorix background ensureThis command checks health and auto-starts if needed. Add it to your shell profile or IDE startup script.
Some IDEs (Windsurf, Cursor) use serverUrl in their MCP config and do not support preflight commands.
For those, the background must be started manually or via OS startup (see §4 Step 3b below).
If you choose HTTP mode, do not stop at the URL. The agent must also bind each project session with memorix_session_start(projectRoot=ABSOLUTE_WORKSPACE_PATH) when the workspace path is available.
This is the best path for:
- one workspace
- one agent/IDE
- quick validation
- minimal moving parts
Use this path when the user wants the full Memorix product model.
npm install -g memorix
memorix initIf needed:
git initmemorix background startMain URLs:
- MCP endpoint:
http://localhost:3211/mcp - dashboard:
http://localhost:3211
Companion commands:
memorix background status # Show running state and health
memorix background ensure # Auto-start if not running (idempotent, silent when healthy)
memorix background logs # Show recent log output
memorix background stop # Stop the background control plane
memorix background restart # Stop + startmemorix background start spawns a detached process that survives the terminal, but it does not survive system reboots or user logouts.
The background control plane is a persistent server — it is designed to run continuously in the background, not to be auto-launched by MCP clients on demand.
To make it truly persistent:
Windows — add to shell profile ($PROFILE):
memorix background ensuremacOS/Linux — add to shell profile (.bashrc, .zshrc):
memorix background ensure 2>/dev/nullOr use a launchd plist / systemd user service for true boot-time persistence.
Why this matters: IDEs that use serverUrl (Windsurf, Cursor HTTP mode) connect to http://localhost:3211/mcp but cannot start the server. If the control plane is down, the IDE shows an MCP error with no recovery path. The user must run memorix background start or ensure manually.
At startup, serve-http seeds its default project root from:
--cwdMEMORIX_PROJECT_ROOT~/.memorix/last-project-rootprocess.cwd()
That startup root is useful for dashboard and server boot, but it does not replace explicit session binding.
At session start, call:
{
"agent": "your-agent-name",
"projectRoot": "ABSOLUTE_WORKSPACE_PATH"
}through memorix_session_start.
This is the right path for:
- dashboard users
- multi-agent workflows
- team/task/message usage
- multiple concurrent sessions
- debugging project binding and config provenance
Use this routing logic when helping a user.
- "I just want it working quickly"
- "I only need Cursor / Claude Code / Codex"
- "I don't care about dashboard"
Choose:
memorix serve- simple stdio MCP config
- "I want dashboard"
- "I want HTTP MCP"
- "I want multiple agents / IDEs at once"
- "I want shared HTTP MCP or a live dashboard endpoint"
Choose:
memorix background start- explicit
memorix_session_start(projectRoot=...)
Use:
memorix integrate --agent <agent>This is explicit, opt-in generation.
Use:
memorix hooks install --agent <agent>This is also explicit and opt-in.
Do not assume the user wants every supported IDE directory generated.
Memorix now favors explicit, per-agent installation.
That means:
- it does not need to spray every supported
.xxxdirectory into every repo - the user or agent can select only the integrations they actually need
Important:
- many
.cursor,.windsurf,.claude,.gemini,.opencode, etc. directories are not arbitrary clutter - they are often part of the target IDE's own discovery protocol
- do not promise that all of them can be physically merged into one folder without breaking host detection
What you can say safely:
- Memorix supports on-demand generation
- it does not require generating every integration at once
- different hosts still expect their own directory or config path
Do not confuse these.
Purpose:
- generate IDE/agent integration files
- write MCP config, rules, settings, or plugin files for a specific target
Typical use:
memorix integrate --agent cursor
memorix integrate --agent opencode
memorix integrate --agent gemini-cliPurpose:
- install auto-capture hooks for supported agents
Typical use:
memorix hooks install --agent cursor
memorix hooks install --agent opencodePurpose:
- install a post-commit hook in the current Git repo
- automatically ingest commits as Git Memory
Typical use:
memorix git-hook --forceIn HTTP control-plane mode:
- Call
memorix_session_start - Pass:
agent— display name (e.g."cursor-frontend")agentType— optional agent type for Agent Team role mapping (e.g."windsurf","cursor","claude-code","codex","gemini-cli")projectRoot= absolute workspace path
- By default this only starts a lightweight session. It does not auto-register a team identity.
- If the user wants autonomous Agent Team features, either:
- call
memorix_session_startwithjoinTeam: true - or call
team_manage(join)explicitly
- call
- If project binding fails, stop using project-scoped tools until the path is corrected
- Then use:
memorix_searchmemorix_detailmemorix_timelineas needed
In stdio / project-bound mode:
projectRootis optional if the process is already launched from the correct workspace- keep this path lightweight unless the user explicitly asks for team coordination
Important boundary:
team_manage(join)does not make separate Cursor, Windsurf, Codex, or TUI conversation windows magically talk to each other.- For real autonomous multi-agent implementation loops, use
memorix orchestrate; it launches CLI agents, coordinates work through tasks/context, and runs verification/fix/review gates.
memorix serve
memorix background start
memorix serve-http --port 3211
memorix doctor
memorix statusmemorix init
memorix integrate --agent <agent>
memorix hooks install --agent <agent>
memorix git-hook --forceUse MCP tools:
memorix_storememorix_searchmemorix_detailmemorix_timelinememorix_resolvememorix_deduplicatememorix_store_reasoning
If Memorix "doesn't work", check these in order.
If not, run:
git init- stdio MCP client ->
memorix serve - HTTP/dashboard/control-plane use case ->
memorix background startby default, ormemorix serve-http --port 3211when foreground control is required
If the MCP client reports ECONNREFUSED on localhost:3211:
memorix background statusIf it shows "Not running" or "dead":
memorix background ensureIf the client is connected but starts failing after roughly 30 minutes of no Memorix tool use, check for stale HTTP session expiry rather than treating it as project binding failure. Restart the control plane with a longer idle timeout:
$env:MEMORIX_SESSION_TIMEOUT_MS = "86400000"
memorix background restartCommon causes of the background dying:
- System reboot or user logout (background is not a system service)
- Unhandled error in the control plane process (now logged to
~/.memorix/background.log) - Terminal that started it was closed before the process fully detached (rare on Node.js v20+)
The heartbeat file ~/.memorix/background.heartbeat is updated every 30 seconds while the control plane is alive. If status reports a dead process with a recent heartbeat, the control plane crashed — check the log file.
On Windows, some hosts behave better with memorix.cmd than bare memorix.
serverUrl vs command mode:
serverUrl(HTTP) requires the background to already be running — it cannot auto-startcommand(stdio) launchesmemorix serveon demand — no background needed; usememorix dashboardfor a standalone read-mostly dashboard and CLI/team tools for autonomous agent workflows
If using serverUrl and the background keeps disappearing, consider switching to stdio mode as a fallback.
If not, the agent may drift into the wrong project bucket or fail closed.
Use:
memorix integrate --agent <agent>
memorix hooks install --agent <agent>OpenCode in particular now supports stale-install detection through:
memorix hooks statusIf outdated, re-run:
memorix hooks install --agent opencodeCheck:
- project
.env - user
~/.memorix/.env - shell-injected env vars
Use:
memorix doctorto inspect active runtime status.
Do not:
- treat
projectRootas the final project identity - assume non-Git folders will behave like stable projects
- mix up stdio and HTTP guidance in the same answer
- promise that all
.xxxintegration directories can be physically merged - tell users "auto-update is implemented" unless you mean the real wired runtime feature
- rely on stale generated plugin files when diagnosing current behavior
- assume
serverUrlHTTP mode will auto-start the background control plane — it cannot - tell users "just restart the IDE" when the fix is
memorix background ensure - promise the background control plane survives reboots without OS-level startup config
If a user asks any of these:
- "Install Memorix for me"
- "Set up Memorix in Cursor / Claude Code / Codex / Windsurf / OpenCode / Gemini CLI"
- "Why isn't Memorix binding to my project?"
- "Why does it fail in this workspace?"
- "How should I use serve vs serve-http?"
- "What files will this create?"
- "Why does my MCP client show ECONNREFUSED / connection refused?"
- "Why did the background control plane disappear?"
read this document first, then act.
This playbook is the canonical AI-facing operator guide for installation, project binding, integration, hooks, troubleshooting, and safe usage.
When Memorix runs in Docker, treat it as an HTTP control-plane deployment, not a stdio MCP process.
- Connect IDEs and agents to
http://host:3211/mcp - Use
memorix_session_start(projectRoot=...)with a path that is visible inside the container - If the repo is not mounted into the container, project-scoped Git/config semantics will fail closed