Generated banner for memorix
Generated logo for memorix

memorix

Memory server

First committed by AVIDS2

Published in AVIDS2/memorix. Publisher page

926 GitHub stars

What it is

Local-first shared memory layer for AI coding agents across MCP clients, Git history, reasoning context, and project sessions.
— the description by AVIDS2

Summary from the brain’s metadata

Local-first shared memory layer for AI coding agents across MCP clients, Git history, reasoning context, and project sessions. One project memory system for Claude Code, Codex, CodeBuddy Code, Cursor, Windsurf, Copilot, Gemini CLI, OpenCode, Grok Build, OpenClaw, Hermes Agent, Oh-my-Pi, Pi, Kiro, Antigravity, Trae, DeepSeek Harness, WorkBuddy, and any MCP-capable agent.

How it works

Memory model: Hybrid

AutoGineer overview, from the brain’s own files

Memory model: Hybrid. Folders: .github (agent config, 3 files); .windsurf (agent config, 2 files); assets (attachments, 32 files); docs (docs, 65 files); examples (examples, 4 files); packages (source code, 836 files); scripts (scripts, 18 files); src (source code, 382 files). The agent writes CLAUDE.md.

Folders
FolderRoleFiles
.githubagent-config3
.windsurfagent-config2
assetsattachments32
docsdocs65
examplesexamples4
packagessource-code836
scriptsscripts18
srcsource-code382
teststests376
.codegraphfolder1
.opencodefolder1
.traefolder1
articlesfolder5
pluginsfolder64
stubsfolder1

The agent writes

Requirements

Apps: Docker

Runtimes: Node.js >=22.18.0, Bun

Databases: LanceDB, PostgreSQL, SQLite

API keys (by name): ANTHROPIC_API_KEY, API_ROUTE_API_KEY, ATLASCLOUD_API_KEY, CHEAPER_INFERENCE_API_KEY, GROQ_API_KEY, MEMORIX_API_KEY, MEMORIX_EMBEDDING_API_KEY, MEMORIX_HTTP_AUTH_TOKEN, MEMORIX_LLM_API_KEY, MEMORIX_RERANK_API_KEY, MINIMAX_API_KEY, MINIMAX_CN_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, REQUESTY_API_KEY, RUNCRATE_API_KEY

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Google Antigravity, Kiro, OpenCode, Amp, Roo Code, Cline, JetBrains Junie, Devin (ex-Windsurf)

Set it up

  1. This brain runs code automatically: 20 hooks (claude-code, codex). Review plugins/claude/memorix/hooks/hooks.json, plugins/codebuddy/memorix/hooks/hooks.json, plugins/codex/memorix/hooks/hooks.json, plugins/copilot/memorix/hooks/hooks.json before opening the folder in Claude Code. No step below turns a hook on for you.

    • plugins/claude/memorix/hooks/hooks.json: memorix hook
    • plugins/claude/memorix/hooks/hooks.json: memorix hook
    • plugins/claude/memorix/hooks/hooks.json: memorix hook
    • plugins/claude/memorix/hooks/hooks.json: memorix hook
    • plugins/claude/memorix/hooks/hooks.json: memorix hook
    • plugins/codebuddy/memorix/hooks/hooks.json: memorix hook --agent codebuddy
    • plugins/codebuddy/memorix/hooks/hooks.json: memorix hook --agent codebuddy
    • plugins/codebuddy/memorix/hooks/hooks.json: memorix hook --agent codebuddy
    • plugins/codebuddy/memorix/hooks/hooks.json: memorix hook --agent codebuddy
    • plugins/codebuddy/memorix/hooks/hooks.json: memorix hook --agent codebuddy
    • plugins/codex/memorix/hooks/hooks.json: memorix hook --agent codex
    • plugins/codex/memorix/hooks/hooks.json: memorix hook --agent codex
    • plugins/codex/memorix/hooks/hooks.json: memorix hook --agent codex
    • plugins/codex/memorix/hooks/hooks.json: memorix hook --agent codex
    • plugins/codex/memorix/hooks/hooks.json: memorix hook --agent codex
    • plugins/copilot/memorix/hooks/hooks.json: memorix hook --agent copilot
    • plugins/copilot/memorix/hooks/hooks.json: memorix hook --agent copilot
    • plugins/copilot/memorix/hooks/hooks.json: memorix hook --agent copilot
    • plugins/copilot/memorix/hooks/hooks.json: memorix hook --agent copilot
    • plugins/copilot/memorix/hooks/hooks.json: memorix hook --agent copilot
  2. Not scanned by AutoGineerAutoGineer could not scan everything it runs. https://www.npmjs.com/package/memorix
  3. First committed by AVIDS2. Published in AVIDS2/memorix. Licence: Apache License 2.0.

Usage

AutoGineer’s guidance for this type of brain

Add the server to your AI tool’s MCP configuration (see Set it up); your agent then stores and recalls memories through its tools.

Documentation by AVIDS2

<p align="center"> <img src="https://raw.githubusercontent.com/AVIDS2/memorix/main/assets/readme-hero.svg" alt="Memorix" width="720"> </p>

<h1 align="center">Memorix</h1>

<p align="center"> <strong>Local-first shared memory layer for AI coding agents.</strong><br> One project memory system for Claude Code, Codex, CodeBuddy Code, Cursor, Windsurf, Copilot, Gemini CLI, OpenCode, Grok Build, OpenClaw, Hermes Agent, Oh-my-Pi, Pi, Kiro, Antigravity, Trae, DeepSeek Harness, WorkBuddy, and any MCP-capable agent. </p>

<p align="center"> <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/v/memorix.svg?style=for-the-badge&logo=npm&color=cb3837" alt="npm"></a> <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=for-the-badge&logo=npm&label=monthly%20downloads&color=7c3aed" alt="monthly downloads"></a> <a href="https://github.com/AVIDS2/memorix/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/AVIDS2/memorix/ci.yml?style=for-the-badge&label=CI&logo=github" alt="CI"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-2563eb?style=for-the-badge" alt="license"></a> <a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=for-the-badge&logo=github&color=facc15" alt="stars"></a> </p>

<p align="center"> <a href="https://registry.modelcontextprotocol.io/?q=io.github.AVIDS2%2Fmemorix">Listed in the official MCP Registry</a> <br> <a href="https://mcptoplist.com/server/io.github.AVIDS2%2Fmemorix"><img src="https://mcptoplist.com/badge/io.github.AVIDS2%2Fmemorix.svg" alt="View Memorix on MCP Toplist"></a> </p>

<p align="center"> <strong>Shared Project Memory</strong> | <strong>MCP</strong> | <strong>Git Memory</strong> | <strong>Reasoning Memory</strong> | <strong>Plugins</strong> | <strong>Orchestration</strong> </p>

<p align="center"> <a href="https://mem.rglens.com">Website</a> | <a href="README.zh-CN.md">Chinese</a> | <a href="#install">Install</a> | <a href="#capabilities">Capabilities</a> | <a href="#works-with-your-agent">Agents</a> | <a href="#quick-start">Quick Start</a> | <a href="#memory-model">Memory Model</a> | <a href="#memcode-bundled-terminal-agent">memcode</a> | <a href="ACTIVE_WORK.md">Active Work</a> | <a href="#docs">Docs</a> </p>


Maintainer status and the current public work boundary live in ACTIVE_WORK.md. It is the repository's single living work tracker.

<h2 id="what-memorix-is"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-overview.svg"><img src="assets/tags/section-overview.svg" alt="Memorix" height="32" /></picture></h2>

Memorix gives the AI coding agents you already use a shared, searchable project memory that survives new chats, IDE switches, terminal sessions, and handoffs. The memory lives under the Git project, not inside one chat window or one tool.

Use Claude Code today, Codex tomorrow, and Cursor in the afternoon. The agent can change; the project memory stays the same.

Use Memorix when you keep re-explaining the same project to a new agent session: the last session already figured something out, another IDE cannot see it, or a design decision is buried in a chat you cannot find anymore.

ProblemWhat Memorix adds
The next session forgets what the last session learnedProject-scoped memory, session summaries, timelines, and detail retrieval
Different agents know different thingsOne local memory pool available through MCP, hooks, CLI, SDK, and the bundled terminal agent
Git records what changed, but agents cannot recall it wellGit Memory turns commits into searchable engineering facts
Architecture decisions disappear into old chatsReasoning Memory stores why choices were made, with alternatives and trade-offs
Static rule files driftGotchas, fixes, and project skills evolve from real work
Parallel agent work gets messymemorix orchestrate coordinates task context, handoffs, locks, verification, and review loops

Memorix is local-first. SQLite is the canonical store. Small projects use the in-process Orama path; larger projects use a persistent SQLite FTS5 candidate index and, when available, an optional local LanceDB semantic shadow index. Both indexes are rebuildable and are never a limit on how many durable memories you can keep. LLM-backed formation and embedding remain optional.

Capabilities

Memorix is more than a memory store. It also installs agent integrations, keeps useful work events, turns commits into project facts, exposes a local control plane, and can coordinate multi-agent work when a task needs it.

CapabilityWhat it doesEntry point
Memory AutopilotA bounded task Workset with start files, current memory, source-backed knowledge, workflow starts, cautions, and verification. Compact JSON receipts keep fallback CLI use bounded too.memorix context "..." --brief-json, memorix resume "..." --brief-json, memorix_project_context
Observation MemorySearchable facts, fixes, gotchas, session summaries, and implementation notes scoped to the current Git projectmemorix memory, MCP memory tools
Curated Long-term MemoryDeliberately reviewed episodic, semantic, and procedural memory with source evidence. Only an explicitly portable user item can cross local projectsmemorix memory long-term
Code State and Code MemoryVersioned local code snapshots, source-backed TypeScript/JavaScript symbols and relations, file/symbol links, and freshness checks. Other languages keep the honest Lite fallback; an already-indexed local CodeGraph or SCIP result can add a bounded external outline without taking over the local index.memorix codegraph status|refresh|init|sync, automatic context refresh
Git MemoryCommit-derived engineering facts that answer what changed, where, and why it mattersmemorix ingest commit, git hook
Reasoning MemoryDesign rationale, alternatives, trade-offs, and risks that should survive beyond one chatmemorix reasoning, memory formation
Knowledge WorkspaceReview-gated source-backed claims, Markdown pages, and canonical project workflows; proposals never overwrite reviewed pages silentlymemorix knowledge, memorix knowledge workflow
Agent setupOne setup path for MCP, rules, hooks, skills, plugins, bundles, or extensions depending on the agentmemorix setup --agent <agent>
Agent doctorChecks whether agent MCP config and guidance are current, then repairs Memorix-owned entries when neededmemorix doctor agents, memorix repair agents
Hooks and skillsOptional capture from supported agents, plus reusable project skills promoted from durable knowledgememorix hooks, memorix skills
Dashboard and HTTPA local web UI and shared MCP endpoint for browsing memory, project state, teams, diagnostics, and preview-first cleanup, consolidation, deduplication, and retention actionsmemorix dashboard, memorix background start
Orchestration and team workTask planning, worker handoffs, file locks, messages, verification gates, and review loopsmemorix orchestrate, memorix team, memorix lock
memcodeA bundled terminal coding agent that already reads and writes the same project memorymemorix, memcode
CLI and SDKScriptable access for automation, imports/exports, diagnostics, and custom integrationsmemorix ..., createMemoryClient()
Optional multi-device syncPrivacy-filtered observation events with local SQLite kept canonical; default project scope, optional --scope user for every local project; GitHub JSONL, filesystem, S3, or Postgres relaymemorix sync store status|push|pull

