# MGI-Mind

A local memory layer for AI agents with hybrid retrieval, a fact graph, and audit history. Useful when context must persist across sessions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: madgodinc
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/madgodinc/mgi-mind
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/mgi-mind

## What it does

MGI-Mind runs as a local MCP server that lets an agent retain notes and facts between sessions. Retrieval combines semantic vectors with exact-term matching, then reorders the candidates with a cross-encoder. The project also includes a knowledge graph, per-agent session logs, and an encrypted local vault for secrets.

It is shipped as a single Rust binary backed by a local Qdrant database and ONNX models. Embeddings, retrieval, reranking, and storage stay on the machine, so no cloud account or API key is required. Start it through MCP with `npx -y mgi-mind`; the assistant can call tools such as `mind_search`, `mind_context`, and `mind_fact add`. The reranker is tuned for English, which matters when the agent works in other languages.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MGIMIND_HOME` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env MGIMIND_HOME=<MGIMIND_HOME> --transport stdio mgi-mind -- npx -y mgi-mind
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mgi-mind --env MGIMIND_HOME=<MGIMIND_HOME> -- npx -y mgi-mind
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mgi-mind": {
            "command": "npx",
            "args": [
                "-y",
                "mgi-mind"
            ],
            "env": {
                "MGIMIND_HOME": "<MGIMIND_HOME>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mgi-mind": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mgi-mind"
            ],
            "env": {
                "MGIMIND_HOME": "<MGIMIND_HOME>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MGIMIND_HOME=<MGIMIND_HOME> mgi-mind npx -y mgi-mind
```
Replace <…> with your own values

## When to use it
- retain agent facts across sessions
- retrieve notes by meaning and exact terms
- resolve new facts against conflicting records
- keep an audit trail for memory changes
- store secrets in an encrypted local vault

## Example prompts
- Save the deployment host as a fact with `mind_fact add`.
- Search memory for the deployment host using `mind_search`.
- Build the session briefing with `mind_context`.

## Similar
- [rag-architect](https://affpapa.org/en/nevibecode/skills/httpsgithubcomjeffallan-rag-architect.md) — skill · 4700 installs
- [qdrant-vector-search](https://affpapa.org/en/nevibecode/skills/qdrant-vector-search.md) — skill · 969 installs
- [Paparats – Local Semantic Code Search MCP](https://affpapa.org/en/nevibecode/mcp/paparats-local-semantic-code-search-mcp.md) — MCP server · ★ 11
- [neural-memory](https://affpapa.org/en/nevibecode/mcp/neural-memory.md) — MCP server · ★ 242
- [Lore](https://affpapa.org/en/nevibecode/mcp/agentkitai-lore.md) — MCP server · ★ 10
- [ableton-mind — Ableton Live MCP server](https://affpapa.org/en/nevibecode/mcp/ableton-mind-ableton-live-mcp-server.md) — MCP server · ★ 9

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
