Memory
Memory
Section titled “Memory”Persistent, searchable state that outlives the process. Structured enough for graph traversal; flat enough for grep.
Components shipped today
Section titled “Components shipped today”- SQLite + FTS5 lattice (3.A) —
internal/memory/SqliteStore. Schema migrations, fire-and-forget worker, lexical search. - Ontological graph (3.B) — entities, relationships, LLM-assisted extractor with dead-letter queue.
- Neural recall (3.C) — 2-layer seed selection, CTE traversal,
<memory-context>fence injection matching Hermes’sbuild_memory_context_block. - Semantic fusion (3.D) — Ollama embeddings, cosine recall, and hybrid lexical+semantic seed fusion.
- USER.md mirror (3.D.5) — async export of entity/relationship graph to human-readable Markdown. Gormes-original; no upstream equivalent.
- Tool audit JSONL (3.E.2) — append-only JSONL from kernel and
delegate_tasktool execution with timing, outcome, and error fields. - Transcript export (3.E.3) —
gormes session export <id> --format=markdownrenders SQLite turns, timestamps, and tool calls for operator sharing. - Operator visibility (3.E.4, 3.E.5) —
gormes memory statusis shipped, and the local insights layer now persists append-only dailyusage.jsonlrecords fromtelemetry.Snapshotrollups. - GONCHO compatibility seam — internal memory work lives behind the
gonchoservice, while the exported tool surface remains Honcho-compatible (honcho_*).
Phase 3 closeout queue
Section titled “Phase 3 closeout queue”- Shipped visibility spine (3.E.1–3.E.5) — session index mirror, tool audit, transcript export, memory status, and daily insights logging are landed.
last_seencloseout (3.E.6) — shipped: schema v3g backfillsrelationships.last_seen, repeated relationship observations advance it without rewriting legacyupdated_at, and recall attenuation usesCOALESCE(NULLIF(last_seen, 0), updated_at).- Cross-chat identity closeout (3.E.7) — shipped: GONCHO identity hierarchy is
user_id > chat_id > session_id;internal/persistence/sessionpersists canonical chat-to-user bindings, andinternal/memory,internal/goncho, andinternal/gonchotoolscover same-chat default fencing, opt-in canonical user/source-filtered recall, Honcho-compatible schemas, host mappings, SillyTavern persona/group-chat mapping, deny paths, and operator-readable evidence. - Session lineage + cross-source search closeout (3.E.8) — shipped: source-filtered search spans one canonical
user_idacross chats insideinternal/memoryand the internal GONCHO service;parent_session_id, compression-continuation resume, lineage-aware hits, and operator-auditable search evidence are validated. - Goncho/Honcho parity (3.F) — shipped and converged: context representation options, typed search filters, directional peer cards, queue status, summary budgeting, dialectic chat, file import, topology fixtures, operator diagnostics, streaming persistence,
[goncho]config, and dream-scheduler intent are validated while public tools remainhoncho_*.
Identity + lineage contract
Section titled “Identity + lineage contract”- GONCHO identity hierarchy —
user_id > chat_id > session_id. - Recall fence — same-chat by default; opt-in cross-chat only when a canonical
user_idresolves. - Tool boundary —
honcho_searchandhoncho_contextpreserve the external Honcho-compatible tool names and now advertisescope/sourceswhile the implementation stays in the internalgonchopackage. - Lineage rule —
parent_session_idis append-only metadata on descendants, not a rewrite of ancestor history. - Implementation plan —
docs/superpowers/plans/memory-identity/2026-04-22-gormes-phase3-identity-lineage-plan.md. - Execution plan —
docs/superpowers/plans/memory-identity/2026-04-22-gormes-phase3-identity-lineage-execution-plan.md; the identity and lineage sequence it described has now landed. Future memory work should add new small 3.F or Phase 6 rows rather than reopening the shipped cross-chat spine.
Why this is not just “chat logs”
Section titled “Why this is not just “chat logs””Chat logs are append-only. Memory has schema. You query it, derive from it, inject it back into the context window. The SQLite + FTS5 combination gives you ACID durability and full-text search in a single ~100 KB binary dependency.
Donor pointers
Section titled “Donor pointers”When implementing a new memory or Goncho slice, route through the
gormes-references skill (docs/development-skills/gormes-references/SKILL.md)
before re-deriving a shape. The most useful Go donors for memory/Goncho work
live under references/go-agent-os/engram/:
| Memory problem | Donor file |
|---|---|
| SQLite + FTS5 store with DDL, indexes, migrations | engram/internal/persistence/store/store.go |
Memory relation/conflict vocabulary (related, conflicts_with, supersedes, compatible, scoped, not_conflict) | engram/internal/persistence/store/relations.go |
| Deterministic serialized MCP write queue (mutex-serialized, cancel-before-start) | engram/internal/mcp/write_queue.go |
| MCP activity/audit logging (audit shape, redaction, append-only file) | engram/internal/mcp/activity.go |
| Bounded token-budget tracker for recall context assembly | axe/internal/budget/budget.go |
| Artifact tracker with sanitized paths (path-traversal guard, append-only registry) | axe/internal/artifact/tracker.go |
Engram is MIT-licensed and permitted as patterns + adapted code with
attribution. Always add a // Adapted from engram/...::Symbol comment on the
receiving Gormes file when porting code, and convert types/imports to
Gormes-native names so engram_* symbols never leak into Gormes’ public API.
See Phase 3 for the full sub-status.