<h2 id="works-with-your-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>

Memorix connects through the interfaces each agent already supports: plugin packages, MCP, project rules, hooks, skills, or the bundled terminal agent. memorix setup chooses the right setup for each agent and keeps stdio MCP as the default transport.

<table> <tr> <td align="center" width="12.5%"> <a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Claude Code" width="48" height="48"></a><br> <strong>Claude Code</strong><br> <sub>official plugin + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="Codex CLI" width="48" height="48"></a><br> <strong>Codex CLI</strong><br> <sub>official plugin + MCP + AGENTS.md</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/features/copilot"><img src="https://github.githubassets.com/images/modules/site/copilot/copilot.png" alt="GitHub Copilot CLI" width="48" height="48"></a><br> <strong>GitHub Copilot CLI</strong><br> <sub>plugin + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://cursor.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/cursor_dark.svg"><img src="https://svgl.app/library/cursor_light.svg" alt="Cursor" width="48" height="48"></picture></a><br> <strong>Cursor</strong><br> <sub>MCP + rules + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://windsurf.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/windsurf-dark.svg"><img src="https://svgl.app/library/windsurf-light.svg" alt="Windsurf" width="48" height="48"></picture></a><br> <strong>Windsurf</strong><br> <sub>MCP + rules + hooks</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/google-gemini/gemini-cli"><img src="https://github.com/google-gemini.png?size=120" alt="Gemini CLI" width="48" height="48"></a><br> <strong>Gemini CLI</strong><br> <sub>extension + MCP + hooks + skills</sub> </td> </tr> <tr> <td align="center" width="12.5%"> <a href="https://github.com/opencode-ai/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode" width="48" height="48"></picture></a><br> <strong>OpenCode</strong><br> <sub>local plugin + MCP + skills + AGENTS.md</sub> </td> <td align="center" width="12.5%"> <a href="https://pi.dev"><img src="https://pi.dev/favicon.svg" alt="pi coding agent" width="48" height="48"></a><br> <strong>pi coding agent</strong><br> <sub>package + extension + skill</sub> </td> <td align="center" width="12.5%"> <a href="https://kiro.dev"><img src="https://kiro.dev/icon.svg" alt="Kiro" width="48" height="48"></a><br> <strong>Kiro</strong><br> <sub>MCP + steering + hooks</sub> </td> <td align="center" width="12.5%"> <a href="https://antigravity.google"><img src="https://antigravity.google/assets/image/antigravity-logo.png" alt="Antigravity" width="48" height="48"></a><br> <strong>Antigravity</strong><br> <sub>plugin + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://www.trae.ai"><img src="https://github.com/Trae-AI.png?size=120" alt="Trae" width="48" height="48"></a><br> <strong>Trae</strong><br> <sub>MCP + project rules</sub> </td> <td align="center" width="12.5%"> <img src="https://raw.githubusercontent.com/AVIDS2/memorix/main/assets/logo.png" alt="memcode" width="48" height="48"><br> <strong>memcode</strong><br> <sub>bundled terminal agent</sub> </td> </tr> <tr> <td align="center" width="12.5%"> <a href="https://docs.openclaw.ai"><img src="https://raw.githubusercontent.com/openclaw/openclaw/main/ui/public/favicon.svg" alt="OpenClaw" width="48" height="48"></a><br> <strong>OpenClaw</strong><br> <sub>bundle + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://hermes-agent.nousresearch.com"><img src="https://hermes-agent.nousresearch.com/icon.png" alt="Hermes Agent" width="48" height="48"></a><br> <strong>Hermes Agent</strong><br> <sub>plugin + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://omp.sh"><img src="https://omp.sh/favicon.png" alt="Oh-my-Pi" width="48" height="48"></a><br> <strong>Oh-my-Pi</strong><br> <sub>package + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://github.com/deepseek-ai.png?size=120" alt="DeepSeek Harness" width="48" height="48"></a><br> <strong>DeepSeek Harness</strong><br> <sub>MCP patch + AGENTS.md + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://modelcontextprotocol.io"><img src="https://github.com/modelcontextprotocol.png?size=120" alt="Any MCP Client" width="48" height="48"></a><br> <strong>Any MCP Client</strong><br> <sub>stdio or HTTP MCP</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/xai-org/grok-build"><picture><source media="(prefers-color-scheme: dark)" srcset="https://media.x.ai/v1/website/spacexai-symbol-white-transparent-0c31957f.png"><img src="https://media.x.ai/v1/website/spacexai-symbol-black-transparent-6435cf42.png" alt="Grok Build" width="48" height="48"></picture></a><br> <strong>Grok Build</strong><br> <sub>native hooks + AGENTS.md</sub> </td> </tr> </table>

<p align="center"> <sub>Works with agents that speak MCP, expose hooks/rules, or support plugin/package entries. One local-first memory layer shared across all of them.</sub> </p>

Integration surfaces:

SurfaceWhat it doesMemorix entry
Setup commandInstalls the recommended one-time user-level Memorix integrationmemorix setup --agent <agent> --global
MCPGives an agent compact Memorix tools for project context, search, detail retrieval, storage, and resolutionbundled in setup packages or memorix serve
Usage guidanceTeaches an agent when and how to use Memorix without forcing memory lookup on every promptbundled or generated by memorix setup
HooksOptional capture of prompts, tool events, file edits, session lifecycle events, and native compaction checkpoints where the agent exposes thembundled or generated by memorix setup
Plugin or bundle packageInstalls plugin, compatible-bundle, or package files where the agent supports themClaude Code, Codex, CodeBuddy Code, GitHub Copilot CLI, Antigravity, OpenClaw, Hermes Agent, Oh-my-Pi, Pi
ExtensionInstalls extension files where the agent supports themGemini CLI
Local pluginInstalls local plugin files where the agent loads them directlyOpenCode
MCP/rules configWrites MCP, rules, steering, guidance, or hook config for IDEs and agents that expose those surfacesCursor, Windsurf, Kiro, Trae, DeepSeek Harness, WorkBuddy
SkillsTurns durable project knowledge into reusable task guidancememorix skills and memorix_promote
memcodeOpens the bundled terminal agent that already uses Memorix memorymemorix or memcode

See Integration Surfaces for the current support matrix and what each generated file means.

Use the same setup command without --global only when you intentionally want repo-local guidance, rules, or hooks in the current Git project.

CLI, MCP, and HTTP are different entry points:

  • memorix CLI is the direct command surface for setup, memory search/store, Git Memory, import/export, dashboard, orchestration, diagnostics, and automation.

  • memorix serve is the stdio MCP bridge used by IDEs and coding agents. Its default tool profile is micro, so agents see only the compact core tool set.

  • memorix background start / memorix serve-http run the HTTP service for a shared endpoint, dashboard, VPS Docker deployment, or multiple clients.

Multi-device store sync is opt-in and separate from HTTP sharing. It never uploads the live SQLite database or WAL files. By default it only relays qualified project-visible observations for the current Git project; personal, agent-targeted, candidate, and ephemeral records stay local. Pass --scope user to include every local project. Set MEMORIX_SYNC_PROVIDER and inspect memorix sync store status --json before the first push.

<h2 id="install"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-install.svg"><img src="assets/tags/section-install.svg" alt="Install" height="32" /></picture></h2>

Requirements:

  • Node.js >=22.18.0

  • Git, because project identity is derived from the real Git root

Install and initialize:

npm install -g memorix
memorix init --global                   # optional defaults
memorix setup --agent claude --global   # or codex, copilot, cursor, pi, gemini-cli, opencode,
                                       # codebuddy, windsurf, kiro, antigravity, trae, openclaw, hermes, omp

memorix init is optional. It creates or updates TOML configuration:

  • ~/.memorix/config.toml for global defaults

  • <git-root>/memorix.toml for optional project overrides

Legacy memorix.yml, .env, and ~/.memorix/config.json are still read for compatibility, but new setup flows use TOML.

If you want repo-local guidance or hooks for a specific repository, run the same setup command from inside that repo without --global. Codex is the exception: its supported path is the user-level plugin install, so Memorix leaves project .codex configuration alone.

<h2 id="quick-start"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-quick-start.svg"><img src="assets/tags/section-quick-start.svg" alt="Quick Start" height="32" /></picture></h2>

Connect an existing agent

Use the setup command first. The global form is the normal one-time install:

memorix setup --agent claude --global
memorix setup --agent codex --global
memorix setup --agent copilot --global
memorix setup --agent cursor --global
memorix setup --agent pi --global
memorix setup --agent gemini-cli --global
memorix setup --agent opencode --global
memorix setup --agent windsurf --global
memorix setup --agent kiro --global
memorix setup --agent antigravity --global
memorix setup --agent trae --global
memorix setup --agent openclaw --global
memorix setup --agent hermes --global
memorix setup --agent codebuddy --global
memorix setup --agent omp --global
memorix setup --agent dsh --global
memorix setup --agent workbuddy --global
memorix setup --agent grok --global

What it installs depends on the target agent, but the goal is the same: make Memorix available wherever you open that agent without asking you to wire every repo by hand.

  • Claude Code: installs the Memorix plugin package, adds CLAUDE.md guidance, and enables hook capture when you do not pass --noHooks.

  • Codex: installs one user-level Memorix plugin with bundled stdio MCP, skills, and lifecycle hooks. It does not write project-local .codex config or change your model, approval, or sandbox settings. When Codex asks, review the plugin hook definition once with /hooks; --noHooks skips automatic capture.

  • GitHub Copilot CLI: installs the Copilot plugin package and official Memorix skills.

  • Pi: installs the Pi extension/skills package and native MCP config (Pi 1.0+): ~/.pi/agent/mcp.json with --global, or .pi/mcp.json for project setup.

  • Cursor: writes Cursor MCP/rules/config entries in the chosen scope.

  • Gemini CLI: installs the extension package, GEMINI.md context, hooks, and skills. Antigravity CLI has an official Gemini CLI migration path, but Gemini CLI remains an active standalone target.

  • OpenCode: installs the local plugin file, opencode.json, skills, and AGENTS.md guidance.

  • Windsurf, Kiro, Trae: write the MCP/rules/hooks files the target supports.

  • Antigravity: installs the official plugin package with plugin.json, mcp_config.json, hooks.json, rules, and skills under ~/.gemini/config/plugins/memorix or .agents/plugins/memorix.

  • OpenClaw: installs an OpenClaw-compatible bundle with .mcp.json, official skills, and an OpenClaw HOOK.md/handler.ts hook pack.

  • Hermes Agent: installs into Hermes home (%LOCALAPPDATA%\hermes on native Windows, ~/.hermes elsewhere, or HERMES_HOME), enables the plugin in config.yaml, registers plugin hooks, slash/CLI commands, skills, and writes MCP config.

  • CodeBuddy Code: installs a user-scope local marketplace plugin under ~/.codebuddy/memorix-local with MCP, skills, and hooks. It does not change existing CodeBuddy model, permission, or settings files; CodeBuddy keeps third-party hook approval in its own /hooks flow.

  • Oh-my-Pi: installs an omp.extensions package with extension hook events, a memorix command, official skills, and writes MCP config.

  • DeepSeek Harness: writes a Memorix @deepseek-ai/dsh-mcp-client row into $DSH_HOME/cordis.patch.yml (default ~/.dsh/cordis.patch.yml), appends guidance to the harness AGENTS.md, and installs official skills under $DSH_HOME/skills. The row follows DSH's own shipped Memorix reference, so tools appear as mcp__memorix__*.

  • WorkBuddy: writes a Memorix MCP server row into ~/.workbuddy/mcp.json (or <project>/.workbuddy/mcp.json for project installs) and appends guidance to AGENTS.md. Tools appear as mcp__memorix__*; there is no hooks surface.

  • Grok Build: installs native lifecycle hooks under ~/.grok/hooks/memorix.json and guidance in ~/.grok/AGENTS.md. MCP stays host-owned by default; pass --mcp http to write [mcp_servers.memorix] with url = "http://localhost:3211/mcp". Project-local hooks require Grok /hooks-trust, while global hooks are trusted. Set GROK_HOME to use a custom Grok home.

