# hmem — Humanlike Memory for AI Agents

Keeps project knowledge in a SQLite store across sessions and devices, loading detail only when the agent asks for it.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 24
- Author: Bumblebiber
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Bumblebiber/hmem
- Updated: 2026-07-21
- HTML: https://affpapa.org/en/nevibecode/mcp/hmem-humanlike-memory-for-ai-agents

## What it does

hmem gives an agent a working memory instead of a blank slate at the start of every chat. A single `load_project()` call returns a compressed briefing: stack, open bugs, recent decisions, next step — and this works the same way across Claude Code, Codex, Cursor, GitHub Copilot, Windsurf, Cline, Zed and Gemini CLI.

Entries sit in five tiers of detail. Tier one is a one-line summary per entry and loads every time; tiers two through five — a paragraph, full context, extended notes, and the raw original text — only load when the agent actually drills into a record. Conversations get captured automatically through a stop hook, and a background Haiku subagent wakes up every few exchanges to pull out lessons and errors and write a handoff note for whoever picks up the project next.

The server also installs a skills layer: behavior files covering reading, writing, curating and migrating memory entries, updatable on their own schedule via `npx hmem update-skills`. Setup requires pointing `HMEM_STORAGE_DIR` at a storage path, since that's where the SQLite database lives.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `HMEM_STORAGE_DIR` — 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 HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> --transport stdio hmem-humanlike-memory-for-ai-agents -- npx -y hmem-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add hmem-humanlike-memory-for-ai-agents --env HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> -- npx -y hmem-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "hmem-humanlike-memory-for-ai-agents": {
            "command": "npx",
            "args": [
                "-y",
                "hmem-mcp"
            ],
            "env": {
                "HMEM_STORAGE_DIR": "<HMEM_STORAGE_DIR>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "hmem-humanlike-memory-for-ai-agents": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "hmem-mcp"
            ],
            "env": {
                "HMEM_STORAGE_DIR": "<HMEM_STORAGE_DIR>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e HMEM_STORAGE_DIR=<HMEM_STORAGE_DIR> hmem-humanlike-memory-for-ai-agents npx -y hmem-mcp
```
Replace <…> with your own values

## When to use it
- pick up a project's context without re-reading the codebase
- carry memory across Claude, Gemini and other providers
- keep a record of bugs and decisions that the next session actually sees
- get a project briefing in one call instead of recapping manually
- clean up stray or duplicate entries piling up in memory

## Example prompts
- Load project P0048 and tell me where we left off last session
- Run the hmem skill update to pull the latest versions
- Search memory for the rename_id bug we fixed

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