HMG (Hierarchical Memory Graph) is an agent memory protocol and SDK for storing, recalling, correcting, and governing structured memories in coding agents and AI systems. This repository contains the protocol specification, SDKs (TypeScript, Python), certification suite, and pi-agent integration.
HMG Agent Memory System exposes 10 tools with mixed quality. Tool names follow verb_noun convention (memory_agent_brief, memory_recall, memorize, recall, correct, govern, handoff, agent_brief, bulk_memorize, stats) which is good. However, descriptions vary significantly in quality and completeness. Most tools have descriptions (8/10), but several are generic or lack actionable context. Parameter schemas are present but inconsistently detailed, many lack type constraints, enums, or validation guidance. Output schemas are not documented. Error handling is minimal; no recovery guidance or categorization visible. The 'govern' tool with IRREVERSIBLE risk lacks confirmation/dry-run patterns. Overall, this reads as a domain-specific memory API wrapper rather than a production-grade agent tool suite.
Generates a brief summary of agent memory with decisions, risks, and next steps. Accepts optional query, max results, output format, and memory context.
Stores multiple memory items in a single batch operation. Accepts array of items with content, optional source and modality, default source/modality, domain pack ID, context, and stop_on_error flag.
Corrects a memory atom by applying a correction action (negate, confirm_actual, confirm_necessary, demote, replace). Returns success status, message, optional replacement atom ID, and durability state.
Applies governance actions to atoms (quarantine, seal, tombstone, derive_lesson). Returns success status, message, target atom ID, optional lesson atom ID, exposure state, and durability information.
Creates a handoff summary of memories for transfer between agents. Accepts summary text, optional source, and memory context. Returns summary, atoms stored count, and optional scope.
Stores content in HMG memory. Accepts content string, optional source, modality, domain pack ID, and memory context. Returns added atom IDs and durability state.
Output schemas not documented. LLMs cannot plan downstream calls or extract required fields. Tools return 'formatted result' or 'success status' without specifying field names, types, or structure.
Irreversible 'govern' tool (quarantine, seal, tombstone, derive_lesson) lacks confirmation/dry-run pattern. Agents can permanently destroy memory atoms without preview or rollback.
Parameter 'action' in correct/govern tools accepts free-form strings instead of enums. LLMs may hallucinate invalid actions (e.g. 'undo', 'revert') instead of constrained set (negate, confirm_actual, confirm_necessary, demote, replace).
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 47 | 2026-07-28+ | v2 |
Generates a compact brief from agent memory using a query, domain pack, tenant, workspace, and token budget. Returns formatted result with brief text and optional details including success status, domain pack ID, scope, query, brief format, language, selected count, and candidates considered.
Recalls memories from the HMG system based on a query. Supports response profiles (compact, summary), output formats (yaml, markdown, json), and optional debug information.
Retrieves memories from HMG based on a query. Returns narrative, recalled atoms with scores and epistemic ranks, and knowledge gaps.
Retrieves statistics about the memory store including atom count, edge count, and snapshot version.
No error handling guidance. Tools return 'success status' and 'message' but do not categorize errors as retryable, user-fixable, or fatal. LLMs cannot determine recovery strategy.
'stats' tool has empty input schema and minimal description (40 chars). Violates baseline that descriptions should be 10 - 1024 chars with actionable context.