Cursor IDE
Cursor IDE supports two AutoMem integration modes:
- Plugin mode (default via the guided installer) — copies the AutoMem plugin into
~/.cursor/plugins/local/automem. Cursor’s native plugin system bundles the MCP server, a Cursor-nativesessionStartrecall hook, and the always-on rule. Configuration is done through Cursor’s UI rather thanmcp.json. - Files mode (via
npx @verygoodplugins/mcp-automem cursor) — the classic three-component approach: MCP server config (~/.cursor/mcp.json), rule file (.cursor/rules/automem.mdc), and session-start hook (.cursor/hooks/automem-session-start.mjs+.cursor/hooks.json).
Memory storage remains model-judged in both modes — hooks never write memories themselves.
Installation
Section titled “Installation”Method 1: Guided Installer — Plugin Mode (Recommended)
Section titled “Method 1: Guided Installer — Plugin Mode (Recommended)”The guided installer defaults to --cursor-mode plugin, which copies the bundled AutoMem plugin into ~/.cursor/plugins/local/automem:
npx @verygoodplugins/mcp-automem installSelect Cursor when the agent picker appears. The installer copies the plugin (MCP server, Cursor-native sessionStart recall hook, and always-on rule) from plugins/automem/. Re-running the installer replaces the plugin with the current release. The installer refuses to replace a symlink at that path, or a directory there that is not the AutoMem plugin.
After installation, fully restart Cursor, then open Customize → Automem → Configure and enter your AutoMem REST API URL and API key. The URL must be the AutoMem backend base URL (e.g. http://127.0.0.1:8001), not the remote MCP /mcp path.
The plugin exposes five tools: recall_memory, store_memory, associate_memories, update_memory, and check_database_health. delete_memory is excluded from the plugin’s default tool list.
Method 2: Guided Installer — Files Mode
Section titled “Method 2: Guided Installer — Files Mode”Pass --cursor-mode files to use the classic file-based approach instead:
npx @verygoodplugins/mcp-automem install --cursor-mode filesThis writes the same files as the standalone cursor command (see below). If the AutoMem plugin is already installed, an interactive run offers to remove it; a --yes run leaves it and warns.
Method 3: Standalone CLI Installer — Files Mode
Section titled “Method 3: Standalone CLI Installer — Files Mode”The cursor command installs all three file-mode components directly for the current project:
# Install with auto-detected project namenpx @verygoodplugins/mcp-automem cursor
# Specify project name manuallynpx @verygoodplugins/mcp-automem cursor --name my-project
# Preview changes without writingnpx @verygoodplugins/mcp-automem cursor --dry-run
# Skip interactive prompts (for CI)npx @verygoodplugins/mcp-automem cursor --yesCLI options:
| Flag | Description | Default |
|---|---|---|
--name <project> | Project name for memory tags | Auto-detected from package.json, git remote, or directory name |
--dir <path> | Custom target directory for the rule file | .cursor/rules |
--endpoint <url> | AutoMem service URL | From env, existing config, or default local URL |
--api-key <key> | AutoMem API key | From env or existing config |
--dry-run | Preview changes without writing files | Off |
--yes / -y | Skip interactive prompts | Off |
--quiet | Suppress output | Off |
The installer:
- Detects project name from
package.json, git remote, or directory name - Checks version of any existing
.mdcfile and prompts for update if a newer version is available - Detects your MCP server name from
~/.cursor/mcp.json(looks formemory,automem, or any server with AutoMem signatures) and usesmemorywhen it finds none - Generates
.cursor/rules/automem.mdcwith your project name and correct tool prefix - Generates
.cursor/hooks/automem-session-start.mjswith the two-phase recall context for this project - Writes
.cursor/hooks.jsonto register theautomem-session-start.mjsscript as a CursorsessionStarthook - Writes or updates
~/.cursor/mcp.jsonwith the AutoMem server entry (AUTOMEM_API_URL,AUTOMEM_API_KEY; file is created with600permissions to protect credentials) - Creates a
.bakbackup before overwriting any existing file
If it finds an unrelated server entry under the AutoMem server name in ~/.cursor/mcp.json, the installer refuses and prompts you to rename that server first.
Method 4: One-Click Deeplink (MCP server only)
Section titled “Method 4: One-Click Deeplink (MCP server only)”Use Cursor’s deeplink URL scheme to install the MCP server in one click:
cursor://anysphere.cursor-deeplink/mcp/install?name=memory&config=eyJ...The base64-encoded config contains your endpoint and API key. Find the current deeplink in the AutoMem README.
MCP Server Configuration
Section titled “MCP Server Configuration”Manually edit or create ~/.cursor/mcp.json:
{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "@verygoodplugins/mcp-automem"], "env": { "AUTOMEM_API_URL": "http://127.0.0.1:8001", "AUTOMEM_API_KEY": "your-token-here" } } }}For local development (no API key needed):
{ "mcpServers": { "memory": { "command": "npx", "args": ["-y", "@verygoodplugins/mcp-automem"], "env": { "AUTOMEM_API_URL": "http://127.0.0.1:8001" } } }}Tool Naming Convention
Section titled “Tool Naming Convention”Cursor exposes MCP tools with underscore-delimited prefixes: mcp_<server>_<tool>. The server name is sanitized — hyphens become underscores.
| Server name in config | Tool prefix | Example tool |
|---|---|---|
memory | mcp_memory_ | mcp_memory_recall_memory |
auto-mem | mcp_auto_mem_ | mcp_auto_mem_recall_memory |
The CLI installer detects the server name and generates the .mdc file with the matching prefix. When it builds the prefix, it replaces every character other than an ASCII letter, digit, or underscore with an underscore. If it finds no AutoMem server in ~/.cursor/mcp.json, it falls back to the server name memory, so the rules use mcp_memory_* tool names by default.
Rule File Structure
Section titled “Rule File Structure”After running the installer, .cursor/rules/automem.mdc is created with alwaysApply: true so Cursor applies the rules to all conversations in the project.
Two-Phase Recall and Three Storage Triggers
Section titled “Two-Phase Recall and Three Storage Triggers”The rule file prescribes two recalls at the start of a session, followed by three mid-conversation storage triggers. It has no end-of-conversation summary step.
Session start: two recalls, issued in parallel
Preferences and task context are independent recalls, so the rule file has Cursor issue both in a single message. The defaults are limit: 20 for preferences, limit: 30 for task context, and a 90-day task window.
- Preferences:
tags: ["preference"],limit: 20,sort: "updated_desc" - Task context: one semantic query built from the proper nouns, product names, people, tools, and specific topics in the user’s message, gated on the project tag unless the name collides with a common topic word (see Tagging Conventions), with
time_query: "last 90 days"andlimit: 30. The optionallanguageandactive_pathparameters boost results and do not gate them.
Skip the task-context recall for pure syntax questions, trivial edits, one-off calculations, direct factual queries about current files, and casual openings.
Debug recall is separate and runs only when Cursor is investigating a concrete symptom: the error message or symptom as the query, limit: 20, and no tag gate, because bugfix and solution tagging is incomplete and a hard gate hides fixes stored elsewhere in the corpus. The rule file also says not to re-recall mid-conversation unless the topic shifts, a new proper noun enters, or debugging starts.
When the task-context recall misses:
- Too broad — add a tag gate (a stable category or the unambiguous project slug) and tighten the query to the real nouns
- Empty — drop the time window first, then broaden the query
- Sparse under a tag gate — drop the gate and rely on the semantic query alone, since older memories can use
project/<slug>prefixes - Need graph traversal — use
expand_relations: true, addingexpand_respect_tags: trueonly when traversal must stay inside the tag gate
During the conversation: three storage triggers
The rule file stores only durable decisions, corrections, explicit preferences, bug-fix root causes, and articulated reusable patterns. Its mid-conversation triggers are these three, and only these three:
| Trigger | Store as | Importance | Then associate with |
|---|---|---|---|
| User correction or override (“actually”, “no, I prefer”, “stop doing X”) | Preference, tag correction, confidence 0.95 | 0.9 | The prior memory, via INVALIDATED_BY |
| Decision stabilizes after at least one round of discussion (“let’s go with X”, “ship it”) | Decision | 0.85–0.9 | Alternatives that came up, via PREFERS_OVER |
| Pattern the user articulated, not one inferred (“I always do X”, “every time”) | Pattern | 0.8 | Concrete examples, via EXEMPLIFIES |
A bug-fix root cause is stored as an Insight (importance 0.75, confidence 0.85) tagged bugfix and solution, then associated with the bug report through LEADS_TO.
Every store follows the same four steps:
- Recall related memories (
limit: 5) - Store the memory
- Recall a distinctive phrase from the content to verify it was saved, and retry the store once if it is missing, because
store_memorycan silently fail - Associate it with the related memory from step 1 when one exists
No end-of-conversation summary
The rule file’s storage discipline says never to store session summaries, progress reports, confirmations, speculative context, or attentiveness notes, and never to store secrets, credentials, tokens, or PII. It has no wrap-up step at the end of the conversation.
Available MCP Tools
Section titled “Available MCP Tools”All six AutoMem tools are available via the mcp_memory_* prefix (assuming server named memory):
store_memory — Save memories with structured metadata
content(required): 150–300 char target, 500 max (auto-summarized), 2000 hard limittype(optional): Decision, Pattern, Insight, Preference, Style, Habit, Contextconfidence(optional): 0.0–1.0 (default 0.9 if type provided)tags(optional): Array for categorizationimportance(optional): 0.0–1.0 (default 0.5)t_valid/t_invalid(optional): ISO 8601 timestamps for when the memory becomes valid and when it expires (single-memory mode only)metadata(optional): Custom structured data
recall_memory — Hybrid search
- Basic:
query,queries,tags,limit - Ordering:
sort(score,time_desc,time_asc,updated_desc, orupdated_asc; usetime_*for chronological recaps) - Time filters:
time_query,start,end - Tag matching:
tag_mode(any/all),tag_match(exact/prefix) - Graph expansion:
expand_entities,expand_relations,auto_decompose - Expansion filters:
expand_min_importance,expand_min_strength(v0.8.0+) - Expansion scope:
expand_respect_tags(ranked mode only). When true, graph and entity expansion stays within the original tag scope; when false, expansion may include related context outside the tags - Context hints:
language,active_path,context_types,priority_ids
associate_memories — Create typed relationships between memories
- 11 authorable types:
RELATES_TO,LEADS_TO,EVOLVED_INTO,DERIVED_FROM,EXEMPLIFIES,CONTRADICTS,REINFORCES,INVALIDATED_BY,OCCURRED_BEFORE,PART_OF,PREFERS_OVER - Recall results may also surface system-generated
SIMILAR_TO,PRECEDED_BY, andDISCOVEREDrelations, but those are not valid inputs toassociate_memories strength: 0.0–1.0 association weight
update_memory — Modify existing memory fields
delete_memory — Remove memory by ID
check_database_health — Verify FalkorDB and Qdrant connections
Tagging Conventions
Section titled “Tagging Conventions”Use bare tags only. The rule file says to use automem, not project/automem, and to avoid lang/ prefixes, platform tags (so no cursor tag), and date-stamped tags (so no YYYY-MM). entity:*:* tags are injected by the server.
The rule file treats tags as a hard gate on recall: memories without a matching tag are excluded before scoring. It therefore gates on stable categories and the project name rather than guessed topic tags.
Project-specific memories (code, architecture, decisions):
- Category tag: a stable category such as
preference,bugfix,solution, orcorrection - Project tag: your project name (
{{PROJECT_NAME}}in the rule template), detected frompackage.json, the git remote, or the directory name, or set with--name - Language tag: for example
typescriptorpython
["decision", "my-app", "typescript"]Cross-project memories (preferences, style): the session-start preferences recall is gated on preference alone and is not scoped to a project, so the most recently updated preference-tagged memories (up to 20) surface in any project.
Notes on the rule file’s recall behavior:
- When the project name collides with a common topic word (
api,app,test,video), the rule file drops the project tag gate on recall and relies on the semantic query alone - A language tag is not a gate: at recall time the rule file passes the language as the optional
languageparameter, which boosts results and does not gate them - For facts with a shelf life, set
t_validandt_invalidinstead of encoding a date in a tag
Content Size Governance
Section titled “Content Size Governance”| Limit | Size | Behavior |
|---|---|---|
| Target | 150–300 chars | Optimal for embedding quality |
| Soft limit | 500 chars | Auto-summarized by backend (requires OPENAI_API_KEY) |
| Hard limit | 2000 chars | Rejected by MCP server |
Format: "Brief title. Context and details. Impact/outcome."
If more detail is needed:
- Split into multiple atomic memories
- Use
metadatafor structured data (files, error signatures) - Create associations between related memories
Global User Rules (Optional)
Section titled “Global User Rules (Optional)”For memory-first behavior across all Cursor projects, add rules to Cursor Settings > General > Rules for AI instead of per-project .mdc files.
Error Handling
Section titled “Error Handling”The rule file prescribes graceful degradation:
- Recall fails or empty — Continue without historical context. Do not announce failure.
- Store fails — Complete the task normally. Memory is an enhancement, not a requirement.
- Service unavailable — Focus on solving the immediate problem.
Troubleshooting
Section titled “Troubleshooting”Tools not available in Cursor
Section titled “Tools not available in Cursor”- Check that
~/.cursor/mcp.jsonexists and is valid JSON - Restart Cursor after editing
mcp.json - Verify the server name in
mcp.jsonmatches the prefix in.cursor/rules/automem.mdc - Run
npx @verygoodplugins/mcp-automem cursoragain to regenerate the rule file with the detected server name
Rule file not updating
Section titled “Rule file not updating”The installer creates a backup at automem.mdc.bak before overwriting. If you need to force update:
npx @verygoodplugins/mcp-automem cursor --yesMemory not recalling project context
Section titled “Memory not recalling project context”Ensure memories are tagged with the project name. Check by running a recall query in Cursor:
Recall memories tagged with [your-project-name]If empty, memories may have been stored without the project tag. Update the .mdc rule file to use the correct project name and re-run the installer.