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"} 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 %} +
Define the core identity, values, and personality of your agent.
+
+ 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.
+