# CortexGraph MCP server

> Provides AI assistants with a human-like memory system that uses temporal decay and reinforcement to manage short-term and long-term information.

- Repository: https://github.com/simplemindedbot/mnemex
- Page: https://hostedmcp.org/servers/simplemindedbot/mnemex
- Transport: stdio
- Stars: 39
- License: AGPL-3.0
- Latest version: 0.5.2

## Install

### Claude Code

```sh
claude mcp add mnemex -- uvx mnemex
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mnemex": {
      "command": "uvx",
      "args": [
        "mnemex"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mnemex": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mnemex"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mnemex","type":"stdio","command":"uvx","args":["mnemex"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mnemex": {
      "command": "uvx",
      "args": [
        "mnemex"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mnemex -- uvx mnemex
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mnemex]
command = "uvx"
args = ["mnemex"]
```

### Gemini CLI

```sh
gemini mcp add -s user mnemex uvx -- mnemex
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mnemex": {
      "command": "uvx",
      "args": [
        "mnemex"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CORTEXGRAPH_AUTO_REINFORCE` | no | no |  |
| `CORTEXGRAPH_DECAY_BETA` | no | no |  |
| `CORTEXGRAPH_DECAY_LAMBDA` | no | no |  |
| `CORTEXGRAPH_DECAY_MODEL` | no | no |  |
| `CORTEXGRAPH_FORGET_THRESHOLD` | no | no |  |
| `CORTEXGRAPH_PL_ALPHA` | no | no |  |
| `CORTEXGRAPH_PL_HALFLIFE_DAYS` | no | no |  |
| `CORTEXGRAPH_PROMOTE_THRESHOLD` | no | no |  |
| `CORTEXGRAPH_REVIEW_BLEND_RATIO` | no | no |  |
| `CORTEXGRAPH_REVIEW_DANGER_ZONE_MAX` | no | no |  |
| `CORTEXGRAPH_REVIEW_DANGER_ZONE_MIN` | no | no |  |
| `CORTEXGRAPH_STORAGE_PATH` | no | no |  |
| `LTM_VAULT_PATH` | no | no | Path to Obsidian vault for long-term memory |
| `MNEMEX_DECAY_MODEL` | no | no | Decay model: power_law (default), exponential, or two_component |
| `MNEMEX_PL_HALFLIFE_DAYS` | no | no | Half-life in days for power-law decay model |
| `MNEMEX_STORAGE_PATH` | no | no | Storage path for short-term memory JSONL files |

## Tools (13)

- `save_memory`
- `search_memory`
- `search_unified`
- `touch_memory`
- `observe_memory_usage`
- `analyze_message`
- `analyze_for_recall`
- `promote_memory`
- `cluster_memories`
- `consolidate_memories`
- `read_graph`
- `open_memories`
- `create_relation`

## FAQ

### Is CortexGraph suitable for production use?

No, it is a research artifact and proof of concept intended to validate theoretical frameworks. It is not a commercial product and offers no guarantees of stability.

### How is my data stored and secured?

All data is stored locally on your machine using JSONL files or SQLite for short-term memory, and Markdown files for long-term memory. There are no cloud services or tracking involved.
