ai-memory v0.8.0

Zed assistant — MCP server + assistant directive

Category 2 (MCP-capable, no native session-start hook). Reference: https://zed.dev/docs/assistant

Zed is a high-performance editor with a built-in AI assistant panel. Recent Zed builds have MCP support; configuration lives in Zed’s settings.json. There is no documented session-start hook today, so the recipe is two-part: register ai-memory-mcp as an MCP server plus add an assistant-rules directive telling the model to call memory_session_start before responding to the first user turn.

Part 1 — register ai-memory-mcp as an MCP context server

Zed’s settings live at ~/.config/zed/settings.json (Linux/macOS) or %APPDATA%\Zed\settings.json (Windows). The MCP key name has shifted across Zed versions — recent builds use context_servers, earlier experimental builds used variants under assistant. The canonical path varies; if your build does not pick up the entry under context_servers, consult Cmd+, (Settings) → search for “mcp” or “context server” to confirm the key name.

Add to ~/.config/zed/settings.json:

{
  "context_servers": {
    "ai-memory": {
      "command": {
        "path": "ai-memory",
        "args": ["mcp"],
        "env": {
          "AI_MEMORY_DB": "${HOME}/.claude/ai-memory.db"
        }
      }
    }
  }
}

Using --tier smart or --tier autonomous with a non-default LLM backend? Post-#1146 (v0.7.0) the recommended path is a [llm] section in ~/.config/ai-memory/config.toml — single source of truth across MCP / HTTP daemon / CLI / boot banner / doctor probe. Example: backend = "xai", model = "grok-4.3", api_key_env = "XAI_API_KEY" (the env-var name, not the literal key — inline keys are rejected at parse time). Export the named env var in your shell rc; the Zed config can stay minimal. Override path: extend the inner env block above with AI_MEMORY_LLM_BACKEND, AI_MEMORY_LLM_API_KEY, and AI_MEMORY_LLM_MODEL — shell exports don’t reach Zed’s MCP-spawned subprocesses (#1144). Full schema + per-vendor recipes: ../CONFIG_SCHEMA.md + llm-backends.md.

Notes:

Part 2 — assistant directive (best-effort fallback)

Zed’s assistant panel supports a per-workspace or global default prompt / system instruction surface (Settings → Assistant → Default Model / Default Prompt). Add the following directive there:

Before responding to any user message in a fresh conversation, call the ai-memory.memory_session_start MCP tool and a memory_recall against the relevant project namespace (default: the current working directory’s basename). Surface the recalled titles in your first reply so the user can confirm continuity.

Caveat: text directives are best-effort (issue #487 layer 6) — the model may skip the call under load or competing instructions.

Quick install

Manual install only until PR-2’s installer follow-up adds explicit Zed support. The settings.json edit above is the manual form; track the installer issue for one-line bootstrap that handles the platform path differences (~/.config/zed/ vs %APPDATA%\Zed\).

End-user diagnostic

Zed surfaces MCP tool calls in the assistant panel transcript, so when the directive fires you will see memory_session_start in the tool-call log on the first turn. If you don’t, either MCP is not loading the server (check the Zed log: zed --foreground on Linux/macOS, or the bottom panel on launch) or the directive is not being applied. The ai-memory boot status-header diagnostic (see README.md) does not apply here because Zed’s integration is MCP-only, not boot-shellout-based.

Limitations

Better, when Zed lands a session-start hook

We have an open feature request at the Zed repo to add a documented session-start hook for the assistant panel (cross-filed from issue #487). When that ships, replace Part 2 with a hook entry pointing at:

ai-memory boot --quiet --no-header --limit 10 --budget-tokens 4096

This recipe will be updated in place once the hook lands.