# hmem — Humanlike Memory for AI Agents [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/Bumblebiber/hmem  
**GitHub Stars:** 24  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/hmem-humanlike-memory-for-ai-agents

## Description
Persistent 5-level hierarchical memory for AI agents. SQLite-backed, lazy-loaded.

## Tools
Capabilities this server exposes over MCP:

- **read_memory** — 5-level lazy read — by ID, prefix, search, time, or tag
- **write_memory** — Create new entries with title, body, tags, links
- **append_memory** — Add child nodes to existing entries
- **update_memory** — Patch fields: title, body, tags, irrelevant, links
- **search_memory** — FTS5 full-text search with sub-node attribution
- **find_related** — Find contextually related entries by tag overlap
- **load_project** — Activate a project + get full briefing + recent sessions
- **read_project** — Read project without activating (comparison/reference)
- **create_project** — Scaffold a new project entry with standard schema
- **list_projects** — List all projects with status summary
- **flush_context** — Persist current session context to long-term memory
- **move_nodes** — Move a subtree under a different parent (also in curate server)
- **set_active_device** — Register and switch between devices
- **memory_stats** — Per-prefix counts, total tokens, favorites, hashtags, stale-list
- **memory_health** — Find broken links, orphan tags, empty entries, dangling chains
- **export_memory** — Export the full .hmem to a portable JSON snapshot
- **import_memory** — Import a JSON snapshot back into a .hmem (destructive)
- **update_many** — Bulk-patch a set of entries (irrelevant, tags, body, etc.)
- **tag_bulk** — Add/remove a tag across many entries
- **tag_rename** — Rename a tag globally across all entries
- **move_memory** — Move an entire entry to a new ID slot
- **rename_id** — Rename an entry's ID; rewrites all inbound links
- **reset_memory_cache** — Invalidate the in-memory L1 cache (after raw SQL writes)

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "hmem-humanlike-memory-for-ai-agents": {
    "command": "npx",
    "args": ["-y","hmem"]
  }
}
```

## Documentation

## What hmem — Humanlike Memory for AI Agents does

hmem — Humanlike Memory for AI Agents provides persistent memory for AI agents through MCP. It stores information in a SQLite-backed `.hmem` file and organizes entries as a five-level hierarchy. The structure supports compact summaries at the top and progressively more detailed content below, including complete original text at the deepest levels.

The memory model covers more than standalone notes. Entries can have titles, bodies, tags, links, child nodes, and identifiers. Project entries provide a higher-level way to group work, sessions, decisions, tasks, and other context. The server can activate a project, return its briefing, and show recent sessions, or read a project without changing the active project.

The repository also describes an embeddable TypeScript SDK and a separate company memory store. These allow applications or teams to work with `.hmem` data outside the MCP tool interface, although the MCP listing focuses on the server tools.

## How it works

Reads are lazy. A top-level summary can provide an overview of many entries, while deeper levels are retrieved only when the agent needs additional detail. `read_memory` can address data by ID, prefix, search term, time, or tag. `search_memory` uses SQLite FTS5 and reports which sub-nodes contributed to a result. `find_related` uses overlapping tags to identify related entries.

Project workflows use `load_project` to activate a project and return its briefing and recent sessions. `read_project` provides comparable project information without activation. `create_project` creates a project entry with the repository's standard schema, while `list_projects` returns project status summaries.

These can save exchanges to memory, associate them with the active project, extract lessons and decisions, and write handoff notes. Skills shipped with hmem define behaviors for session startup, reading, writing, searching, project creation, curation, configuration, and related workflows.

## Tools and capabilities

The daily-use tool set includes:

- Create and change entries with `write_memory`, `append_memory`, and `update_memory`.
- Search and relate entries with `search_memory` and `find_related`.
- Manage projects with `load_project`, `read_project`, `create_project`, and `list_projects`.
- Save the current session with `flush_context`.
- Inspect memory with `memory_stats` and `memory_health`.
- Register or switch devices with `set_active_device`.
- Export a complete memory file to JSON with `export_memory`, or restore one with `import_memory`.

Maintenance tools support subtree and entry moves, identifier renaming with inbound-link rewrites, bulk patches, global tag additions or removals, tag renaming, and cache invalidation after raw SQL changes. The README presents these maintenance operations as part of the `hmem-curate` server, separate from the daily-use `hmem` server.

## Limitations and notes

The five-level model reduces initial context but does not automatically expose all stored detail in every read; deeper information must be requested. Importing a JSON snapshot is destructive, so it should be treated as a replacement operation rather than an additive merge.

The project describes two MCP servers: `hmem` for routine memory and project operations, and `hmem-curate` for maintenance. Curation tools are intended to be activated when needed. After direct SQL changes, the in-memory L1 cache must be reset with `reset_memory_cache` so subsequent reads reflect the database state.

hmem — Humanlike Memory for AI Agents can also maintain a separate `company.hmem` store for shared team knowledge.

_Full upstream README: https://allmcps.com/mcp/hmem-humanlike-memory-for-ai-agents/readme_

