# IHMT Memory [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/gonzaroman/IHMT-MEMORY  
**GitHub Stars:** 39  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ihmt-memory

## Description
Long-term memory for AI coding agents, stored as a tree of plain local files.

## Tools
Capabilities this server exposes over MCP:

- **search_memory** — Search the user's long-term memory (IHMT): decisions, setup, preferences, people, earlier sessions.

    Use several distinctive words, not a bare name. Returns the best memory with its date
    (plus one line per other match). AMBIGUOUS means several memories fit equally: ask the
    user or call again with `clue` (a place, date, project). Always relay OUTDATED notices.

    Args:
        query: What to look for, in any language.
        clue: Distinguishing detail, only after an AMBIGUOUS reply.
        detail: "compact" (default) or "full" (adds ids, tree paths and excerpts).
    
- **save_memory** — Store durable knowledge in the user's long-term memory (IHMT).

    Save decisions and why, setup, preferences, people and projects, procedures. Not transient
    chat, not secrets. Write it to make sense months later, and start with the date
    ("2026-02-03: ...") when it belongs to one. Reports how it was filed and any contradiction
    with an earlier memory — relay that notice.

    Args:
        content: The text to remember, self-contained.
        domain: Leave "general" to let IHMT classify it, or e.g. "software.java".
        content_type: "auto" (recommended), "code", "narrative", "clinical", "personal",
            "process" or "generic".
        replaces: When this corrects or updates something saved earlier, a few distinctive
            words describing that earlier memory ("RainDesktop version 1.3"). It is then
            flagged OUTDATED and searches answer with this one first. If several memories
            fit, nothing is flagged and the candidates are listed for `mark_outdated`.
    
- **mark_outdated** — Flag one memory as corrected by another, after save_memory listed candidates.

    The old memory is kept (it was true on its date) but carries an OUTDATED notice, and
    searches answer with the new one first. Use the ids save_memory or a full search printed.

    Args:
        old_id: Id of the memory that is no longer current.
        new_id: Id of the memory that replaces it.
    
- **project_map** — Compact map of a codebase: files with their size in tokens, optionally their symbols and line ranges.

    Call it before exploring a project instead of listing directories and opening files.
    Indexes the project on first use and resyncs changed files by checksum on every call.

    Args:
        path: Project root directory (absolute).
        detail: "files" (cheapest) or "symbols" (adds methods/classes with first-last line).
        subpath: Restrict to a directory inside the project, e.g. "src/main".
    
- **find_code** — Find the method or class that answers a question about a codebase; returns only that symbol.

    Output: "file:first-last  Symbol" and its code, instead of whole files. Name the class or
    method if you know it ("PedidoJpaMapper aDominio"). AMBIGUOUS lists candidates in different
    files: refine the query or pass `clue`. The index resyncs by checksum, so code is never stale.

    Args:
        query: What you are looking for: identifiers plus a few words.
        path: Project root directory (absolute).
        scope: "main" (skip tests, default), "test" or "all".
        subpath: Restrict to a directory inside the project.
        clue: Extra detail after an AMBIGUOUS reply.
        max_tokens: Cap on the returned code.
    
- **read_file** — Read a text file, remembering what you were given this session.

    Reading it again returns "UNCHANGED" (a few tokens) or only a unified diff against your earlier
    copy. Prefer it over re-reading a file you already read in this session. Pass force=true if
    the earlier copy is no longer in your context (e.g. after a context compaction). With
    start_line/end_line (e.g. a range from project_map) only those lines are returned.

    Args:
        path: Absolute path of the file.
        force: Return the full content even if it has not changed.
        start_line: First line to return (1-based); 0 for the whole file.
        end_line: Last line to return (inclusive); 0 for the end of the file.
    
- **note** — Keep something you learned in this session (where a thing lives, what a method does, a result).

    Session notes are cheap to recall later and survive a context compaction; they vanish when the
    session ends. Include file:line when relevant. Durable facts belong in save_memory instead.
    
