Humanlike persistent memory for AI agents — MCP server with 5-level lazy-loaded SQLite memory. Works with Claude Code, Gemini CLI, Cursor, Windsurf, OpenCode.
# hmem — Humanlike Memory for AI Agents
> Your AI forgets everything between sessions. **hmem fixes that.**
One `read_memory()` call. 5k tokens. Your agent knows every project, every past mistake, every decision you ever made together — across sessions, devices, and AI providers. No setup per conversation. No "let me re-read the codebase." It just *remembers*.
---
## The Problem
Every AI session starts from zero. Your agent asks the same questions, makes the same mistakes, contradicts last week's decisions, and wastes 50k tokens loading context it already processed yesterday.
You've tried workarounds — CLAUDE.md files, custom prompts, manually pasting context. They don't scale. You have 10 projects. You switch between 3 devices. You use different AI tools.
## The Solution
```
You: "Load project hmem"
Agent: [calls load_project("P0048") — 700 tokens]
Agent: "Got it. v5.0.0, TypeScript/SQLite/npm, 10 source files,
3 open tasks, 9 ideas. Last session you implemented
auto-checkpoints via Haiku. What's next?"
```
That's it. 700 tokens for a complete project briefing. The agent knows the stack, the architecture, the open bugs, the recent decisions, and exactly where you left off — even if "you" was a different AI on a different machine yesterday.
---
## How It Works
```
Level 1 ── One-line summary (always loaded — ~5k tokens for 300+ entries)
Level 2 ── Paragraph detail (loaded on demand)
Level 3 ── Full context (loaded on demand)
Level 4 ── Extended detail (loaded on demand)
Level 5 ── Raw/verbatim data (loaded on demand)
```
At session start, the agent loads Level 1 summaries — one line per memory. When it needs detail, it drills down. Your 300-entry memory costs 5k tokens to overview. A single project costs 700.
**Nothing is summarized away.** Level 1 is a summary, but Levels 2-5 hold the complete original text, word for word, accessible on demand.
---
## What Makes v5 Agent that generates comprehensive documentation, API references, architecture diagrams, and developer onboarding guides from existing code.
Agent configuration for systematic bug investigation that traces issues from error logs through the codebase to root cause with suggested fixes.
Agent for integrating third-party APIs including SDK setup, type generation, error handling, retry logic, and rate limit management.
Cursor's built-in autonomous coding agent that can make multi-file edits, run terminal commands, search the codebase, and iteratively build features with minimal human intervention.
Cloud-based autonomous coding agent that runs in the background on remote sandboxed environments, handling complex multi-step tasks while you continue working.
Cursor's multi-file editing agent within Composer mode that can create, edit, and delete files across your entire project in a single conversation.