Need a quieter install? Add --noHooks for targets where setup can control hook capture separately from the host's official package entry. It keeps MCP and guidance, but skips Memorix hook capture.

If you intentionally want repo-local guidance or hooks, run the same command inside that repository without --global.

If your agent only needs a manual MCP entry, use stdio:

{
  "mcpServers": {
    "memorix": {
      "command": "memorix",
      "args": ["serve"]
    }
  }
}

For an npm-based MCP client or registry tester, use the complete command npx -y memorix serve. The serve argument matters: memorix without arguments opens the bundled memcode terminal agent when run by a human, while MCP clients should start the stdio server explicitly.

For a manually managed Claude Code entry, add "alwaysLoad": true inside the memorix server object. This lets Claude Code expose Memorix tools during print-mode startup; memorix doctor agents --agent claude can detect and repair a missing setting.

HTTP is not required for normal setup. Use it only when you intentionally want a shared background service, dashboard, VPS Docker deployment, or multiple clients using the same endpoint. Local development uses the Node service directly and does not require Docker:

memorix background start

Then point the client at:

http://localhost:3211/mcp

In HTTP mode, agents should bind the active repo explicitly with memorix_session_start(projectRoot=...) when the client can provide the workspace path. Git remains the final source of truth for project identity.

Uninstall

Preview what will be removed:

memorix uninstall --dry-run

Stop the background service and remove hooks:

memorix uninstall --background --hooks

Full cleanup:

memorix uninstall --yes --background --hooks --purge-data
npm uninstall -g memorix

memorix uninstall reports MCP config entries for manual cleanup instead of silently editing every MCP file it finds.

Work from the CLI
memorix --cwd /path/to/repo resume "continue release blocker"
memorix checkpoint list
memorix memory search --query "release blocker"
memorix memory --help

# Optional: activate one local agent identity for personal/team records and coordination.
memorix identity join --agent-type codex --name codex-main
memorix memory store --text "private investigation note" --visibility personal
memorix task create --description "verify the release package"

# Deliberate durable memory: create a candidate, then review it before it can enter a Workset.
memorix memory long-term add --kind procedural --scope user --portability portable --title "Release verification preference" --text "Run focused tests and a packed-package smoke before publishing." --applicability "When publishing an npm package."
memorix memory long-term qualify --id <id> --reason "The user explicitly confirmed this preference."
memorix memory long-term approve --id <id> --reason "Reviewed for future local projects."

memorix transfer export --format json --out ./.memorix-export.json
memorix transfer import --file ./.memorix-export.json
memorix reasoning search --query "why sqlite"
memorix git-hook --force
memorix ingest log --count 20
memorix workbench

The CLI is direct and does not depend on an MCP session. It binds to the current Git project, or to the project supplied with --cwd. Without an active identity it reads, writes, and exports project-visible memory only. Use memorix identity join or memorix identity use --agent-id <id> only when you intentionally need personal/team memory or coordinated task actions; memorix identity clear returns the terminal to project scope. --as <active-agent-id> is the one-command alternative for scripts. Both camelCase and kebab-case flags are accepted.

Manage controlled media

Media is opt-in. An explicit local import is copied into Memorix's local data directory, hashed, and kept outside the Git worktree. It becomes normal memory only when you attach it. Memorix never captures every screenshot or tool output. An asset may be up to the configured media limit (100 MiB by default). Automatic vision analysis is deliberately capped at 20 MiB; a larger image is still kept and can be attached, but Memorix records a clear text fallback instead of sending an oversized payload to a model provider.

memorix media import --path ./architecture.png --json
memorix media attach --asset <asset-id> --title "Architecture diagram" --json
memorix media list --kind image --json
memorix media show --asset <asset-id> --json
memorix media remove --asset <asset-id> --force --json

# Controlled derivations: explicit, bounded, and attachable to memory.
memorix media derive-pdf --asset <asset-id> --attach --json
memorix media derive-audio --asset <asset-id> --attach --json

# Legacy image analysis now uses the same controlled asset lifecycle.
memorix ingest image --path ./architecture.png --json

MiniMax image generation is a deliberate CLI operation. Video generation returns a durable job immediately; inspect or cancel that job rather than waiting in an agent request.

# Configure MINIMAX_API_KEY in your user environment or .env, never in Git.
memorix media generate image --prompt "A clean system architecture diagram" --json
# Image-to-image with a reference image (MiniMax image-01 / image-01-live):
memorix media generate image --prompt "Keep the subject, change the background" --image ./reference.png --json
memorix media generate video --prompt "A short product walkthrough" --json
memorix media status --job <media-job-id> --json
memorix media cancel --job <media-job-id> --json

memorix_media is the compact MCP companion in every profile, including micro. It supports import, attach, list, show, PDF/audio derivations, generation, and job status. MCP image and video generation are disabled by default because they may incur provider costs. Set MEMORIX_MCP_MEDIA_GENERATION=1 only after you deliberately want an agent to request billed MiniMax output. The normal OpenRouter text embedding lane is still text-only; media vectors are created only by a provider that explicitly declares support for that modality. Text descriptions and attachments remain a useful ordinary retrieval fallback.

Use the bundled terminal agent
memorix
# or
memcode

This opens memcode, a terminal coding agent that uses the same Memorix project memory as your MCP-connected agents.

<h2 id="memory-model"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-memory-model.svg"><img src="assets/tags/section-memory-model.svg" alt="Memory Model" height="32" /></picture></h2>

LayerStoresBest for
Observation Memoryfacts, gotchas, fixes, implementation notes"How does this work?"
Reasoning Memoryrationale, alternatives, constraints, risks"Why did we choose this?"
Git Memorycommit-derived engineering facts"What changed and where?"
Code Memoryfiles, symbols, import edges, and memory-to-code freshness"Which current code should I inspect first?"
Curated Long-term Memoryreviewed episodic events, stable facts, or reusable procedures with evidence"What should this agent still know or do later?"
Compact Continuityrecent host-native compact summaries or lifecycle markers"What survived the last context compaction?"

Search is project-scoped by default. scope="global" searches across projects. The search boosts Git Memory for "what changed" questions and reasoning records for "why" questions.

Long-term memory is deliberately not an automatic dump of every note. A source observation, Claim, workflow, session, and code snapshot keep their existing roles. An agent may ask memorix_store to create an additional long-term record; an explicit request auto-qualifies and enters task briefs as a durable anchor, while hook-captured or Git-derived candidates stay pending until qualified. Approval stays an explicit operator review. Use memorix memory long-term approve|archive|supersede to record the evidence-backed lifecycle. Only a manually created or user-confirmed user + portable item may be considered in another local project; project code, Git facts, tests, workflows, sessions, and observations cannot be promoted into portable user memory.

memorix context "..." is the default Memory Autopilot entry. It builds a compact task-lensed brief for agents: bugfix tasks lean toward tests and repros, release tasks lean toward package/changelog/build checks, onboarding tasks lean toward docs and entry points, and stale or unrelated memories stay in warning lanes instead of flooding the prompt. Use --fallback --brief-json when MCP is unavailable and a CLI fallback needs the same bounded brief plus a receipt of what was selected or omitted; --json remains the detailed diagnostic form. A normal new task does not receive an old-session dump. For an explicit continuation, memorix resume "..." adds only the latest useful session summary, up to three readable durable anchors, and at most one recent source-labelled host compact checkpoint. A durable anchor carries a durable:<id> reference, so an agent can expand the full reviewed record through memorix_detail only when needed. Keyword matches stay primary; when no reviewed durable item matches and an embedding provider is configured, Memorix makes one 1.8-second, no-retry semantic fallback for paraphrases or cross-language tasks. A slow or unavailable provider simply leaves the normal keyword-only Workset intact. A checkpoint is lifecycle evidence, not durable memory or a transcript backup. Agents should read the suggested files before trusting stored memory.

<h2 id="runtime-modes"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-runtime.svg"><img src="assets/tags/section-runtime.svg" alt="Runtime Modes" height="32" /></picture></h2>

You wantRun
Install an agent integration packagememorix setup --agent <agent> --global
Check or repair an agent integrationmemorix doctor agents --agent <agent>, memorix repair agents --agent <agent>
Manually expose stdio MCPmemorix serve
Run shared HTTP MCP plus dashboardmemorix background start
Debug HTTP MCP in the foregroundmemorix serve-http --port 3211
Inspect or manage memory directlymemorix memory, memorix reasoning, memorix session, memorix ingest, memorix media
Manage reviewed long-term memory`memorix memory long-term list
Retire memories from retrievalmemorix purge (current project), memorix purge --all --yes (everything)
Inspect native compaction continuity`memorix checkpoint list
Use the interactive terminal memory control planememorix workbench
Use the bundled terminal agentmemorix or memcode
Run orchestrated subagent workmemorix orchestrate --goal "..."

memorix serve defaults to --mode micro (9 tools) to keep MCP tool schemas small for agents. memorix setup writes --mode lite (21 tools) into the installed MCP config so the normal memory, continuity, and session surface is reachable. Use --mode team (29 tools) for coordination tools, or --mode full (48 tools) for advanced and compatibility tools such as checkpoint inspection.

Shortcuts and aliases: memorix search / remember / recent are direct query shortcuts, bg/bs start the background service, hook runs the hook launcher, and memorix config get|path|migrate inspects or migrates config files.

memorix orchestrate uses the current checkout for single-worker runs. When running multiple workers, it creates task worktrees under .worktrees/ and merges successful task branches back. Use --isolated to force worktree isolation for one worker, --no-worktree to disable it, --allow-dirty to run with uncommitted changes, and --no-auto-merge to preserve task worktrees for manual review.

