---
name: initmem memory protocol
version: v0.1.1
release_date: '2026-11-30'
download_url: https://initmem.com/INITMEM.md
protocol_type: file-based agent memory protocol
license: MIT
maintainer: Herald Yu
repository: https://github.com/initmem/initmem
website: https://initmem.com/
modification_boundary: >-
  Do not modify the protocol during routine memory writing or maintenance. Revise it only when the user requests an update or rule change; preserve the complete original and local customizations.
---

# initmem memory protocol

## Files and references

- **Entry point.** State that initmem is in use and give the actual locations of the protocol and the memory list. All entry points for the same collection of memories share one list. The entry point and list may occupy the same file.
- **Protocol** (default `INITMEM.md`). Defines how to read, write, and maintain memory.
- **Memory list** (default `MEMORY.md`). Holds current conclusions, one per Markdown bullet on a single line. Each entry states the conclusion and the conditions under which it applies, even if its links are hidden.
- **Topic file** (`memory/<topic>.md`). Create one when a conclusion needs more detail. Open with the question the file answers, then give the evidence, details, or exceptions. Keep each detail in one place. Resolve relative links from the file containing the link.

## Retrieval

Follow the entry point to the list. Look for entries that match both the question and the conditions. Follow links when you need to verify or expand a conclusion. If the list yields no match, search topic files and original sources. Stop once you have enough information. Skip unchanged files already read during this lookup.

## Writing and revision

Before writing, distinguish operating instructions from project knowledge. Put instructions that must be followed consistently in the persistent entry point actually loaded. Put facts, decisions, and evidence for on-demand retrieval in the list or topics. Maintain each piece of content in one place.

1. Record conclusions that have supporting evidence and are worth retrieving again. Keep each claim within the scope of its evidence. For a conclusion likely to change, include the verification date and source.
2. Before writing, check for an existing entry with the same meaning. Put new entries first. When a conclusion changes materially, revise its existing entry and move it to the top. Keep its position for wording-only edits.
3. When two entries appear to conflict, check their conditions and periods of validity. If their conditions differ, state each explicitly. If the conditions match and the evidence is inconclusive, preserve the disagreement until it can be verified. List order indicates only the sequence of revisions.
4. Remove obsolete conclusions from the current list, or state their period or scope of validity if they still need to be referenced. Update the related topics and links.

## Versioning and recovery

Before modifying, moving, or deleting an existing entry point, list, or topic file, verify that its complete current contents can be recovered. If a stored version matches exactly, record its version identifier and file path. Otherwise, copy the original into a fresh version directory under `.initmem/backups/`, preserving its relative path, and verify the copy byte for byte. Proceed once recovery is assured.

Reread the target immediately before writing. If it has changed, protect the new original and merge your changes into it. Review the diff and affected links after writing. When restoring, compare the selected version with the current contents and retain later revisions that still apply.

## Maintenance

When asked to review the entire collection, inspect the persistent entry points actually loaded, the list, and every topic, including unreferenced files. Verify existing content against project files and relevant context; during initial setup, also use these sources to extract supported conclusions worth retrieving again. Check content placement under the writing and revision rules: move ongoing operating instructions from the list or topics into the persistent entry points actually loaded, and move project knowledge for on-demand retrieval from entry points into the list or topics. After moving content, remove the duplicate original and update references, preserving valid evidence, conditions, and unresolved disagreements. If an entry point and list share a file, clearly distinguish operating instructions, memory navigation, and list contents.

Merge equivalent entries, investigate disagreements, repair broken references, and make every still-relevant topic reachable from the list. Read backups only for tracing history or recovery. Report the basis for revisions and anything that still needs verification.

## Protocol updates

When the user requests a protocol update, download the [official protocol](https://initmem.com/INITMEM.md) to a temporary location. Confirm that the download succeeded and has YAML frontmatter with `name: initmem memory protocol` and the heading `# initmem memory protocol`, then read the full text. If it fails, stop the update and explain why. Leave identical content unchanged. If it differs, protect the local protocol under the versioning and recovery rules, compare and merge the texts, preserve local customizations, and check affected references.
