Compare commits

...

1 Commits

Author SHA1 Message Date
Ryan Chen af33463f98 Put today's date (ET) in system prompt; stop hardcoding Simba's age
The model had no idea of the current date unless it remembered to call
the get_current_date tool, so relative/yearless dates (e.g. 'October')
got filled in from training data. build_system_prompt_with_memories now
prepends today's date (America/New_York) to every prompt, covering all
channels (web chat, iMessage, WhatsApp) and all date-related questions.

Simba's age is now computed from his birth date instead of a stale
hardcoded 'approximately 9 years 5 months'.
2026-10-12 18:25:32 -04:00
2 changed files with 17 additions and 4 deletions
+15 -2
View File
@@ -1,7 +1,19 @@
from datetime import datetime
from zoneinfo import ZoneInfo
from .models import UserMemory
from .prompts import SIMBA_SYSTEM_PROMPT
def _date_header() -> str:
"""Today's date in Eastern time, always known to the model without a tool call."""
now = datetime.now(ZoneInfo("America/New_York"))
return (
f"TODAY'S DATE: {now:%A, %B %d, %Y} (Eastern time). "
f"Interpret any relative or yearless dates (e.g. 'October', 'last month') relative to today's date.\n\n"
)
async def get_memories_for_user(user_id: str) -> list[str]:
"""Return all memory content strings for a user, ordered by most recently updated."""
memories = await UserMemory.filter(user_id=user_id).order_by("-updated_at")
@@ -10,10 +22,11 @@ async def get_memories_for_user(user_id: str) -> list[str]:
async def build_system_prompt_with_memories(user_id: str) -> str:
memories = await get_memories_for_user(user_id)
prompt = f"{_date_header()}{SIMBA_SYSTEM_PROMPT}"
if not memories:
return SIMBA_SYSTEM_PROMPT
return prompt
block = "\n".join(f"- {m}" for m in memories)
return f"{SIMBA_SYSTEM_PROMPT}\n\nUSER MEMORIES (facts the user has asked you to remember):\n{block}"
return f"{prompt}\n\nUSER MEMORIES (facts the user has asked you to remember):\n{block}"
async def save_memory(user_id: str, content: str) -> str:
+2 -2
View File
@@ -1,10 +1,10 @@
SIMBA_SYSTEM_PROMPT = """You are Simba, Ryan's helpful personal assistant. You're named after his orange cat. You have a warm, friendly personality with a light cat-themed touch, but your priority is always being genuinely useful — give thorough, detailed answers and think things through carefully. When asked about Simba the cat, you speak as him in first person. For everything else, you're just a great assistant who happens to have a cat's name.
SIMBA FACTS (as of January 2026):
SIMBA FACTS (as of January 2026; compute his current age from today's date):
- Name: Simba
- Species: Feline (Domestic Short Hair / American Short Hair)
- Sex: Male, Neutered
- Date of Birth: August 8, 2016 (approximately 9 years 5 months old)
- Date of Birth: August 8, 2016
- Color: Orange
- Current Weight: 16 lbs (as of 1/8/2026)
- Owner: Ryan Chen