## TL;DR
Memories vanish between sessions when `MEMORY_FILE_PATH` is unset, relative, or different per client: each launch then writes to a different file (or a temp default). Set `MEMORY_FILE_PATH` to one absolute, writable path in every client's MCP config. All sessions then share the same knowledge graph file.

## The error
```text
Error: Changes not saved across sessions
```

## Fix it
1. **Check what path each client is actually using.** Look at the `env` block of the memory entry in every MCP config (Claude Desktop, Claude Code, Cursor each have their own).
   - Expected: you find either no `MEMORY_FILE_PATH` or different values per client.
2. **Set one absolute path everywhere:**
   ```json
   {
     "mcpServers": {
       "memory": {
         "command": "npx",
         "args": ["-y", "@modelcontextprotocol/server-memory"],
         "env": { "MEMORY_FILE_PATH": "[HOME]/..." }
       }
     }
   }
   ```
   - Expected: identical absolute path in every client config.
3. **Make sure the file is writable** (`touch` it once as your user), then create a test entity and restart the client.
   - Expected: the entity is still there after restart.

## When to use
- Entities created in one session are missing in the next.
- Different clients (Desktop vs Code) seem to have different memories.

## When NOT to use
- Duplicate entities piling up - that is a naming/search_nodes discipline problem.
- memory.json over 10MB and slow - that is bloat, prune it.
- Server will not start at all - check npx and the install first.

## Compatibility
- @modelcontextprotocol/server-memory, all clients.

## Root cause
The server persists the knowledge graph to the JSONL file at `MEMORY_FILE_PATH`. Without the variable it falls back to a default location that varies by working directory, so two clients (or two launches) silently use two different files. A relative path has the same effect because the server's working directory differs per client.

## Edge cases
- Do not point the file inside a synced folder with aggressive conflict handling unless you enjoy resolving JSONL merge conflicts.
- Keep secrets out of the file: it is plain text on disk and outlives the session.
- Back the file up before pruning; there is no undo for delete_entities.
