# IHMT — Infinite Hierarchical Memory Tree

> Local long-term memory MCP server that gives AI coding agents persistent, time-aware recall stored as a tree of plain text files.

IHMT (Infinite Hierarchical Memory Tree) is an open-source, MIT-licensed long-term memory system for AI coding agents, published by gonzaroman. It runs as a stdio MCP server that lets agents such as Claude Code, Codex and opencode save decisions, preferences and corrections once and retrieve them in later sessions and across projects.

## What It Is

IHMT stores memory locally as a recursive tree of plain files: raw text leaves at the bottom, JSON summaries above them, and a single root.json trunk. Searches walk the tree from root to branch to leaf rather than scanning a flat index, so the README says retrieval typically costs 200–900 tokens regardless of memory size. It needs no vector database, server or account, and the core uses only Python 3.10+ and the standard library.

## How Memory Is Saved and Retrieved

The MCP server exposes nine tools in three families: long-term memory (search_memory, save_memory, mark_outdated), project indexes (project_map, find_code, read_file) and session scratch memory (note, recall, digest_output). Ingestion detects the type and domain of each document and splits it without cutting logical blocks, using code-, narrative-, date- and process-aware chunkers. Ranking uses BM25 and, when a query is ambiguous, the agent is asked for a clue instead of guessing.

## Time Awareness

IHMT records dated facts such as location, workplace and stack. When a value changes, the older memory is kept as history, flagged OUTDATED, and searches return the current one first. Corrections can also be linked explicitly with the replaces parameter.

## Setup Path

An agent can install it from a prompt that points to INSTALL.md, or users can install manually from a git clone or via uvx from the ihmt-memory PyPI package. Claude Code is officially supported; Codex and opencode are tested, and other MCP clients should work but are untested. A local graphical interface and a CLI are also included. The README states that matching is lexical rather than semantic and that writes assume a single writer.

## Features
- Persistent long-term memory across sessions and projects
- Shared memory across Claude Code, Codex and opencode
- Tree-based retrieval with BM25 ranking
- Time-aware facts with OUTDATED flagging and history
- Ambiguity detection with clue loop
- Plain-text, local, portable memory folder
- Project code indexes with symbol-level lookup
- Session scratch memory and log digesting
- Local graphical interface (bilingual ES/EN)
- CLI and Python library
- Optional Anthropic summarizer backend with heuristic fallback

## Integrations
Claude Code, Codex, opencode, GitHub Copilot, Cursor, Windsurf, Gemini CLI, Claude Desktop, Antigravity, PyPI, Anthropic

## Platforms
MACOS, LINUX, WINDOWS, CLI, API

## Pricing
Open Source

## Links
- Website: https://github.com/gonzaroman/IHMT-MEMORY
- Documentation: https://github.com/gonzaroman/IHMT-MEMORY/blob/main/GUIDE.md
- Repository: https://github.com/gonzaroman/IHMT-MEMORY
- EveryDev.ai: https://www.everydev.ai/tools/ihmt-memory