<h2 id="memcode-bundled-terminal-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-memcode.svg"><img src="assets/tags/section-memcode.svg" alt="memcode" height="32" /></picture></h2>

memcode is the terminal coding agent bundled with Memorix. It can read, edit, run commands, resume sessions, switch models, and use /memory commands — all backed by the same project memory as your MCP-connected agents.

Use it when you want a terminal agent with memory already wired in.

one Git project -> one shared Memorix memory pool

See docs/MEMCODE.md for the memcode-specific guide.

<h2 id="configuration"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-configuration.svg"><img src="assets/tags/section-configuration.svg" alt="Configuration" height="32" /></picture></h2>

Minimal ~/.memorix/config.toml:

[agent]
provider = "openai"
model = "gpt-4o"
api_key = "..."

[memory.llm]
provider = "openai"
model = "gpt-4o-mini"
api_key = "..."

[embedding]
provider = "auto"

[memory]
inject = "minimal"
formation = "active"

Use [memory.llm] and [embedding] for Memorix memory quality and retrieval. Use [agent] for the model memcode talks to while coding. Keep credentials in global config or environment variables, and do not commit secrets.

For the optional Atlas Cloud memory preset, run memorix init and choose Atlas Cloud, or set provider = "atlascloud" in [memory.llm]. It uses the OpenAI-compatible https://api.atlascloud.ai/v1 endpoint and reads ATLASCLOUD_API_KEY or the explicit MEMORIX_LLM_API_KEY.

For OpenRouter embeddings, use provider = "api", base_url = "https://openrouter.ai/api/v1", and model = "qwen/qwen3-embedding-8b". Memorix accepts OPENROUTER_API_KEY for that embedding endpoint; MEMORIX_EMBEDDING_API_KEY remains the explicit override.

