halflife-mcp
Use this server as local, private, decaying long-term memory for MCP-capable AI agents, with tools to store, retrieve, reinforce, inspect, and delete memories.
Start tasks with a scoped brief of top preferences, procedures, facts, and recent episodes.
Search memories via hybrid keyword/vector/graph ranking, optionally including provisional memories.
Remember preferences, procedures, facts, episodes, and short-lived traces with scope, source, confidence, entities, relations, and contradiction/supersession links.
Reinforce useful or confirmed memories to raise confidence, reset decay, and activate provisional memories.
Permanently forget memories on request, including archived, graph, and index copies.
Inspect individual memories, list memories by scope/kind/status, and view counts, storage location, and vector-search status.
Keep project memory organized by git-root scope plus global memory while storing plain Markdown files locally.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@halflife-mcp check your memory for my preferences before we start this task"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
halflife-mcp
Agent memory that forgets on purpose. Memories fade unless used, inferences stay provisional until confirmed, and corrections supersede instead of overwriting, all in plain Markdown files on your own machine.

Local long-term memory for AI agents, served over MCP. It runs on your own laptop: no account, no cloud service, no telemetry. Works with any MCP client that can launch a stdio server, such as Claude Code, Claude Desktop, Cursor, Zed or VS Code.
The agent gets five kinds of memory:
Kind | Holds | Fades (half-life) |
| how you like things done ("use uv, not pip") | 180 days |
| workflows that worked ("release = tag, then | 365 days |
| durable facts not in the code or docs | 180 days |
| what happened in a past task: goal, decisions, open items | 30 days |
| short-lived log of files/commands, for resuming work | 7 days, deleted after 30 |
Memories you use get reinforced and stay. Unused ones fade and are archived: moved, never silently deleted. Inferred memories stay provisional (hidden) until confirmed. A correction supersedes the old memory instead of contradicting it.
Install
You need uv. Then add the server to your client.
Claude Code
claude mcp add memory --scope user -- uvx halflife-mcpClaude Desktop (Settings → Developer → Edit Config → claude_desktop_config.json), Cursor
(~/.cursor/mcp.json) and most other clients use the same shape:
{
"mcpServers": {
"memory": {
"command": "uvx",
"args": ["halflife-mcp"]
}
}
}If the client can't find uvx, put its absolute path in command (which uvx).
Local HTTP mode
For clients that connect by URL instead of launching a command, run the server yourself:
uvx halflife-mcp serve --http # http://127.0.0.1:8765/mcp
claude mcp add --transport http memory http://127.0.0.1:8765/mcp # e.g. Claude CodeThere is no authentication, so it listens on loopback only: other machines can't reach it.
Requests whose Host or Origin isn't local are rejected, which stops a web page from
talking to it. --port changes the port. A non-loopback --host is refused unless you pass
--allow-network; don't use that flag on a network you don't control.
claude.ai (web/mobile) can't use this. Its custom connectors are called from Anthropic's
servers, so they can't reach your localhost. They need a public HTTPS URL with
authentication, which this project doesn't provide.
Optional: vector search
The default install is light: keyword (BM25) and graph search, with no ML dependencies. For
semantic matching (finding "k8s workloads" from a memory about "the kubernetes cluster"), use
the vector extra:
"args": ["--with", "fastembed>=0.4", "--with", "numpy>=1.24", "halflife-mcp"]This adds fastembed (ONNX, CPU only). The first start downloads a 65 MB model
(BAAI/bge-small-en-v1.5); after that it runs offline. Existing memories are embedded
automatically.
Related MCP server: heropen
Tools
Tool | What it does |
| Start-of-task pack: top preferences and procedures, the strongest facts, recent episodes (capped at 8/6/5/3) |
| Hybrid search: keyword + vector + graph, fused by reciprocal-rank fusion. Read-only |
| Store a memory; a near-duplicate reinforces the existing one instead |
| A memory was confirmed or useful: confidence up, decay reset, provisional → active |
| Permanently delete (file, graph, archived copy, index) |
| Inspect |
The server sends the model instructions on when to use each tool. It should call brief and recall at the start of a task, remember preferences when you state them, write an episode at the end, and forget on request. Memory only works as well as the model follows them, because an MCP server can't see the conversation. If memory isn't being used, tell the agent "check your memory" or "remember that…".
Scope. Pass the project path as scope and it is normalized to the git root, so
subfolders share one project memory. Omit it, or use global, for things that apply
everywhere. Project queries include global memories but not other projects' memories. Scope
keeps memory organized; it is not access control: any connected client can ask for any scope,
and project paths that differ only in punctuation (my-app, my_app) share one scope.
Where your data lives
OS | Default location |
Linux |
|
macOS |
|
Windows |
|
Set HALFLIFE_HOME to put it elsewhere, for example a synced folder.
memories/<scope>/<name>.md one memory per Markdown file: readable, editable, greppable
memories/<scope>/_graph/<name>.json its entities and relations
memories/<scope>/_archive/ faded and superseded memories
index.sqlite3 derived index (SQL, vectors, graph); rebuildable
models/ embedding model (vector extra only)The Markdown files are the source of truth. Edit or delete them by hand and the index catches
up on the next call. halflife-mcp rebuild recreates the index from the files.
Privacy
Memories are stored only on your machine, and the server makes no network calls apart from the one-time model download with the vector extra. But whatever the agent recalls goes into its prompt, so a client that uses a cloud model sends those memories to its provider.
Writes that look like secrets are refused, not redacted. That covers API keys, tokens, passwords, private keys,
user:pass@URLs and JWTs.memory_forgetdeletes for real, including archived copies.The data directory is created with mode 0700.
CLI
uvx halflife-mcp stats # what's stored, where
uvx halflife-mcp brief --scope ~/code/my-app
uvx halflife-mcp recall "how do we deploy" --scope ~/code/my-app
uvx halflife-mcp maintain # archive faded, expire traces
uvx halflife-mcp rebuild # rebuild the index from filesConfiguration
Variable | Default | |
| per-OS path above | data directory |
| on (if the extra is installed) |
|
|
| another fastembed model (recall thresholds are tuned for the default) |
Development
uv venv && uv pip install -e ".[vector]" pytest anyio
.venv/bin/python -m pytest -quvx --from <local path> caches the built package. After changing the code, run it once with
uvx --no-cache --from …, or use the editable venv's .venv/bin/halflife-mcp as the
client command.
License
Apache License 2.0; see the LICENSE file.
Available Tools
8 toolsmemory_briefARead-only
What to know before starting work: the top preferences (up to 8) and procedures (6), the strongest facts (5) and the most recent episodes (3) for this scope (plus global). Bodies are clipped; use memory_get for a full memory.
Inputs: scope. Returns: object
memory_forgetADestructive
Permanently delete a memory (file, graph, archived copy, index). Only when the user asks to forget something.
Inputs: id (required). Returns: object
memory_getBRead-only
One memory in full, with its metadata and graph.
Inputs: id (required). Returns: object
memory_listARead-only
List memories of a scope (plus global), newest first. status: active | provisional. Use when the user asks what you remember.
Inputs: kind, limit, scope, status. Returns: object
memory_recallARead-only
Search memory with hybrid keyword + vector + graph ranking. query: a short
description of the task or question (names of files, tools and projects help).
kinds defaults to all except trace. Returns the best matches, best first, with the
signals that found them. Read-only.
Inputs: query (required), k, kinds, scope, +1 more. Returns: object
memory_reinforceA
A memory was confirmed or proved useful: raises its confidence, resets its decay and activates it if provisional.
Inputs: id (required). Returns: object
memory_rememberA
Store one memory. kind: preference | procedural | fact | episodic | trace. content: the memory itself, short (for preference/procedural include why and how to apply). description: one keyword-rich line (used for matching; defaults to the first line). provisional: true when inferred rather than stated by the user. contradicts: id of a memory this one replaces. entities: [{"name", "type"}] for the specific files/tools/projects/people/concepts it is about (type: file, repo, tool, library, service, person, concept, ticket, command, project, organization). relations: [{"src", "rel", "dst"}] between those entities (rel: uses, depends_on, part_of, configures, fixed, caused, contradicts, supersedes, related_to, owns, prefers). source: where it came from (URL, file path). A near-duplicate reinforces the existing memory instead of creating a new one.
Inputs: kind (required), content (required), name, scope, +7 more. Returns: object
memory_statsBRead-only
Counts per scope, kind and status; where the data lives; whether vector search is on.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The verbs are largely distinct: remember/get/forget/reinforce/stats are unambiguous. However, memory_recall, memory_list, and memory_brief all surface memories and could be confused—recall is query-driven search, list is scoped enumeration, and brief is a curated pre-work digest. The descriptions do clarify the boundary, so it's a minor overlap rather than a real ambiguity.
Every tool uses the same memory_ prefix followed by a short, readable suffix (recall, reinforce, forget, get, list, stats, brief, remember). The pattern is uniform throughout with no casing or convention drift.
Eight tools is well-scoped for a memory subsystem, with each tool earning its place (store, search, get, list, stats, reinforce, forget, brief). Nothing feels padded or missing.
The lifecycle is fully covered: create (remember), read (get/list/recall/brief), reinforce, and delete (forget), plus stats. Updates are handled via the contradicts/supersedes fields and reinforcement, so there is no dead end for the memory domain.
Maintenance
Related MCP Connectors
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides a local, persistent long-term memory service for MCP-compatible AI agents, enabling them to store, search, and recall information across sessions.1GPL 3.0
- AlicenseNot gradedqualityBmaintenanceA local memory server for AI agents that stores and retrieves information via MCP, keeping all data in SQLite on your machine.53 PyPI1Apache 2.0
- AlicenseCqualityAmaintenanceProvides AI agents with a human-inspired memory layer via MCP, enabling episodic and semantic memory recall, forgetting curves, consolidation, and contradiction detection. It integrates with MCP clients to offer local-first, dependency-free memory management.981MIT
- AlicenseCqualityCmaintenanceLocal-first, governable long-term memory for AI agents. Provides SQLite-backed storage, cross-session recall, and traceable memory corrections through a standard MCP interface.401MIT