Summary
Layer 1 (Essential Story) sorts drawers by importance metadata to build the wake-up context, but no ingestion path ever writes an importance value. Every drawer defaults to 3.0, collapsing the sort to filed_at order. This means frequently filed trivia can appear in wake-up context while rare-but-critical facts (e.g. health info, allergies, credentials) are pushed out.
Where the gap is
Reading side (works): layers.py L1 already reads importance, emotional_weight, or weight from metadata and sorts descending — this code is correct and ready.
Writing side (missing): None of these ingestion paths set importance:
miner.py — project file ingestion
convo_miner.py — conversation ingestion
mcp_server.py tool_add_drawer — MCP drawer creation
All build metadata dicts with wing, room, source_file, filed_at, etc. but never importance.
Impact
- Wake-up context (L1) cannot prioritize critical memories over trivial ones
- The AAAK dialect's ★ scale and semantic flags (ORIGIN, CORE, PIVOT, SENSITIVE) are stored but never influence retrieval ranking
- Users have no way to mark a memory as critical via MCP tools
Proposed fix
1. Add a keyword-based importance scorer (zero dependencies, ~15 lines):
import re
CRITICAL_PATTERNS = re.compile(
r"allerg|medical|medication|disease|emergency|password|"
r"credential|api.key|ssn|birth.?date|blood.?type|"
r"never.?forget|always.?remember|critical|life.?threatening",
re.IGNORECASE
)
IDENTITY_PATTERNS = re.compile(
r"my name is|i am a|my job|my role|i work at|"
r"i live in|born in|native language|nationality",
re.IGNORECASE
)
def score_importance(text: str) -> float:
if CRITICAL_PATTERNS.search(text):
return 5.0
if IDENTITY_PATTERNS.search(text):
return 4.0
return 3.0
2. Write importance in all ingestion paths:
metadata["importance"] = score_importance(text)
3. Expose optional importance param in tool_add_drawer so MCP callers can override:
"importance": {"type": "number", "minimum": 1, "maximum": 5}
# In handler:
metadata["importance"] = params.get("importance") or score_importance(content)
Why this is safe
- Old drawers without importance keep defaulting to 3.0 — no migration needed
- No new dependencies
- No schema changes
- L1 retrieval code needs zero modifications
- The scorer is conservative — only elevates obvious critical content, never demotes
Versions
Found on develop branch, v3.9.0.
Summary
Layer 1 (Essential Story) sorts drawers by
importancemetadata to build the wake-up context, but no ingestion path ever writes an importance value. Every drawer defaults to3.0, collapsing the sort tofiled_atorder. This means frequently filed trivia can appear in wake-up context while rare-but-critical facts (e.g. health info, allergies, credentials) are pushed out.Where the gap is
Reading side (works):
layers.pyL1 already readsimportance,emotional_weight, orweightfrom metadata and sorts descending — this code is correct and ready.Writing side (missing): None of these ingestion paths set importance:
miner.py— project file ingestionconvo_miner.py— conversation ingestionmcp_server.pytool_add_drawer— MCP drawer creationAll build metadata dicts with
wing,room,source_file,filed_at, etc. but neverimportance.Impact
Proposed fix
1. Add a keyword-based importance scorer (zero dependencies, ~15 lines):
2. Write importance in all ingestion paths:
3. Expose optional
importanceparam intool_add_drawerso MCP callers can override:Why this is safe
Versions
Found on
developbranch, v3.9.0.