Holographic Memory Graph — a long-term memory kernel for AI agents.
Store decisions, trace corrections, govern knowledge. One call, complete context.
curl -fsSL https://github.com/HMG-AI/HMG-public/releases/latest/download/install.sh | sh
AI agents forget everything between sessions. HMG gives them durable, queryable, governable long-term memory.
Decisions, root causes, constraints — persisted as typed graph atoms with polarity, epistemic state, and governance tags
Semantic + keyword hybrid retrieval, graph diffusion projection, branch-aware scope — the right context at the right time
Full correction when memories go stale — negate, confirm, demote, or replace. All correction history permanently retained
Sensitive knowledge governance — quarantine, seal, or derive lessons. Control what gets remembered and what gets forgotten
Not a vector database or key-value store. HMG models memory as a typed graph with polarity, epistemic state, governance, and correction lineage.
One MCP call for complete context: current status, prior decisions, unresolved risks, next steps.
tenant → workspace → repository → branch. Memories isolated per branch, traceable on merge.
Quarantine, seal, tombstone, derive lessons. Policy tags and audit context throughout.
Embedded storage, zero external dependencies. Data stays local, works offline.
Core memory, governance, MemoryQL, observation, vault, panorama, and graph-health workflows.
hmg-protocol (Apache-2.0) standalone crate defines types and serialization for all memory operations.
Install → Initialize → Store → Query
$ curl -fsSL https://github.com/HMG-AI/HMG-public/releases/latest/download/install.sh | sh
Installing HMG v1.0.0 for x86_64-unknown-linux-gnu...
HMG v1.0.0 installed to ~/.local/bin
$ hmg init -g
$ hmg daemon start
Daemon started on http://127.0.0.1:3000
$ hmg license status
Edition: Community (free)
Atoms: 100,000 limit | Used: 0
# Store a decision
$ curl -s -X POST http://127.0.0.1:3000/api/memorize \
-H 'Content-Type: application/json' \
-d '{"content": "Decision: use Rust for performance-critical paths"}'
# Recall
$ curl -s http://127.0.0.1:3000/api/recall \
-d '{"query": "what language did we choose?"}'
// Agent MCP config (e.g., in AGENTS.md or .cursor/mcp.json)
{
"mcpServers": {
"hmg": {
"command": "hmg",
"args": ["--mcp"]
}
}
}
// Agent tools become available:
// memory_memorize, memory_recall, memory_correct,
// memory_govern, memory_history, memory_handoff,
// memory_agent_brief, memory_stats
Single binary, runtime edition detection. No reinstall needed.
Every session becomes context for the next. Decisions persist. Corrections leave history. Governance controls what gets remembered.
capture → canonicalize → recall → correct → govern → consolidate → brief next session
# Session 1: Store a decision
memory_memorize(content="Decision: use Rust for performance-critical paths")
# Session 2: Agent wakes up with full context
memory_agent_brief(domain_pack_id="software-engineering")
→ scope: tenant/platform/repo/main
→ decisions: "use Rust for perf paths"
→ risks: "WASM integration not yet validated"
→ next_steps: "benchmark Rust vs Go paths"
# Session 3: Correct stale knowledge
memory_correct(target_atom="01ABC...", action="replace",
new_content="Use Rust + WASM for cross-platform perf")
# Session 4: Govern sensitive data
memory_govern(target_atom="01DEF...", action="seal",
reason="contains internal API endpoint")
Four workflows that show why HMG is not a vector database.
Before writing a single line of code, the agent retrieves decisions, risks, and constraints from prior sessions.
memory_agent_brief(
domain_pack_id="software-engineering",
brief_format="compact_yaml",
language="en"
)
POST /api/agent-brief
Content-Type: application/json
{"domain_pack_id": "software-engineering",
"brief_format": "compact_yaml"}
hmg brief --domain software-engineering
hmg_brief_v2:
scope: "tenant/platform/repo/main"
engine: one_shot_recall
answer: |
Sprint 3 completed with RBAC v2.
Key decision: use Redis for session cache.
Rejected: JWT-only (no revocation).
sources:
- "01KSC7J75FVQHC5TCHGA1JQRWS"
related: []
gaps: []
validate_hint: "Query-directed recall"
Store decisions with rationale. Next session, the agent knows why choices were made and what was rejected.
# Store a decision with rationale
memory_memorize(
content="Decision: use PostgreSQL 16 over MongoDB for ACID compliance",
source="ADR-014",
modality="text"
)
# Later: recall the decision and its context
memory_recall(query="Why did we choose PostgreSQL?")
→ "Decision: use PostgreSQL 16 over MongoDB for ACID compliance"
→ source: ADR-014
→ related: ["data integrity requirements", "transaction guarantees"]
When a memory is wrong or outdated, replace it. The old version is retained in correction history. Normal recall returns the new canonical answer.
# Old (incorrect) memory:
"API runs on port 8080"
# Replace with correct value:
memory_correct(
target_atom="01PORT...",
action="replace",
new_content="API runs on port 3000",
reason="changed in config.rs v0.9.2"
)
# Subsequent recall returns:
memory_recall(query="what port does the API use?")
→ "API runs on port 3000" # canonical
memory_history(atom_id="01PORT...")
# Returns full lineage:
v1: "API runs on port 8080" # original
v2: "API runs on port 3000" # canonical ✓
correction_reason: "changed in config.rs"
correction_timestamp: 2026-05-29T...
superseded: v1 → v2
Seal, quarantine, tombstone, or derive lessons. Governed memories are invisible in normal recall but retained for audit.
memory_govern(
target_atom="01SENS...",
action="derive_lesson",
reason="contains customer PII",
lesson_content="Customer data must be encrypted at rest (derived from incident 2026-05-28)"
)
# Normal recall: invisible
memory_recall(query="customer incident")
→ # (no governed results returned)
# Audit recall: lesson visible
memory_recall(query="customer incident", mode="audit")
→ "Customer data must be encrypted at rest"
Common issues and how to fix them.
hmg daemon stop && hmg daemon start --port 3001~/.local/share/hmg/ ownershiphmg doctor for diagnostics~/.local/share/hmg/stores/default/.lockhmg --mcp runs in terminalstartup_timeout_sec in MCP confighmg daemon statushmg license status shows active editionhmg license apply <key>hmg license status~/.local/share/hmg/stores/Run hmg doctor to check: edition, store path, daemon, MCP readiness, agent adapters, and disk usage.
$ hmg doctor
Edition: Community
Store: ~/.local/share/hmg/stores/default
Daemon: running on :3000
MCP: ready
Agents: pi, cursor
Disk: 12MB / 100K atom limit
✅ All checks passed
Official Python and TypeScript SDKs covering the full Community Edition API.
hmg-sdkpip install hmg-sdk
import hmg
client = hmg.HmgClient()
client.memorize("key decision: use Rust")
@hmg_ai/sdk-tsnpm install @hmg_ai/sdk-ts
import { HmgClient } from "@hmg_ai/sdk-ts";
const client = new HmgClient();
await client.memorize({content: "noted"});
Open protocol, open communication, open contributions.
hmg-protocol (Apache-2.0) defines types and serialization for memory atoms, corrections, governance, and scope.
Contributions welcome! Read CONTRIBUTING.md, submit a PR or Issue.
Found a vulnerability? Disclose privately via GitHub Security Advisories. 48-hour response commitment.