Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[bug] hot memory docs say every entry loads into every prompt, but…

Open IvanLeontev-stack opened this issue 3 weeks ago • 3 comments

What happened

hot memory docs say every entry loads into every prompt, but progressive-memory.ts defers NAME/ROLE/RELATION/PREFERENCE behind a pointer, leaving 1 of 44 entries in context; docs and code disagree

Summary

What the docs say

The hot layer (PRINCIPAL_MEMORY.md, DA_MEMORY.md) is documented as loading on every prompt:

  • LIFEOS/DOCUMENTATION/Memory/MemorySystem.md:97: "Memory items load into every prompt."
  • LIFEOS/DOCUMENTATION/Memory/MemorySystem.md:105: type memory, load timing "always (hot-layer, every prompt)".
  • LIFEOS/DOCUMENTATION/Memory/CurationCoverage.md:14 and :93: "Hot-layer memory loads every turn".
  • LIFEOS/DOCUMENTATION/Hooks/HookSystem.md:264: the hot layer is queued and delivered in chunks so all of it reaches the model (the #2103 / #2138 fix).

What the code does

hooks/lib/progressive-memory.ts:13 defers every NAME, ROLE, RELATION and PREFERENCE entry behind a pointer to the source file (renderProgressiveMemory, called from hooks/LoadMemory.hook.ts:102). Only RULE and unknown types stay resident. On this install that is 1 resident entry out of 44 in the principal file; the other 43 reach the model only if it chooses to read the file. The chunked delivery from #2103 then ships this already-reduced block, so the full layer is never delivered.

None of the documentation mentions the deferral. The files involved are byte-identical to main (f6ab5e02, 2026-11-05).

Why it matters

Some deferred entries are constraints rather than biography (for example a standing rule about where a class of data may be stored, typed as PREFERENCE), so they silently stop being in context. The per-turn BM25 retriever also reads both hot-layer files (MemoryRetriever.ts), which partly compensates, but only when an entry scores above the threshold for that prompt.

Question

Which one is intended? If deferral is the design, the docs above need updating (and it may be worth keeping constraint-like entries resident). If "every prompt" is the design, progressive-memory.ts defers more than it should.

Searched existing issues for "progressive memory", "hot memory", "PRINCIPAL_MEMORY", "deferred memory", "progressive-memory", "memory pointer", "LoadMemory" and found no report of this.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

IvanLeontev-stack avatar Nov 10 '26 15:11 IvanLeontev-stack

[!NOTE] 🤖 Tyler (AI assistant) responding on behalf of Ivan

Follow-up with a measurement from the same install (8.761.0, files byte-identical to main), prompts in Russian. On 8 real prompts whose right answer depended on a deferred PRINCIPAL_MEMORY entry:

  • the model read PRINCIPAL_MEMORY.md after the pointer on 0 of 8 turns;
  • the retriever's safety net missed it too: getRelevantContext scores the whole file as one virtual note (MemoryRetriever.ts:790-798), ranked outside the top 50 on 7 of 8 prompts (17th on the eighth). So with deferral both paths miss. One option that keeps the token savings: score hot-layer entries individually, so a deferred entry can surface on the turn it matters.

IvanLeontev-stack avatar Nov 12 '26 10:11 IvanLeontev-stack

[!NOTE] 🤖 Tyler (AI assistant) responding on behalf of Ivan

A correction to how this issue is framed, after reading further. The deferral is the design, not a bug: hooks/lib/progressive-memory.ts:1-9 and LIFEOS/DOCUMENTATION/Skills/ProgressiveContext.md:40-43 both describe contextual entries staying behind live source pointers. So the code is right and these docs are stale:

  • LIFEOS/DOCUMENTATION/Memory/MemorySystem.md:105 (type memory: "always (hot-layer, every prompt)")
  • LIFEOS/DOCUMENTATION/Memory/CurationCoverage.md:14 and :93 ("Hot-layer memory loads every turn"; file last_updated 2026-07-11)

The real gap is a different one. The design relies on the model reading the source "before work whose answer depends on deferred context" (progressive-memory.ts:6-8), and I found nothing that checks it does (looked in hooks/, hooks/lib/, MemoryHealthCheck.ts, DeliveredContext.ts, IntegrityCheck.ts, LIFEOS_SYSTEM_PROMPT.md, skills/Cortex). Measured on this install: the model read the file after the pointer on 0 of 8 turns (comment above); a later run on 24 turns gave 4/24 with the pointer in English and 3/24 in Russian, so language is not the cause.

Suggested: update the two docs to describe the deferral, and close the gap either by scoring hot-layer entries individually in the retriever (comment above) or by some signal when a deferred source was needed and not read.

IvanLeontev-stack avatar Nov 12 '26 16:11 IvanLeontev-stack

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @IvanLeontev-stack, you pointed out that the hot memory docs said every entry loads into every prompt. The docs now say rules and unknown types stay resident while names, roles, relations and preferences are deferred behind a source pointer, in LIFEOS/DOCUMENTATION/Memory/MemorySystem.md. It ships in the next public release after 8.761.0.

danielmiessler avatar Nov 12 '26 20:11 danielmiessler