# SQLite Local AI Memory

> SQLite Local AI Memory is an open-source MCP server for databases. Local SQLite memory for AI assistants with hybrid search and automatic cleanup. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, macOS, Windows, Linux
- **Repository:** https://github.com/cheveguerra/sqlite-local-ai-memory
- **MCP Registry name:** io.github.cheveguerra/sqlite-local-ai-memory
- **Categories:** [databases](https://ai-powered.com/categories/databases), [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-11-23

## About

Instead of an external vector service, this server keeps an assistant's long-term memory in one SQLite file on your machine, by default ~/.local-ai-memory/memoria.db, with a SQLITE_MEM_PATH variable to move it. It uses full-text search together with int8 vectors, and blends exact keyword matches with semantic results. The README quotes sub-millisecond lookups for active notes.

The design has an active notepad for current work, a knowledge vault for lasting facts, and an AutoDream pass that merges duplicates and archives unresolved cases. A contradiction arbiter marks an old fact as superseded when a newer one conflicts, such as a changed server IP, and a two-layer filter drops small talk before a model is called.

Storage stays local, but the reasoning layer needs a model. The default is the Google Gemini API using a GEMINI_API_KEY, and it can run offline with Ollama instead. With neither, it falls back to plain keyword storage, which the README says loses most of the intelligent features. It can also be used as a Node.js library.

## Features

- **Single-file memory:** All notes and indexes live in one local SQLite database.
- **Hybrid search:** Combines FTS5 keyword search with vector search using reciprocal rank scoring.
- **AutoDream cleanup:** Merges duplicates and archives unresolved cases for later.
- **Contradiction arbiter:** Archives outdated facts when a newer fact conflicts.
- **Noise filter:** Drops casual chatter before invoking larger models.
- **Gemini or Ollama:** Cloud-assisted with Gemini, or fully offline with Ollama.
- **Offline fallback:** Keyword-only storage when no model is available.

## Good for

- Remember project decisions across chat sessions
- Keep server settings and preferences as updatable facts
- Resume debugging an unresolved issue weeks later
- Add persistent memory to a custom Node.js agent

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add sqlite-local-ai-memory --env GEMINI_API_KEY='<GEMINI_API_KEY>' -- npx -y sqlite-local-ai-memory
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add sqlite-local-ai-memory --env GEMINI_API_KEY='<GEMINI_API_KEY>' -- npx -y sqlite-local-ai-memory
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.sqlite-local-ai-memory]
command = "npx"
args = ["-y", "sqlite-local-ai-memory"]
env = { GEMINI_API_KEY = "<GEMINI_API_KEY>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e GEMINI_API_KEY='<GEMINI_API_KEY>' sqlite-local-ai-memory npx -- -y sqlite-local-ai-memory

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "sqlite-local-ai-memory": {
      "command": "npx",
      "args": [
        "-y",
        "sqlite-local-ai-memory"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}
```

## FAQ

### Where is my data stored?

In a local SQLite file, by default ~/.local-ai-memory/memoria.db.

### Does SQLite Local AI Memory need an API key?

Not strictly; Gemini is the default, Ollama works offline, and without either it falls back to keyword search.

### Which clients can use SQLite Local AI Memory?

Any stdio MCP client such as Claude Desktop, Cursor or VS Code.

### Is SQLite Local AI Memory free?

Yes. SQLite Local AI Memory is open source, so you can use and self-host it for free.

### How do I add SQLite Local AI Memory to Claude Code?

Run this command in your terminal: claude mcp add sqlite-local-ai-memory --env GEMINI_API_KEY='<GEMINI_API_KEY>' -- npx -y sqlite-local-ai-memory

### What are the best alternatives to SQLite Local AI Memory?

The closest alternatives to SQLite Local AI Memory are Codebase Memory, XERJ, MCP Toolbox for Databases, Claude Code Ultimate Guide and IWE (iwe.md).

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [MCP Toolbox for Databases](https://ai-powered.com/mcp/mcp-toolbox-for-databases-2): MCP Toolbox for Databases is an open-source MCP server for databases.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [IWE (iwe.md)](https://ai-powered.com/mcp/iwe-iwe-md): IWE (iwe.md) is an open-source MCP server for knowledge and memory.
- [Deja Vu](https://ai-powered.com/mcp/deja-vu): Deja Vu is a free MCP server for developer tools.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.
- [Code-Graph-RAG](https://ai-powered.com/mcp/code-graph-rag): Code-Graph-RAG is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/sqlite-local-ai-memory
