# memory-industry

Long-term memory for coding agents: a knowledge graph they can search, reason over and correct between sessions.

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

## What it does

MemoryIndustry, previously cuba-memorys, is an MCP server written in Rust and backed by PostgreSQL 18 with pgvector. It hands your agent a knowledge graph to search and reason over, so the codebase stops slipping away when a session ends. The package ships 31 MCP tools (32 with `CUBA_DOCS=1`) and 28 CLI commands, including hybrid BM25+MMR retrieval and claim verification with an LLM judge.

Setup is two lines: `pip install memory-industry` (or `npm install -g memory-industry`), then `claude mcp add memory-industry -- memory-industry`. On the first run it provisions a PostgreSQL 18 + pgvector container through Docker and creates the schema. Docker has to be running — without it the server never comes up. You can point it at your own database instead by setting `DATABASE_URL`; that database needs the `vector` and `pg_trgm` extensions, and `cuba-memorys doctor` reports what is missing. `cuba-memorys setup` writes the config for every client it finds, while `setup check` compares them, because two configs with different embedding dimensions break search without saying so.

One shared daemon can replace a process per client. `cuba-memorys serve` listens on `127.0.0.1:8787` and loads the models once instead of once per editor window. Bind it anywhere other than loopback and `CUBA_HTTP_TOKEN` becomes mandatory, at least 32 characters on a routable address; otherwise the whole graph is served with no authentication.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `DATABASE_URL`, `CUBA_PROJECT_FILTER`, `CUBA_SYNC_DIR`, `CUBA_JUDGE`, `CUBA_JUEZ_CLI`, `CUBA_JUEZ_MODEL`, `CUBA_REM_RELATION_BATCH`, `CUBA_RERANKER_PATH`, `CUBA_RERANK_FIXED_SHAPE` — 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 DATABASE_URL=<DATABASE_URL> --env CUBA_PROJECT_FILTER=<CUBA_PROJECT_FILTER> --env CUBA_SYNC_DIR=<CUBA_SYNC_DIR> --env CUBA_JUDGE=<CUBA_JUDGE> --env CUBA_JUEZ_CLI=<CUBA_JUEZ_CLI> --transport stdio memory-industry -- npx -y memory-industry
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add memory-industry --env DATABASE_URL=<DATABASE_URL> --env CUBA_PROJECT_FILTER=<CUBA_PROJECT_FILTER> --env CUBA_SYNC_DIR=<CUBA_SYNC_DIR> --env CUBA_JUDGE=<CUBA_JUDGE> --env CUBA_JUEZ_CLI=<CUBA_JUEZ_CLI> -- npx -y memory-industry
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "memory-industry": {
            "command": "npx",
            "args": [
                "-y",
                "memory-industry"
            ],
            "env": {
                "DATABASE_URL": "<DATABASE_URL>",
                "CUBA_PROJECT_FILTER": "<CUBA_PROJECT_FILTER>",
                "CUBA_SYNC_DIR": "<CUBA_SYNC_DIR>",
                "CUBA_JUDGE": "<CUBA_JUDGE>",
                "CUBA_JUEZ_CLI": "<CUBA_JUEZ_CLI>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "memory-industry": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "memory-industry"
            ],
            "env": {
                "DATABASE_URL": "<DATABASE_URL>",
                "CUBA_PROJECT_FILTER": "<CUBA_PROJECT_FILTER>",
                "CUBA_SYNC_DIR": "<CUBA_SYNC_DIR>",
                "CUBA_JUDGE": "<CUBA_JUDGE>",
                "CUBA_JUEZ_CLI": "<CUBA_JUEZ_CLI>"
            }
        }
    }
}
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e DATABASE_URL=<DATABASE_URL> -e CUBA_PROJECT_FILTER=<CUBA_PROJECT_FILTER> -e CUBA_SYNC_DIR=<CUBA_SYNC_DIR> -e CUBA_JUDGE=<CUBA_JUDGE> -e CUBA_JUEZ_CLI=<CUBA_JUEZ_CLI> memory-industry npx -y memory-industry
```
Replace <…> with your own values. 4 more environment variables are in the server README

## When to use it
- find a code fragment in agent memory by meaning instead of exact wording
- keep decisions and agreements across Claude sessions
- verify an agent's claim about the code with an LLM judge
- share one memory across several editor windows without duplicate model copies
- compare MCP configs across clients and catch an embedding dimension mismatch

## Example prompts
- Search memory for what we decided about the auth schema
- Save to memory: migrations run through alembic
- Verify the claim that this module is never called

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
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
