# sqlite-graph-memory MCP server

> Enables AI agents to perform associative recall over markdown notes by combining vector search with wikilink graph traversal in SQLite.

- Repository: https://github.com/tonydzi/sqlite-graph-memory
- Page: https://hostedmcp.org/servers/tonydzi/sqlite-graph-memory
- Transport: stdio
- Stars: 15
- License: MIT
- Latest version: 0.3.9

## Install

### Claude Code

```sh
claude mcp add --env BRAIN_INDEX_DIR=<BRAIN_INDEX_DIR> sqlite-graph-memory -- uvx sqlite-graph-memory
```

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

```json
{
  "mcpServers": {
    "sqlite-graph-memory": {
      "command": "uvx",
      "args": [
        "sqlite-graph-memory"
      ],
      "env": {
        "BRAIN_INDEX_DIR": "<BRAIN_INDEX_DIR>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "sqlite-graph-memory": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "sqlite-graph-memory"
      ],
      "env": {
        "BRAIN_INDEX_DIR": "<BRAIN_INDEX_DIR>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "sqlite-graph-memory": {
      "command": "uvx",
      "args": [
        "sqlite-graph-memory"
      ],
      "env": {
        "BRAIN_INDEX_DIR": "<BRAIN_INDEX_DIR>"
      }
    }
  }
}
```

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

```toml
[mcp_servers.sqlite-graph-memory]
command = "uvx"
args = ["sqlite-graph-memory"]

[mcp_servers.sqlite-graph-memory.env]
BRAIN_INDEX_DIR = "<BRAIN_INDEX_DIR>"
```

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

```json
{
  "mcpServers": {
    "sqlite-graph-memory": {
      "command": "uvx",
      "args": [
        "sqlite-graph-memory"
      ],
      "env": {
        "BRAIN_INDEX_DIR": "<BRAIN_INDEX_DIR>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `BRAIN_INDEX_DIR` | yes | no | Directory holding the index. Build it once with `sgm-index /path/to/notes`. |
| `TURNSTATE_DB` | no | no | SQLite file for recall telemetry. |

## FAQ

### How does it handle graph connections?

It uses existing [[wikilinks]] in your markdown notes as the graph edges, performing a 1-hop expansion to find related notes.

### Does it require a separate graph database?

No, it uses a single SQLite file for persistence and parses edges from your notes at query time.

### Can I use it with Obsidian?

Yes, it works with any folder of markdown files, including Obsidian vaults.

### What is the difference between the lite and full versions?

The lite version uses ONNX Runtime and is significantly smaller (approx 155 MB) compared to the version using torch (approx 879 MB).
