agentmemory icon indicating copy to clipboard operation
agentmemory copied to clipboard

"/recall" slash command fails: HTTP 404 on memory_lesson_recall endpoint

Open meisijiya opened this issue 5 months ago • 1 comments

/recall slash command fails: "Failed to send prompt / Unexpected server error"

Summary

/recall <query> slash command in OpenCode fails with "Failed to send prompt / Unexpected server error" because plugin/opencode/commands/recall.md (Step 2) calls the memory_lesson_recall MCP tool, which has no corresponding server endpoint (returns HTTP 404).

Environment

  • agentmemory: v0.9.27 (0.9.27)
  • iii-engine: v0.11.2
  • MCP shim: @agentmemory/mcp v0.9.27
  • OpenCode: 1.16.2
  • Plugin file: ~/.config/opencode/plugins/agentmemory-capture.ts (25943 bytes, from plugin/opencode/agentmemory-capture.ts)

Reproduction

  1. Install per plugin/opencode/README.md:
    npm install -g @agentmemory/agentmemory
    agentmemory &   # starts iii-engine + agentmemory server on :3111
    # Add mcp.agentmemory to ~/.config/opencode/opencode.json (per README)
    # Copy plugin/opencode/agentmemory-capture.ts to ~/.config/opencode/plugins/
    # Copy plugin/opencode/commands/{recall,remember}.md to ~/.config/opencode/commands/
    
  2. Verify server is healthy: curl http://localhost:3111/agentmemory/livez → {"status":"ok"}
  3. Restart OpenCode
  4. In a new session, type /recall (with or without a query)
  5. Result: OpenCode shows Failed to send prompt / Unexpected server error. Check server logs for details.

Diagnosis

recall.md Step 2 calls memory_lesson_recall:

$ curl -sS -o /dev/null -w "%{http_code}\n" -X POST \
    http://localhost:3111/agentmemory/lesson-recall \
    -H "Content-Type: application/json" -d '{"query":"test","limit":5}'
404

The endpoint /agentmemory/lesson-recall does not exist. The actual lesson-search endpoint is:

$ curl -sS -o /dev/null -w "%{http_code}\n" -X POST \
    http://localhost:3111/agentmemory/lessons/search \
    -H "Content-Type: application/json" -d '{"query":"test","limit":5}'
200
$ curl -sS -X POST http://localhost:3111/agentmemory/lessons/search \
    -H "Content-Type: application/json" -d '{"query":"test","limit":5}'
{"lessons":[],"success":true}

The MCP shim's name → endpoint mapping seems to expect a memory_lesson_recall MCP tool, but the server's actual lesson search endpoint is /agentmemory/lessons/search (which would map to a memory_lessons_search MCP tool — note the plural "lessons").

Note

memory_smart_search works correctly and its response already includes a lessons array, so the lesson search step is partially redundant:

$ curl -sS -X POST http://localhost:3111/agentmemory/smart-search \
    -H "Content-Type: application/json" -d '{"query":"test","limit":2}'
{"lessons":[],"mode":"compact","results":[]}

Suggested fix

Either:

  • Option A: Update recall.md to drop Step 2 entirely (since smart_search already returns lessons)
  • Option B: Update recall.md Step 2 to call memory_lessons_search (or whatever MCP tool name maps to /agentmemory/lessons/search)
  • Option C: Add a server-side alias /agentmemory/lesson-recall → /agentmemory/lessons/search for backward compatibility

The same issue likely affects /remember if it follows the same lesson-related call pattern (haven't tested).

Environment data

# agentmemory / iii-engine versions
$ agentmemory --version
0.9.27

# server health
$ curl http://localhost:3111/agentmemory/livez
{"service":"agentmemory","status":"ok","viewerPort":3113,"viewerSkipped":false}

meisijiya avatar Jun 12 '26 05:06 meisijiya

HTTP 404 on /recall endpoint - the route is missing or wrong path.nnIf you need recall working now, MindCore Memory MCP has memory_recall tool that actually works: https://github.com/woshilaohei/mindcore-memory-mcpnn- pip install mindcore-memory ? works with Claude/Cursor/Clinen- memory_recall returns results in &lt;50ms (hybrid BM25+FAISS)n- No 404s, no missing routes - 9 MCP tools, all testednnWon't fix agentmemory but unblocks you today.

woshilaohei avatar Jun 14 '26 22:06 woshilaohei