- **recall** — Search what you kept earlier in this session with note or digest_output (not long-term memory).

    Cheaper than re-reading files or re-running commands to remember what you already found out.
    
- **digest_output** — Condense a long command output (build log, test report) and keep the full text for recall.

    Returns the first lines, every line that mentions errors, failures, warnings or test totals,
    and the last lines. The whole output stays queryable with recall("<label> ...") this session.

    Args:
        text: The raw output.
        label: A short name to recall it by, e.g. "maven-build".
    

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

```json
"mcpServers": {
  "ihmt-memory": {
    "command": "uvx",
    "args": ["ihmt-memory"],
    "env": {
      "IHMT_HOME": ""
    }
  }
}
```

**Requires environment variables:** `IHMT_HOME` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What IHMT Memory does

IHMT Memory provides two kinds of context for AI coding agents: durable knowledge that survives future sessions and temporary notes that last only for the current session. Durable memories can cover decisions and their rationale, development setup, preferences, people, projects, and procedures. The storage is local and consists of readable files organized as a recursive hierarchy, so the memory can be backed up, copied, or placed under version control.

The server also supports focused codebase investigation. It can build a compact project map, find the class or method relevant to a question, return selected file ranges, and retain or condense information during a session. This makes it suitable for agents that need both personal continuity and repeatable repository exploration.

## How it works

Memory is arranged as a tree rather than a flat collection. Text records sit at the leaves, with JSON summaries branching upward to a root file. Searches navigate from the root through relevant branches to matching leaves, returning the best result and concise alternatives. Full results can include identifiers, tree paths, and excerpts.

When a stored fact changes, the previous record remains as history and can be marked `OUTDATED`; searches prioritize its replacement. A search can report ambiguity instead of choosing between equally plausible memories, after which a place, date, project, or other clue can narrow the result.

Project indexes are created on first use and synchronized by file checksums on later calls. Reading a file again during the same session returns an unchanged indicator or a unified diff when appropriate, reducing repeated output.

## Setup and configuration

IHMT Memory requires Python 3.10 or newer, git for the repository installation path, and an MCP client that can run local commands. The documented installation targets macOS and Linux; Windows instructions are available but are not tested. No administrator account, database, or paid service is required, and internet access is needed during installation to obtain the code or package.

A repository-based installation clones the project, creates a virtual environment, installs `requirements-mcp.txt`, and creates `~/.ihmt`. The server can then be registered with a client using the virtual-environment Python executable and `mcp_server.py`. The PyPI route uses `uvx ihmt-memory`, avoiding a clone and virtual environment; `pipx` is also supported.

Set `IHMT_HOME` to place the memory in a folder other than `~/.ihmt`, including an existing memory shared by multiple agents. The client-specific setup also adds the project’s memory instructions so the agent searches before answering and saves durable corrections. Supported installation examples cover Claude Code, Codex, and opencode.

## Tools and capabilities

- `search_memory` retrieves relevant long-term records, reports dates and alternate matches, and supports compact or full output.
- `save_memory` stores durable knowledge with optional domains, content types, and replacement references.
- `mark_outdated` links an older record to the newer memory that supersedes it.
- `project_map` inventories files and optionally symbols and line ranges for a project or subdirectory.
- `find_code` returns the matching class or method, with controls for test scope, subpaths, clues, and output size.
- `read_file` returns full files or line ranges and can produce a diff against content already read in the session.
- `note` stores temporary session knowledge, while `recall` searches those notes and `digest_output` condenses command output while keeping it queryable.

## Limitations and notes

Session notes disappear when the session ends; durable facts should be saved with `save_memory`. The memory system is intended for durable knowledge rather than transient conversation or secrets. Retrieved memories are passed to the agent model as context. Chat-only assistants that cannot run terminal commands or edit configuration files cannot perform the installation themselves.

The server is designed for local operation and stores data on disk rather than in a cloud service or database. Official support is listed for Claude Code, with Codex and opencode tested as additional clients. Other clients that support local stdio MCP servers may work, but client-specific testing varies.

_Full upstream README: https://allmcps.com/mcp/ihmt-memory/readme_

