Add write_soul method to MemorySystem

This commit is contained in:
2026-03-22 23:24:32 +00:00
parent c0f6ca9fc2
commit 9b5f2cb2c1

View File

@@ -572,6 +572,17 @@ def get_memory_context(query: str, max_tokens: int = 2000, **filters) -> str:
if not context_parts:
return ""
def write_soul(self, content: str) -> bool:
"""Write content to soul.md — Timmy's core identity."""
try:
SOUL_PATH.parent.mkdir(parents=True, exist_ok=True)
SOUL_PATH.write_text(content)
logger.info("MemorySystem: Updated soul.md")
return True
except OSError as exc:
logger.error("Failed to write soul.md: %s", exc)
return False
return "Relevant context from memory:\n" + "\n\n".join(context_parts)