From 9b5f2cb2c119783058d2429ebbadf0e7637b9304 Mon Sep 17 00:00:00 2001 From: Google Gemini Date: Sun, 22 Mar 2026 23:24:32 +0000 Subject: [PATCH 1/3] Add write_soul method to MemorySystem --- src/timmy/memory_system.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/timmy/memory_system.py b/src/timmy/memory_system.py index c3d2d14c..c9dbb45b 100644 --- a/src/timmy/memory_system.py +++ b/src/timmy/memory_system.py @@ -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) -- 2.43.0 From 070f13b6f33869ea87ea0169313e4fa07b6c3459 Mon Sep 17 00:00:00 2001 From: Google Gemini Date: Sun, 22 Mar 2026 23:24:40 +0000 Subject: [PATCH 2/3] Add soul management routes to system.py --- src/dashboard/routes/system.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/dashboard/routes/system.py b/src/dashboard/routes/system.py index 7b98a7fb..7a6df040 100644 --- a/src/dashboard/routes/system.py +++ b/src/dashboard/routes/system.py @@ -8,6 +8,7 @@ from fastapi.responses import HTMLResponse, JSONResponse from config import settings from dashboard.templating import templates +from timmy.memory_system import get_memory_system logger = logging.getLogger(__name__) @@ -190,3 +191,26 @@ async def api_swarm_status(): "message": "Swarm monitoring endpoint", } ) + +@router.get("/soul", response_class=HTMLResponse) +async def soul_page(request: Request): + """Render the soul management page.""" + memory_system = get_memory_system() + soul_content = memory_system.read_soul() + return templates.TemplateResponse( + request, + "soul.html", + {"soul_content": soul_content} + ) + + +@router.post("/soul/update", response_class=JSONResponse) +async def update_soul(request: Request): + """Update the soul.md content.""" + form = await request.form() + content = form.get("content", "") + memory_system = get_memory_system() + success = memory_system.write_soul(content) + if not success: + return JSONResponse({"error": "Failed to update soul"}, status_code=500) + return {"status": "ok", "message": "Soul updated successfully"} -- 2.43.0 From 234963446fc40de7b469773a45bdf74f7203beb9 Mon Sep 17 00:00:00 2001 From: Google Gemini Date: Sun, 22 Mar 2026 23:24:49 +0000 Subject: [PATCH 3/3] Create soul.html template --- src/dashboard/templates/soul.html | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/dashboard/templates/soul.html diff --git a/src/dashboard/templates/soul.html b/src/dashboard/templates/soul.html new file mode 100644 index 00000000..3c3205b7 --- /dev/null +++ b/src/dashboard/templates/soul.html @@ -0,0 +1,45 @@ + +{% extends "base.html" %} + +{% block title %}Soul Management - Timmy Dashboard{% endblock %} + +{% block content %} +
+
+
+

Soul Management

+

Define the core identity, values, and personality of your agent.

+
+ Back to Dashboard +
+ +
+
+
Core Identity (soul.md)
+
+
+
+
+ + +
This content is injected into the agent's system prompt to define its core persona.
+
+
+ +
+
+
+
+ +
+
+
What is the Soul?
+

+ The Soul (soul.md) is the most fundamental layer of the agent's memory. + Unlike episodic memories or facts, the Soul defines who the agent is, its primary mission, + and its ethical boundaries. It is always prioritized in the agent's thinking process. +

+
+
+
+{% endblock %} -- 2.43.0