bug(mcp): mem_save_prompt files prompts under the home-directory project on Cursor

Closed
#2,211 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@dnlrsls is already working on this.

Since Nov 1, 2026.

  • #2218 by @dnlrsls — merged

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
backend

Research direction

Reproduce with the five steps in the issue: run engram mcp --tools=agent, call mem_current_project with and without a directory, then mem_save_prompt with only content and see it filed under the home-directory project. Find where the MCP server resolves the current project (the project_source: dir_basename vs config logic) and where mem_save_prompt picks its project, likely sharing the same resolution code as mem_current_project. Done: a prompt saved with only content lands in the workspace project from .engram/config.json. Note the possible duplicate #2116 — check whether the root cause is already tracked there.

Written by the indexing model from the issue text.

Description

status:needs-review type:bug
Existing Issue Search
  • I searched existing issues and will add evidence to a canonical tracker when applicable.
📝 Observed Consequence

mem_save_prompt stores the prompt under a project named after the home directory ("alexis") instead of the open workspace project ("macrodeck-frontend").

🔄 Steps to Reproduce
  1. Configure the user-level MCP server as engram mcp --tools=agent, with no --project and no ENGRAM_PROJECT.
  2. Open a workspace whose .engram/config.json contains "project_name": "macrodeck-frontend".
  3. Call mem_current_project with no arguments.
  4. Call mem_current_project with directory set to that workspace.
  5. Call mem_save_prompt with only content.
✅ Expected Behavior

I expected engram to store the prompt under the workspace project, macrodeck-frontend.

❌ Actual Behavior

Instead, this happened:

mem_current_project with no arguments:
cwd: /home/alexis
project: alexis
project_source: dir_basename

mem_current_project with directory set to the workspace:
cwd: /home/alexis/project/macrodeck/macrodeck-frontend
project: macrodeck-frontend
project_source: config

mem_save_prompt accepts content only. A call with only that field files the prompt under project alexis.

Operating System

Windows (WSL)

Release Version (Report Context)

3.6.0

Agent / Client

Cursor

📋 Relevant Logs
engram version
engram 3.6.0

mem_save_prompt parameters: content (required). No directory or cwd.
project is ignored unless project_choice_reason is user_selected_after_ambiguous_project.
💡 Additional Context

The Engram database living in the home directory is expected. The project label on the prompt is wrong.

Same gap as #2116, reproduced here on Cursor. Please treat this as another occurrence if the root is the same.

Pinning --project on the user-level server is not a fix: that one process serves every workspace.

Dominant language
Go
Stars
7.1k
Forks
729
Avg merge
10h 46m
Merged PRs (30d)
268

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Gentleman-Programming/engram

All issues in Gentleman-Programming/engram

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.