For Requesty, choose Requesty in memorix init or set provider = "requesty" in [memory.llm] (endpoint https://router.requesty.ai/v1, key from REQUESTY_API_KEY or MEMORIX_LLM_API_KEY). Requesty embeddings use provider = "api", base_url = "https://router.requesty.ai/v1", and model = "openai/text-embedding-3-small" with REQUESTY_API_KEY.

For API Route, choose API Route in memorix init or set provider = "apiroute" in [memory.llm]. The preset uses https://global.api-route.com/v1 and deepseek-v4.1-flash, with your own API_ROUTE_API_KEY or MEMORIX_LLM_API_KEY. It is opt-in memory LLM processing; embeddings and memcode's model registry are configured separately. See configuration.

For Cheaper Inference, choose Cheaper Inference in memorix init or set provider = "cheaperinference" in [memory.llm]. The preset uses https://api.cheaperinference.com/v1 and gpt-5.4-mini, with your own CHEAPER_INFERENCE_API_KEY or MEMORIX_LLM_API_KEY. It is opt-in memory LLM processing; embeddings and memcode's model registry are configured separately. See configuration.

For Runcrate, choose Runcrate in memorix init or set provider = "runcrate" in [memory.llm]. The preset uses https://api.runcrate.ai/v1 and the open-weight deepseek-ai/DeepSeek-V4.1-Flash, with your own RUNCRATE_API_KEY or MEMORIX_LLM_API_KEY. It is opt-in memory LLM processing; embeddings and memcode's model registry are configured separately. See configuration.

For controlled MiniMax media generation, set MINIMAX_API_KEY (global) or MINIMAX_CN_API_KEY (China region) in your environment or .env. The media library never stores that key, a signed output URL, or base64 payloads. CLI generation is explicit; MCP generation additionally requires MEMORIX_MCP_MEDIA_GENERATION=1.

<h2 id="docker"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-docker.svg"><img src="assets/tags/section-docker.svg" alt="Docker" height="32" /></picture></h2>

Docker is a VPS/hosted HTTP deployment option, not a requirement for local development or stdio MCP:

docker compose up --build -d

Then open:

  • dashboard: http://localhost:3211

  • MCP: http://localhost:3211/mcp

  • health: http://localhost:3211/health

The container must be able to access the repository path passed as projectRoot for project-scoped Git and config behavior.

<h2 id="sdk"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-sdk.svg"><img src="assets/tags/section-sdk.svg" alt="SDK" height="32" /></picture></h2>

Use Memorix directly from TypeScript:

import { createMemoryClient } from 'memorix/sdk';

const client = await createMemoryClient({ projectRoot: '/path/to/repo' });

await client.store({
  entityName: 'auth-module',
  type: 'decision',
  title: 'Use JWT for API auth',
  narrative: 'Chose JWT because the API is stateless and used by multiple clients.',
});

const results = await client.search({ query: 'auth decision' });
await client.close();

<h2 id="docs"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-docs.svg"><img src="assets/tags/section-docs.svg" alt="Docs" height="32" /></picture></h2>

Start hereUse when
Docs MapYou want the shortest route to the right guide
Setup GuideInstalling, using memorix setup, choosing stdio vs HTTP
Integration SurfacesPlugin packages, MCP, project rules, hooks, and skills support
ConfigurationTOML config, model lanes, compatibility files
API ReferenceMCP tools and CLI commands
Git MemoryCommit ingestion and searchable engineering truth
DockerContainerized HTTP service
memcodeUsing the bundled terminal agent
Agent PlaybookAI-facing execution guide for install, binding, hooks, and troubleshooting
DevelopmentContributing, testing, release checks
ChangelogWhat changed in each release

LLM-friendly summaries: llms.txt and llms-full.txt.

<h2 id="development"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-development.svg"><img src="assets/tags/section-development.svg" alt="Development" height="32" /></picture></h2>

git clone https://github.com/AVIDS2/memorix.git
cd memorix
npm install
npm run lint
npm test
npm run build

Community

Desktop and shell integrations built on Memorix:

  • omarchy-memorix — a native Omarchy shell bar widget: pool stats, live global search, per-project breakdown, recent memories, and a workbench launcher. Read-only over ~/.memorix/data; no daemons, no telemetry.

Built something on top of Memorix? Open a PR to list it here.

<h2 id="acknowledgements"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-acknowledgements.svg"><img src="assets/tags/section-acknowledgements.svg" alt="Acknowledgements" height="32" /></picture></h2>

Memorix draws from the MCP ecosystem and prior memory projects such as mcp-memory-service, MemCP, claude-mem, and Mem0. memcode is based on the Pi coding-agent codebase and adapts its terminal-agent model for the Memorix ecosystem.

<h2 id="license"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-license.svg"><img src="assets/tags/section-license.svg" alt="License" height="32" /></picture></h2>

Apache 2.0

<h2 id="star-history">Star History</h2>

<a href="https://github.com/AVIDS2/memorix/stargazers"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://mem.rglens.com/metrics/star-history-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://mem.rglens.com/metrics/star-history-light.svg"> <img alt="Memorix Star History" src="https://mem.rglens.com/metrics/star-history-light.svg" width="100%"> </picture> </a>

<sub>Updated automatically from GitHub's privacy-safe star history API. No generated PRs.</sub>

README.zh-CN.md

<p align="center"> <img src="https://raw.githubusercontent.com/AVIDS2/memorix/main/assets/readme-hero.svg" alt="Memorix" width="720"> </p>

<h1 align="center">Memorix</h1>

<p align="center"> <strong>面向 AI Coding Agent 的本地优先共享记忆层。</strong><br> 让 Claude Code、Codex、CodeBuddy Code、Cursor、Windsurf、Copilot、Gemini CLI、OpenCode、Grok Build、OpenClaw、Hermes Agent、Oh-my-Pi、Pi、Kiro、Antigravity、Trae、DeepSeek Harness、WorkBuddy 和任何 MCP Agent 共用同一套项目记忆。 </p>

<p align="center"> <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/v/memorix.svg?style=for-the-badge&logo=npm&color=cb3837" alt="npm"></a> <a href="https://www.npmjs.com/package/memorix"><img src="https://img.shields.io/npm/dm/memorix.svg?style=for-the-badge&logo=npm&label=monthly%20downloads&color=7c3aed" alt="monthly downloads"></a> <a href="https://github.com/AVIDS2/memorix/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/AVIDS2/memorix/ci.yml?style=for-the-badge&label=CI&logo=github" alt="CI"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-2563eb?style=for-the-badge" alt="license"></a> <a href="https://github.com/AVIDS2/memorix"><img src="https://img.shields.io/github/stars/AVIDS2/memorix?style=for-the-badge&logo=github&color=facc15" alt="stars"></a> </p>

<p align="center"> <a href="https://registry.modelcontextprotocol.io/?q=io.github.AVIDS2%2Fmemorix">已收录至官方 MCP Registry</a> <br> <a href="https://mcptoplist.com/server/io.github.AVIDS2%2Fmemorix"><img src="https://mcptoplist.com/badge/io.github.AVIDS2%2Fmemorix.svg" alt="在 MCP Toplist 查看 Memorix"></a> </p>

<p align="center"> <strong>共享项目记忆</strong> | <strong>MCP</strong> | <strong>Git Memory</strong> | <strong>Reasoning Memory</strong> | <strong>插件包</strong> | <strong>编排</strong> </p>

<p align="center"> <a href="https://mem.rglens.com">官网</a> | <a href="README.md">English</a> | <a href="#安装">安装</a> | <a href="#能力矩阵">能力矩阵</a> | <a href="#支持你的-agent">Agents</a> | <a href="#快速开始">快速开始</a> | <a href="#记忆模型">记忆模型</a> | <a href="#memcode内置终端-agent">memcode</a> | <a href="ACTIVE_WORK.md">当前工作</a> | <a href="#文档">文档</a> </p>


维护者当前工作状态和公开边界统一记录在 ACTIVE_WORK.md,这是仓库唯一的活动工作文档。

<h2 id="memorix-是什么"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-overview.svg"><img src="assets/tags/section-overview.svg" alt="Memorix" height="32" /></picture></h2>

Memorix 给你已经在用的 AI 编程 Agent 加上一套共享、可检索的项目记忆,让它跨越新对话、切换 IDE、重开终端 session 和交接都不丢失。记忆归属于 Git 项目,不会只困在某个聊天窗口或工具里。

今天用 Claude Code,明天用 Codex,下午切到 Cursor。Agent 可以换,项目记忆不用重来。

什么时候该用 Memorix: 当你一遍遍向新 Agent 重新解释同一个项目时:上个 session 已经搞明白的事丢了,另一个 IDE 看不到这边学到的东西,某个设计决策埋在旧聊天里找不到。

问题Memorix 提供什么
下一个 session 忘了上一个 session 学到的东西项目级记忆、session 摘要、timeline 和 detail 检索
不同 Agent 各记各的通过 MCP、hooks、CLI、SDK 和内置终端 Agent 共用同一套本地记忆池
Git 记录了改动,但 Agent 很难检索工程事实Git Memory 把 commit 转成可搜索的工程记忆
架构决策散落在旧聊天里Reasoning Memory 存储原因、替代方案和 trade-off
静态规则文件容易过期坑点、修复和项目技能从真实工作中持续沉淀
并行 Agent 工作容易乱memorix orchestrate 负责协调任务上下文、交接、文件锁、验证和 review 流程

Memorix 是本地优先的。SQLite 是权威存储。小项目使用进程内 Orama;数据量较大时,关键词检索使用持久化的 SQLite FTS5 候选索引,并在可用时使用本地 LanceDB 语义影子索引。索引都可以重建,也不会限制你能长期保存多少条记忆。LLM 记忆整理和 embedding 仍然是可选能力。

能力矩阵

Memorix 不只是一个记忆库。它还负责安装 Agent 接入、保留有用的工作事件、把 commit 转成工程事实、提供本地控制面,并在需要时协调多 Agent 工作。

能力作用入口
Memory Autopilot给新 Agent session 一份有预算的任务 Workset,包含起步文件、当前记忆、来源知识、工作流首步、风险提示和验证建议。CLI 回退可用紧凑 JSON 回执,不再读取整套内部对象。memorix context "..." --brief-json、memorix resume "..." --brief-json、memorix_project_context
Observation Memory当前 Git 项目内可检索的事实、修复、坑点、session 摘要和实现记录memorix memory、MCP memory tools
受管理的长期记忆有来源证据、可审核的情景/语义/程序记忆;只有明确标为可携带的用户记忆才可在本机跨项目使用memorix memory long-term
Code State 和 Code Memory可版本化的本地代码快照、来源可追溯的 TypeScript/JavaScript 符号和关系、文件 / symbol 关联及 freshness 检查。其它语言保留诚实的 Lite 兜底;已有本地 CodeGraph 或 SCIP 结果可以补充有预算的外部轮廓,但不会接管本地索引。memorix codegraph status|refresh|init|sync、自动 context refresh
Git Memory从 commit 中提取工程事实,回答改了什么、在哪里改、为什么重要memorix ingest commit、git hook
Reasoning Memory保存设计原因、备选方案、trade-off 和风险,不让决策只留在一次聊天里memorix reasoning、memory formation
Knowledge Workspace有审核门槛的来源证据 Claim、Markdown 知识页和规范化项目工作流;提案不会悄悄覆盖已审阅页面memorix knowledge、memorix knowledge workflow
Agent setup按目标 Agent 写入 MCP、rules、hooks、skills、plugin、bundle 或 extensionmemorix setup --agent <agent>
Agent doctor检查 Agent 的 MCP 配置和规则是否是当前版本,并修复 Memorix 自己管理的条目memorix doctor agents、memorix repair agents
Hooks 和 skills在支持的 Agent 中可选捕获工作事件,并把稳定知识提升成可复用项目技能memorix hooks、memorix skills
Dashboard 和 HTTP本地 Web UI 与共享 MCP endpoint,用于浏览记忆、项目状态、团队和诊断,并在预览确认后执行清理、合并、去重和保留归档memorix dashboard、memorix background start
Orchestration 和团队协作任务规划、worker 交接、文件锁、消息、验证门和 review loopmemorix orchestrate、memorix team、memorix lock
memcode内置终端 Coding Agent,默认读写同一套项目记忆memorix、memcode
CLI 和 SDK给自动化、导入导出、诊断和自定义集成使用的本地接口memorix ...、createMemoryClient()
可选多设备同步经过隐私过滤的记忆事件同步;本地 SQLite 仍是主库;默认按当前项目,可用 --scope user 覆盖全部本地项目memorix sync store status|push|pull

<h2 id="支持你的-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-agents.svg"><img src="assets/tags/section-agents.svg" alt="Works with every agent" height="32" /></picture></h2>

Memorix 通过目标 Agent 已有的接口接入:插件包、MCP、项目规则、hooks、skills,或者内置终端 Agent。memorix setup 会为每个 Agent 选择合适的接入方式,默认使用 stdio MCP。

<table> <tr> <td align="center" width="12.5%"> <a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Claude Code" width="48" height="48"></a><br> <strong>Claude Code</strong><br> <sub>官方插件 + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="Codex CLI" width="48" height="48"></a><br> <strong>Codex CLI</strong><br> <sub>官方插件 + MCP + AGENTS.md</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/features/copilot"><img src="https://github.githubassets.com/images/modules/site/copilot/copilot.png" alt="GitHub Copilot CLI" width="48" height="48"></a><br> <strong>GitHub Copilot CLI</strong><br> <sub>插件 + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://cursor.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/cursor_dark.svg"><img src="https://svgl.app/library/cursor_light.svg" alt="Cursor" width="48" height="48"></picture></a><br> <strong>Cursor</strong><br> <sub>MCP + rules + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://windsurf.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/windsurf-dark.svg"><img src="https://svgl.app/library/windsurf-light.svg" alt="Windsurf" width="48" height="48"></picture></a><br> <strong>Windsurf</strong><br> <sub>MCP + rules + hooks</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/google-gemini/gemini-cli"><img src="https://github.com/google-gemini.png?size=120" alt="Gemini CLI" width="48" height="48"></a><br> <strong>Gemini CLI</strong><br> <sub>extension + MCP + hooks + skills</sub> </td> </tr> <tr> <td align="center" width="12.5%"> <a href="https://github.com/opencode-ai/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode" width="48" height="48"></picture></a><br> <strong>OpenCode</strong><br> <sub>local plugin + MCP + skills + AGENTS.md</sub> </td> <td align="center" width="12.5%"> <a href="https://pi.dev"><img src="https://pi.dev/favicon.svg" alt="pi coding agent" width="48" height="48"></a><br> <strong>pi coding agent</strong><br> <sub>package + extension + skill</sub> </td> <td align="center" width="12.5%"> <a href="https://kiro.dev"><img src="https://kiro.dev/icon.svg" alt="Kiro" width="48" height="48"></a><br> <strong>Kiro</strong><br> <sub>MCP + steering + hooks</sub> </td> <td align="center" width="12.5%"> <a href="https://antigravity.google"><img src="https://antigravity.google/assets/image/antigravity-logo.png" alt="Antigravity" width="48" height="48"></a><br> <strong>Antigravity</strong><br> <sub>plugin + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://www.trae.ai"><img src="https://github.com/Trae-AI.png?size=120" alt="Trae" width="48" height="48"></a><br> <strong>Trae</strong><br> <sub>MCP + project rules</sub> </td> <td align="center" width="12.5%"> <img src="https://raw.githubusercontent.com/AVIDS2/memorix/main/assets/logo.png" alt="memcode" width="48" height="48"><br> <strong>memcode</strong><br> <sub>内置终端 Agent</sub> </td> </tr> <tr> <td align="center" width="12.5%"> <a href="https://docs.openclaw.ai"><img src="https://raw.githubusercontent.com/openclaw/openclaw/main/ui/public/favicon.svg" alt="OpenClaw" width="48" height="48"></a><br> <strong>OpenClaw</strong><br> <sub>bundle + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://hermes-agent.nousresearch.com"><img src="https://hermes-agent.nousresearch.com/icon.png" alt="Hermes Agent" width="48" height="48"></a><br> <strong>Hermes Agent</strong><br> <sub>plugin + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://omp.sh"><img src="https://omp.sh/favicon.png" alt="Oh-my-Pi" width="48" height="48"></a><br> <strong>Oh-my-Pi</strong><br> <sub>package + MCP + hooks + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://github.com/deepseek-ai.png?size=120" alt="DeepSeek Harness" width="48" height="48"></a><br> <strong>DeepSeek Harness</strong><br> <sub>MCP patch + AGENTS.md + skills</sub> </td> <td align="center" width="12.5%"> <a href="https://modelcontextprotocol.io"><img src="https://github.com/modelcontextprotocol.png?size=120" alt="Any MCP Client" width="48" height="48"></a><br> <strong>Any MCP Client</strong><br> <sub>stdio or HTTP MCP</sub> </td> <td align="center" width="12.5%"> <a href="https://github.com/xai-org/grok-build"><picture><source media="(prefers-color-scheme: dark)" srcset="https://media.x.ai/v1/website/spacexai-symbol-white-transparent-0c31957f.png"><img src="https://media.x.ai/v1/website/spacexai-symbol-black-transparent-6435cf42.png" alt="Grok Build" width="48" height="48"></picture></a><br> <strong>Grok Build</strong><br> <sub>原生 hooks + AGENTS.md</sub> </td> </tr> </table>

<p align="center"> <sub>支持 MCP、hooks/rules 或插件/包入口的 Agent。所有 Agent 共用同一套本地优先记忆层。</sub> </p>

接入面:

接入面作用Memorix 入口
Setup 命令一次性安装推荐的用户级 Memorix 接入memorix setup --agent <agent> --global
MCP给 Agent 提供搜索、详情检索、写入、reasoning 和协同工具setup 包内置,或手动运行 memorix serve
使用规范告诉 Agent 什么时候、怎么使用 Memorix,而不是每轮都强制查记忆由 memorix setup 打包或生成
Hooks在 Agent 支持时可选地捕获 prompt、tool 事件、文件编辑、session 生命周期和原生上下文压缩检查点由 memorix setup 打包或生成
插件 / Bundle / Package给支持插件、兼容 bundle 或 package 的 Agent 安装对应文件Claude Code、Codex、CodeBuddy Code、GitHub Copilot CLI、Antigravity、OpenClaw、Hermes Agent、Oh-my-Pi、Pi
Extension给支持 extension 的 Agent 安装对应文件Gemini CLI
本地插件给直接加载本地插件文件的 Agent 安装插件OpenCode
MCP / rules 配置给支持 MCP、rules、steering、guidance 或 hooks 的 IDE 和 Agent 写入配置Cursor、Windsurf、Kiro、Trae、DeepSeek Harness
Skills把沉淀下来的项目知识提升成可复用任务指导memorix skills 和 memorix_promote
memcode打开已经接好 Memorix 记忆的内置终端 Agentmemorix 或 memcode

当前支持矩阵和各类生成文件说明见 集成形态。

如果你想给某个仓库写项目级指导、规则或 hooks,再在那个仓库里运行一次不带 --global 的 memorix setup --agent <agent>。

CLI、MCP 和 HTTP 是不同入口:

  • memorix CLI 用于直接操作:setup、记忆搜索/写入、Git Memory、导入导出、Dashboard、编排、诊断和自动化。

  • memorix serve 是给 IDE / Coding Agent 使用的 stdio MCP 桥。

  • memorix background start / memorix serve-http 是 HTTP 服务,用于共享端点、Dashboard、VPS Docker 部署或多客户端。

多设备记忆同步是可选功能,和 HTTP 共享服务不是一回事。它不会上传 memorix.db、WAL 或 SHM 文件。默认只同步当前 Git 项目中已确认且项目可见的 观察记录;个人、指定 Agent、候选和短期记录会留在本地。传入 --scope user 可覆盖全部本地项目。设置 MEMORIX_SYNC_PROVIDER 后,先运行 memorix sync store status --json 再 push。

<h2 id="安装"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-install.svg"><img src="assets/tags/section-install.svg" alt="安装" height="32" /></picture></h2>

要求:

  • Node.js >=22.18.0

  • Git,因为项目身份来自真实 Git root

安装并初始化:

npm install -g memorix
memorix init --global                   # 可选默认配置
memorix setup --agent claude --global   # 也可以是 codex、copilot、cursor、pi、gemini-cli、opencode、
                                       # codebuddy、windsurf、kiro、antigravity、trae、openclaw、hermes、omp

memorix init 是可选的,它会创建或更新 TOML 配置:

  • ~/.memorix/config.toml:全局默认配置

  • <git-root>/memorix.toml:可选项目覆盖配置

旧的 memorix.yml、.env 和 ~/.memorix/config.json 仍兼容读取,但新文档和新初始化流程都以 TOML 为准。

如果你想给某个仓库加项目级指导或 hooks,就在那个仓库目录里再跑一次不带 --global 的 memorix setup --agent <agent>。

<h2 id="快速开始"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-quick-start.svg"><img src="assets/tags/section-quick-start.svg" alt="快速开始" height="32" /></picture></h2>

连接现有 Agent

先用 setup 命令。全局形式是一键接入的默认路径:

memorix setup --agent claude --global
memorix setup --agent codex --global
memorix setup --agent copilot --global
memorix setup --agent cursor --global
memorix setup --agent pi --global
memorix setup --agent gemini-cli --global
memorix setup --agent opencode --global
memorix setup --agent windsurf --global
memorix setup --agent kiro --global
memorix setup --agent antigravity --global
memorix setup --agent trae --global
memorix setup --agent openclaw --global
memorix setup --agent hermes --global
memorix setup --agent codebuddy --global
memorix setup --agent omp --global
memorix setup --agent dsh --global
memorix setup --agent workbuddy --global
memorix setup --agent grok --global

它会做的事情取决于目标 Agent,但目标是一致的:你以后在哪里打开这个 Agent,Memorix 就可以在哪里被使用,而不是让你一个仓库一个仓库重复配置。

  • Claude Code:安装 Memorix 插件包,写入 CLAUDE.md 使用规范;不加 --noHooks 时会启用自动捕获。

  • Codex:安装包含 stdio MCP、skills 和生命周期 hooks 的 Memorix 插件包,并写入 AGENTS.md 使用规范。Codex 首次要求时,在 /hooks 中审核一次插件 hook;使用 --noHooks 可跳过自动捕获。

  • GitHub Copilot CLI:安装 Copilot 插件包和官方 Memorix skills。

  • Pi:安装 Pi extension/skills package 和原生 MCP 配置(Pi 1.0+):--global 写入 ~/.pi/agent/mcp.json,项目级安装写入 .pi/mcp.json。

  • Cursor:写入 Cursor 的 MCP / rules / 配置。

  • Gemini CLI:安装 extension package、GEMINI.md 上下文、hooks 和 skills。Antigravity CLI 有官方 Gemini CLI migration 路径,但 Gemini CLI 仍是活跃的独立 target。

  • OpenCode:安装本地插件文件、opencode.json、skills 和 AGENTS.md 指引。

  • Windsurf、Kiro、Trae:写入目标支持的 MCP / rules / hooks 文件。

  • Antigravity:安装官方 plugin package,包含 plugin.json、mcp_config.json、hooks.json、rules 和 skills,路径为 ~/.gemini/config/plugins/memorix 或 .agents/plugins/memorix。

  • OpenClaw:安装 OpenClaw 兼容 bundle,包含 .mcp.json、官方 skills 和 OpenClaw HOOK.md / handler.ts hook pack。

  • Hermes Agent:安装到 Hermes home(Windows native 默认为 %LOCALAPPDATA%\hermes,其他平台默认为 ~/.hermes,也支持 HERMES_HOME),在 config.yaml 启用插件,注册 plugin hooks、slash/CLI commands、skills,并写入 MCP 配置。

  • CodeBuddy Code:安装用户级本地市场插件到 ~/.codebuddy/memorix-local,包含 MCP、skills 和 hooks。它不会修改既有的 CodeBuddy 模型、权限或 settings 文件;第三方 hook 仍由 CodeBuddy 自己的 /hooks 流程确认。

  • Oh-my-Pi:安装 omp.extensions package,包含 extension hook 事件、memorix command、官方 skills,并写入 MCP 配置。

  • DeepSeek Harness:向 $DSH_HOME/cordis.patch.yml(默认 ~/.dsh/cordis.patch.yml)写入一行 Memorix @deepseek-ai/dsh-mcp-client,向 harness 的 AGENTS.md 追加使用规范,并把官方 skills 安装到 $DSH_HOME/skills。这一行遵循 DSH 自带的 Memorix 参考配置,因此工具以 mcp__memorix__* 形式出现。

  • Grok Build:把原生生命周期 hooks 安装到 ~/.grok/hooks/memorix.json,把使用规范写入 ~/.grok/AGENTS.md。默认仍由 Grok 自己管理 MCP;传入 --mcp http 时会写入 [mcp_servers.memorix](url = "http://localhost:3211/mcp")。项目级 hooks 需要在 Grok 中执行 /hooks-trust,全局 hooks 默认可信;也可以用 GROK_HOME 指定自定义 Grok 目录。

如果你想要更安静一点的安装,可以对那些 setup 能独立控制 hook capture 的 target 加 --noHooks。它会保留 MCP 和使用规范,只跳过 Memorix 的 hook 自动捕获。

如果你明确想要项目级指导或 hooks,就在那个仓库目录里再跑一次不带 --global 的 memorix setup --agent <agent>。

如果你的 Agent 只需要手动 MCP 配置,使用 stdio:

{
  "mcpServers": {
    "memorix": {
      "command": "memorix",
      "args": ["serve"]
    }
  }
}

如果是 npm 方式启动 MCP 客户端或收录平台测试器,请使用完整命令 npx -y memorix serve。serve 参数不能省略:人类在终端里直接运行 memorix 会打开内置 memcode,而 MCP 客户端应明确启动 stdio MCP 服务。

如果是手动维护 Claude Code 的 MCP 配置,需要在 memorix server 对象里加上 "alwaysLoad": true。这样 Claude Code 在 print-mode 启动时就会暴露 Memorix tools;memorix doctor agents --agent claude 可以检查并修复缺失的设置。

普通安装不需要 HTTP。只有在你明确需要共享后台服务、Dashboard、VPS Docker 部署,或多个客户端共用一个端点时才使用。本机开发直接运行 Node 服务,不需要 Docker:

memorix background start

然后让客户端连接:

http://localhost:3211/mcp

HTTP 模式下,如果客户端能提供工作区路径,Agent 应使用 memorix_session_start(projectRoot=...) 显式绑定当前仓库。最终项目身份仍以 Git 为准。

卸载

先预览:

memorix uninstall --dry-run

停止后台服务并移除 hooks:

memorix uninstall --background --hooks

完整清理:

memorix uninstall --yes --background --hooks --purge-data
npm uninstall -g memorix

memorix uninstall 会把需要手动清理的 MCP 配置路径列出来,不会悄悄去改你所有 MCP 文件。

从 CLI 管理记忆
memorix --cwd /path/to/repo resume "继续处理发布阻塞问题"
memorix checkpoint list
memorix memory search --query "release blocker"
memorix memory --help

# 可选:只在需要个人/团队记忆或协同时激活本地身份。
memorix identity join --agent-type codex --name codex-main
memorix memory store --text "个人排查笔记" --visibility personal
memorix task create --description "验证发布包"

# 有意沉淀长期记忆:先创建候选,再审核,审核前不会进入 Agent 的 Workset。
memorix memory long-term add --kind procedural --scope user --portability portable --title "发布验证偏好" --text "发布 npm 包前运行 focused tests 和打包后的 package smoke。" --applicability "发布 npm 包时。"
memorix memory long-term qualify --id <id> --reason "用户明确确认了这项偏好。"
memorix memory long-term approve --id <id> --reason "已审核,可在本机其它项目中使用。"

memorix transfer export --format json --out ./.memorix-export.json
memorix transfer import --file ./.memorix-export.json
memorix reasoning search --query "why sqlite"
memorix git-hook --force
memorix ingest log --count 20
memorix workbench

CLI 是直接入口,不依赖 MCP 会话。它默认绑定当前 Git 项目,也可以用 --cwd 指定项目。没有激活身份时,只会读写和导出项目公开记忆;只有明确需要个人/团队记忆或协同任务时,才运行 memorix identity join 或 memorix identity use --agent-id <id>。memorix identity clear 会回到项目公开范围;脚本可用一次性的 --as <active-agent-id>。已有 camelCase 参数仍兼容,kebab-case 也可直接使用。

管理受控媒体

媒体是显式、可控的。导入本地文件后,Memorix 会将其复制到本地数据目录、计算哈希,并放在 Git 工作区之外;只有执行附着操作后,资产才会进入普通项目记忆。它不会自动抓取每一张截图或工具输出。默认媒体资产上限为 100 MiB;自动视觉分析单独限制为 20 MiB。更大的图片仍可保存和附着,但不会被强行发送给模型,而是会留下明确的文本回退说明。

memorix media import --path ./architecture.png --json
memorix media attach --asset <asset-id> --title "架构图" --json
memorix media list --kind image --json
memorix media show --asset <asset-id> --json
memorix media remove --asset <asset-id> --force --json

# 受控派生:显式、有边界、可附着进记忆。
memorix media derive-pdf --asset <asset-id> --attach --json
memorix media derive-audio --asset <asset-id> --attach --json

# 旧的图像分析命令现在也会走同一套受控资产生命周期。
memorix ingest image --path ./architecture.png --json

MiniMax 图像生成是需要明确执行的 CLI 操作。视频生成会立即返回一个可持久查询的任务,不会把 Agent 请求卡在等待生成结果上。

# 在用户环境变量或 .env 中配置 MINIMAX_API_KEY,绝不要提交进 Git。
memorix media generate image --prompt "清晰的系统架构图" --json
# 图生图(MiniMax image-01 / image-01-live,通过 subject_reference):
memorix media generate image --prompt "保留主体、更换背景" --image ./reference.png --json
memorix media generate video --prompt "简短的产品演示" --json
memorix media status --job <media-job-id> --json
memorix media cancel --job <media-job-id> --json

memorix_media 是所有 profile(包括 micro)中都有的紧凑 MCP 对应入口,可导入、附着、列出、查看、派生 PDF/音频、生成并查询任务状态。因为图像/视频生成可能产生 provider 费用,MCP 默认禁止生成;只有你明确允许 Agent 付费调用时,才设置 MEMORIX_MCP_MEDIA_GENERATION=1。默认的 OpenRouter 文本 embedding 仍然只是文本向量;只有明确声明支持该模态的 provider 才会生成媒体向量。文本描述和附着信息仍可通过普通检索使用。

使用内置终端 Agent
memorix
# 或
memcode

这会打开 memcode:一个已经接好 Memorix 记忆的终端 Coding Agent。

<h2 id="记忆模型"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-memory-model.svg"><img src="assets/tags/section-memory-model.svg" alt="记忆模型" height="32" /></picture></h2>

层存什么适合回答
Observation Memory事实、坑点、修复、实现说明“这里是怎么工作的?”
Reasoning Memory原因、替代方案、约束、风险“当时为什么这么选?”
Git Memory从 commit 提炼出的工程事实“最近改了什么,在哪些文件?”
Code Memory文件、符号、import 关系、记忆到代码的新鲜度“现在应该先看哪些代码?”
受管理的长期记忆有来源证据、经过审核的情景事件、稳定事实或可复用流程“以后还应记住什么、按什么方式做?”
Compact Continuity最近一次宿主原生压缩的摘要或生命周期标记“上次上下文压缩后留下了什么?”

默认搜索当前项目。scope="global" 可以跨项目搜索。“改了什么”优先匹配 Git Memory,“为什么”优先匹配 reasoning / decision 记录。

长期记忆不是把所有笔记自动堆进去。Observation、Claim、工作流、session 和代码快照仍各自承担原来的职责。Agent 可以在 memorix_store 时要求额外生成长期记忆候选,但候选绝不会自动进入任务上下文;用 memorix memory long-term qualify|approve|archive|supersede 留下带证据的生命周期记录。只有人工创建或用户确认的 user + portable 记忆,才可能在同一台机器的其它项目中按任务相关性被使用;项目代码、Git 事实、测试、工作流、session 和 Observation 都不能被提升成可携带的用户记忆。

memorix context "..." 是默认的 Memory Autopilot 入口。它会按任务生成紧凑 brief:修 bug 时偏向测试和复现,发版时偏向 package/changelog/build 检查,接手项目时偏向文档和入口文件;过期或不相关的记忆只作为 warning,不会一股脑塞进 prompt。只有 MCP 不可用时才使用 CLI 回退,并带上 --fallback --brief-json,它只返回同一份有预算的 brief 和“选了什么、略了什么”的回执;--json 保留给详细诊断。普通新任务不会自动得到旧会话的文本倾倒;明确要继续之前工作时,用 memorix resume "...",只会补入最近一份有用的会话总结、最多三条当前可读的长期记忆锚点,以及最多一条带来源标识的近期宿主压缩检查点。每个长期锚点都有 durable:<id> 引用,Agent 只在确实需要完整已审核记录时才通过 memorix_detail 展开。关键词仍优先;没有命中而且用户已配置 embedding 时,Memorix 才会做一次 1.8 秒、不重试的语义回退,用于模型改写或跨语言任务。服务变慢或不可用时,正常的关键词 Workset 会原样返回。检查点只是生命周期证据,不是长期记忆,也不是聊天记录备份。Agent 应该先读 suggested files,再相信历史记忆。

<h2 id="运行模式"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-runtime.svg"><img src="assets/tags/section-runtime.svg" alt="运行模式" height="32" /></picture></h2>

你想做什么运行
安装某个 Agent 的接入包memorix setup --agent <agent> --global
检查或修复某个 Agent 接入memorix doctor agents --agent <agent>、memorix repair agents --agent <agent>
手动暴露 stdio MCPmemorix serve
启动共享 HTTP MCP 和 Dashboardmemorix background start
前台调试 HTTP MCPmemorix serve-http --port 3211
直接检查或管理记忆memorix memory、memorix reasoning、memorix session、memorix ingest、memorix media
管理已审核的长期记忆`memorix memory long-term list
检查原生上下文压缩连续性`memorix checkpoint list
使用交互式终端记忆控制台memorix workbench
使用内置终端 Agentmemorix 或 memcode
运行编排式 subagent 工作memorix orchestrate --goal "..."

memorix serve 默认使用 --mode micro(9 个工具),保持 MCP 工具 schema 紧凑。memorix setup 写入 --mode lite(21 个工具),覆盖常用记忆、连续性、会话、证据和反馈入口。需要协作工具时使用 --mode team(29 个工具),需要高级和兼容工具时使用 --mode full(48 个工具)。

memorix orchestrate 单 worker 默认使用当前 checkout;多 worker 时会在 .worktrees/ 下为任务创建隔离 worktree,并把成功的任务分支 merge 回来。用 --isolated 可强制单 worker 也隔离,用 --no-worktree 禁用 worktree,用 --allow-dirty 允许带未提交改动运行,用 --no-auto-merge 保留任务 worktree 方便人工 review。

<h2 id="memcode内置终端-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-memcode.svg"><img src="assets/tags/section-memcode.svg" alt="memcode" height="32" /></picture></h2>

memcode 是 Memorix 内置的终端 Coding Agent。它能读文件、改代码、运行命令、恢复 session、切换模型,并提供 /memory 命令;读写的仍然是同一套 Memorix 项目记忆。

想要一个开箱即用、已经带记忆的终端 Agent 时用它。

one Git project -> one shared Memorix memory pool

memcode 专门说明见 docs/MEMCODE.md。

<h2 id="配置"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-configuration.svg"><img src="assets/tags/section-configuration.svg" alt="配置" height="32" /></picture></h2>

最小 ~/.memorix/config.toml:

[agent]
provider = "openai"
model = "gpt-4o"
api_key = "..."

[memory.llm]
provider = "openai"
model = "gpt-4o-mini"
api_key = "..."

[embedding]
provider = "auto"

[memory]
inject = "minimal"
formation = "active"

[memory.llm] 和 [embedding] 负责记忆质量和检索;[agent] 是 memcode 编码时使用的模型。凭据放全局配置或环境变量,不要提交 secrets。

如需使用可选的 Atlas Cloud 记忆模型预设,可以运行 memorix init 选择 Atlas Cloud,或在 [memory.llm] 中设置 provider = "atlascloud"。它使用 OpenAI-compatible 的 https://api.atlascloud.ai/v1 endpoint,并读取 ATLASCLOUD_API_KEY 或显式的 MEMORIX_LLM_API_KEY。

如果使用 OpenRouter embedding,可以设置 provider = "api"、base_url = "https://openrouter.ai/api/v1"、model = "qwen/qwen3-embedding-8b"。这个 endpoint 下 Memorix 会读取官方 OPENROUTER_API_KEY;需要单独覆盖 embedding key 时仍可用 MEMORIX_EMBEDDING_API_KEY。

使用 Requesty 时,可在 memorix init 中选择 Requesty,或在 [memory.llm] 中设置 provider = "requesty"(endpoint 为 https://router.requesty.ai/v1,key 读取 REQUESTY_API_KEY 或 MEMORIX_LLM_API_KEY)。Requesty embedding 使用 provider = "api"、base_url = "https://router.requesty.ai/v1"、model = "openai/text-embedding-3-small",并读取 REQUESTY_API_KEY。

使用 API Route 时,可在 memorix init 中选择 API Route,或在 [memory.llm] 中设置 provider = "apiroute"。预设使用 https://global.api-route.com/v1 和 deepseek-v4.1-flash,密钥读取自己的 API_ROUTE_API_KEY 或 MEMORIX_LLM_API_KEY。这是显式启用的记忆 LLM 处理;embedding 和 memcode 模型注册表仍需单独配置。详见配置说明。

使用 Cheaper Inference 时,可在 memorix init 中选择 Cheaper Inference,或在 [memory.llm] 中设置 provider = "cheaperinference"。预设使用 https://api.cheaperinference.com/v1 和 gpt-5.4-mini,密钥读取自己的 CHEAPER_INFERENCE_API_KEY 或 MEMORIX_LLM_API_KEY。这是显式启用的记忆 LLM 处理;embedding 和 memcode 模型注册表仍需单独配置。详见配置说明。

使用 Runcrate 时,可在 memorix init 中选择 Runcrate,或在 [memory.llm] 中设置 provider = "runcrate"。预设使用 https://api.runcrate.ai/v1 和开放权重模型 deepseek-ai/DeepSeek-V4.1-Flash,密钥读取自己的 RUNCRATE_API_KEY 或 MEMORIX_LLM_API_KEY。这是显式启用的记忆 LLM 处理;embedding 和 memcode 模型注册表仍需单独配置。详见配置说明。

受控 MiniMax 媒体生成可在环境变量或 .env 中设置全局 MINIMAX_API_KEY,或中国区 MINIMAX_CN_API_KEY。媒体库不会保存该 key、临时签名 URL 或 base64 负载。CLI 生成本身就是显式操作;若要让 MCP 中的 Agent 发起生成,还必须明确设置 MEMORIX_MCP_MEDIA_GENERATION=1。

<h2 id="docker"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-docker.svg"><img src="assets/tags/section-docker.svg" alt="Docker" height="32" /></picture></h2>

Docker 只作为 VPS/托管环境的 HTTP 部署方式,不是本机开发或 stdio MCP 的必需品:

docker compose up --build -d

启动后:

  • Dashboard:http://localhost:3211

  • MCP:http://localhost:3211/mcp

  • Health:http://localhost:3211/health

如果要使用项目级 Git / 配置行为,容器必须能看到传给 projectRoot 的仓库路径。

<h2 id="sdk"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-sdk.svg"><img src="assets/tags/section-sdk.svg" alt="SDK" height="32" /></picture></h2>

在 TypeScript 中直接使用 Memorix:

import { createMemoryClient } from 'memorix/sdk';

const client = await createMemoryClient({ projectRoot: '/path/to/repo' });

await client.store({
  entityName: 'auth-module',
  type: 'decision',
  title: 'Use JWT for API auth',
  narrative: 'Chose JWT because the API is stateless and used by multiple clients.',
});

const results = await client.search({ query: 'auth decision' });
await client.close();

<h2 id="文档"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-docs.svg"><img src="assets/tags/section-docs.svg" alt="文档" height="32" /></picture></h2>

从这里开始适合场景
文档地图快速找到正确文档
安装与接入安装、使用 memorix setup、选择 stdio vs HTTP
集成形态插件包、MCP、项目规则、hooks 和 skills 支持
配置指南TOML 配置、模型 lane、兼容文件
API 参考MCP 工具和 CLI 命令
Git Memorycommit 摄入和工程事实检索
Docker容器化 HTTP 服务
memcode使用内置终端 Agent
Agent Playbook面向 AI Agent 的安装、绑定、hooks、排障手册
开发指南贡献、测试、发布检查
更新日志每个版本改了什么

LLM 友好摘要:llms.txt 和 llms-full.txt。

<h2 id="开发"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-development.svg"><img src="assets/tags/section-development.svg" alt="开发" height="32" /></picture></h2>

git clone https://github.com/AVIDS2/memorix.git
cd memorix
npm install
npm run lint
npm test
npm run build

<h2 id="鸣谢"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-acknowledgements.svg"><img src="assets/tags/section-acknowledgements.svg" alt="鸣谢" height="32" /></picture></h2>

Memorix 借鉴了 MCP 生态和 mcp-memory-service、MemCP、claude-mem、Mem0 等记忆项目的做法。memcode 基于 Pi coding-agent codebase,针对 Memorix 生态做了适配。

<h2 id="license"><picture><source media="(prefers-color-scheme: dark)" srcset="assets/tags/light/section-license.svg"><img src="assets/tags/section-license.svg" alt="License" height="32" /></picture></h2>

Apache 2.0

<h2 id="star-history">Star 历史</h2>

<a href="https://github.com/AVIDS2/memorix/stargazers"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://mem.rglens.com/metrics/star-history-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://mem.rglens.com/metrics/star-history-light.svg"> <img alt="Memorix Star History" src="https://mem.rglens.com/metrics/star-history-light.svg" width="100%"> </picture> </a>

<sub>由 GitHub 隐私安全的 Star History API 自动更新,不再生成自动 PR。</sub>

512 files · 453 not served here

Advantages

  • Local-first: the memory stays in files or a database on your own machine (a rule-derived fact from the brain’s files, evidence: README.md)
  • Works with 14 MCP clients (a rule-derived fact from the brain’s files, evidence: README.md)
  • Open licence (Apache-2.0) (a rule-derived fact from the brain’s files)

Limitations

  • Needs an API key (ANTHROPIC_API_KEY, API_ROUTE_API_KEY, ATLASCLOUD_API_KEY) (a rule-derived fact from the brain’s files, evidence: README.md)
  • Needs a database (LanceDB, PostgreSQL, SQLite) (a rule-derived fact from the brain’s files, evidence: README.md)
  • Runs code automatically: review what it runs before you open it (a rule-derived fact from the brain’s files)
  • No ZIP download: install it from its source (a rule-derived fact from the brain’s files)

Security

Risk level: Low risk

This brain runs

Agent instructions that run or fetch something (23)

  • CLAUDE.md: CLI fallback: only after MCP is confirmed unavailable, run `memorix context --task "<current task>"` from the shell instead of skipping memory or hand-writing tool calls
  • plugins/claude/memorix/SKILL.md: Run `memorix context --task "<task>" --fallback --brief-json` only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text.
  • plugins/claude/memorix/skills/memorix-git-memory/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Search what changed | `memorix_search` with a change-focused query | `memorix memory search --query "what changed <topic>"` | | Inspect a git-backed memory | `memorix_detail` | `memorix memory detail --id <id>` | | Ingest current co …[+257 chars]
  • plugins/claude/memorix/skills/memorix-memory/SKILL.md: Run `memorix context --task "<task>" --fallback --brief-json` from the shell only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text.
  • plugins/claude/memorix/skills/memorix-orchestrate/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Run managed subagent execution | CLI | `memorix orchestrate --goal "<goal>" --agents claude:1,codex:1` | | Register coordination identity | `team_manage` action `join` | `memorix team join --agentType <agent>` | | Create or inspect …[+385 chars]
  • plugins/claude/memorix/skills/memorix-troubleshooting/SKILL.md: | Symptom | Check | CLI fallback | |---|---|---| | MCP tools missing | host MCP config and restart | `memorix setup --agent <agent>` | | Unsure project is bound | project status | `memorix status` and `git status` | | HTTP MCP stale or unbound | background health and explicit session bi …[+33 chars]
  • plugins/codebuddy/memorix/skills/memorix-git-memory/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Search what changed | `memorix_search` with a change-focused query | `memorix memory search --query "what changed <topic>"` | | Inspect a git-backed memory | `memorix_detail` | `memorix memory detail --id <id>` | | Ingest current co …[+257 chars]
  • plugins/codebuddy/memorix/skills/memorix-memory/SKILL.md: Run `memorix context --task "<task>" --fallback --brief-json` from the shell only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text.
  • plugins/codebuddy/memorix/skills/memorix-orchestrate/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Run managed subagent execution | CLI | `memorix orchestrate --goal "<goal>" --agents claude:1,codex:1` | | Register coordination identity | `team_manage` action `join` | `memorix team join --agentType <agent>` | | Create or inspect …[+385 chars]
  • plugins/codebuddy/memorix/skills/memorix-troubleshooting/SKILL.md: | Symptom | Check | CLI fallback | |---|---|---| | MCP tools missing | host MCP config and restart | `memorix setup --agent <agent>` | | Unsure project is bound | project status | `memorix status` and `git status` | | HTTP MCP stale or unbound | background health and explicit session bi …[+33 chars]
  • plugins/codex/memorix/skills/memorix-git-memory/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Search what changed | `memorix_search` with a change-focused query | `memorix memory search --query "what changed <topic>"` | | Inspect a git-backed memory | `memorix_detail` | `memorix memory detail --id <id>` | | Ingest current co …[+257 chars]
  • plugins/codex/memorix/skills/memorix-memory/SKILL.md: Run `memorix context --task "<task>" --fallback --brief-json` only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text.
  • plugins/codex/memorix/skills/memorix-orchestrate/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Run managed subagent execution | CLI | `memorix orchestrate --goal "<goal>" --agents claude:1,codex:1` | | Register coordination identity | `team_manage` action `join` | `memorix team join --agentType <agent>` | | Create or inspect …[+385 chars]
  • plugins/codex/memorix/skills/memorix-troubleshooting/SKILL.md: | Symptom | Check | CLI fallback | |---|---|---| | MCP tools missing | host MCP config and restart | `memorix setup --agent <agent>` | | Unsure project is bound | project status | `memorix status` and `git status` | | HTTP MCP stale or unbound | background health and explicit session bi …[+33 chars]
  • plugins/copilot/memorix/skills/memorix-git-memory/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Search what changed | `memorix_search` with a change-focused query | `memorix memory search --query "what changed <topic>"` | | Inspect a git-backed memory | `memorix_detail` | `memorix memory detail --id <id>` | | Ingest current co …[+257 chars]
  • plugins/copilot/memorix/skills/memorix-memory/SKILL.md: Run `memorix context --task "<task>" --fallback --brief-json` only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text.
  • plugins/copilot/memorix/skills/memorix-orchestrate/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Run managed subagent execution | CLI | `memorix orchestrate --goal "<goal>" --agents claude:1,codex:1` | | Register coordination identity | `team_manage` action `join` | `memorix team join --agentType <agent>` | | Create or inspect …[+385 chars]
  • plugins/copilot/memorix/skills/memorix-troubleshooting/SKILL.md: | Symptom | Check | CLI fallback | |---|---|---| | MCP tools missing | host MCP config and restart | `memorix setup --agent <agent>` | | Unsure project is bound | project status | `memorix status` and `git status` | | HTTP MCP stale or unbound | background health and explicit session bi …[+33 chars]
  • plugins/cursor/memorix/skills/memorix-git-memory/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Search what changed | `memorix_search` with a change-focused query | `memorix memory search --query "what changed <topic>"` | | Inspect a git-backed memory | `memorix_detail` | `memorix memory detail --id <id>` | | Ingest current co …[+257 chars]
  • plugins/cursor/memorix/skills/memorix-memory/SKILL.md: Run `memorix context --task "<task>" --fallback --brief-json` only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text.
  • plugins/cursor/memorix/skills/memorix-orchestrate/SKILL.md: | Situation | Prefer | CLI fallback | |---|---|---| | Run managed subagent execution | CLI | `memorix orchestrate --goal "<goal>" --agents claude:1,codex:1` | | Register coordination identity | `team_manage` action `join` | `memorix team join --agentType <agent>` | | Create or inspect …[+385 chars]
  • plugins/cursor/memorix/skills/memorix-troubleshooting/SKILL.md: | Symptom | Check | CLI fallback | |---|---|---| | MCP tools missing | host MCP config and restart | `memorix setup --agent <agent>` | | Unsure project is bound | project status | `memorix status` and `git status` | | HTTP MCP stale or unbound | background health and explicit session bi …[+33 chars]
  • plugins/gemini/memorix/GEMINI.md: Run `memorix context --task "<task>" --fallback --brief-json` only after MCP is unavailable, disabled, or not discoverable, and pass the user's real task text.

MCP servers (7)

  • README.md (memorix): memorix serve
  • plugins/claude/memorix/.mcp.json (memorix): memorix serve --mode lite
  • plugins/codebuddy/memorix/.mcp.json (memorix): memorix serve --mode lite
  • plugins/codex/memorix/.mcp.json (memorix): memorix serve --mode lite
  • plugins/copilot/memorix/.mcp.json (memorix): memorix serve --mode lite
  • plugins/gemini/memorix/gemini-extension.json (memorix): memorix serve --mode lite
  • plugins/openclaw/memorix/.mcp.json (memorix): memorix serve --mode lite

Hooks (20)

  • plugins/claude/memorix/hooks/hooks.json (SessionStart): memorix hook
  • plugins/claude/memorix/hooks/hooks.json (PostToolUse): memorix hook
  • plugins/claude/memorix/hooks/hooks.json (UserPromptSubmit): memorix hook
  • plugins/claude/memorix/hooks/hooks.json (PreCompact): memorix hook
  • plugins/claude/memorix/hooks/hooks.json (Stop): memorix hook
  • plugins/codebuddy/memorix/hooks/hooks.json (SessionStart): memorix hook --agent codebuddy
  • plugins/codebuddy/memorix/hooks/hooks.json (UserPromptSubmit): memorix hook --agent codebuddy
  • plugins/codebuddy/memorix/hooks/hooks.json (PostToolUse): memorix hook --agent codebuddy
  • plugins/codebuddy/memorix/hooks/hooks.json (PreCompact): memorix hook --agent codebuddy
  • plugins/codebuddy/memorix/hooks/hooks.json (Stop): memorix hook --agent codebuddy
  • plugins/codex/memorix/hooks/hooks.json (SessionStart): memorix hook --agent codex
  • plugins/codex/memorix/hooks/hooks.json (PostToolUse): memorix hook --agent codex
  • plugins/codex/memorix/hooks/hooks.json (UserPromptSubmit): memorix hook --agent codex
  • plugins/codex/memorix/hooks/hooks.json (PreCompact): memorix hook --agent codex
  • plugins/codex/memorix/hooks/hooks.json (Stop): memorix hook --agent codex
  • plugins/copilot/memorix/hooks/hooks.json (sessionStart): memorix hook --agent copilot
  • plugins/copilot/memorix/hooks/hooks.json (sessionEnd): memorix hook --agent copilot
  • plugins/copilot/memorix/hooks/hooks.json (userPromptSubmitted): memorix hook --agent copilot
  • plugins/copilot/memorix/hooks/hooks.json (postToolUse): memorix hook --agent copilot
  • plugins/copilot/memorix/hooks/hooks.json (preCompact): memorix hook --agent copilot

Binaries (5)

  • packages/memcode/examples/extensions/doom-overlay/doom/build/doom.wasm: ships native binaries
  • packages/tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node: ships native binaries
  • packages/tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node: ships native binaries
  • packages/tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node: ships native binaries
  • packages/tui/native/win32/prebuilds/win32-x64/win32-console-mode.node: ships native binaries
  • Low risk: scripts-present (scripts/benchmark-retrieval.mjs)
  • Low risk: scripts-present (scripts/large-store-gate.mjs)

Attribution and licence

First committed by
GitHub avatar of AVIDS2AVIDS2
Declared authors
  • AVIDS2 (declared in package.json)
Publisher
Le_Ho (Community)
Source
AVIDS2/memorix · commit 6745280
Licence
Apache License 2.0 (files served here)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Contributors
AVIDS2, noirgif, Tom-Ma-Ming, octo-patch, DennyHo0917

AutoGineer is not affiliated with or endorsed by AVIDS2.

Install from source

453 of its files are not served here, so there is no ZIP. AVIDS2/memorix at 6745280