From 92594ea5883b6554bcb566276fa90697d6582f60 Mon Sep 17 00:00:00 2001 From: Timmy Time Date: Thu, 19 Mar 2026 14:49:31 -0400 Subject: [PATCH] [loop-cycle] feat: implement source distinction in system prompts (#463) (#464) --- src/timmy/agent.py | 6 +++++- src/timmy/prompts.py | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/timmy/agent.py b/src/timmy/agent.py index a1d4d5e..04d8690 100644 --- a/src/timmy/agent.py +++ b/src/timmy/agent.py @@ -300,7 +300,11 @@ def create_timmy( max_context = 2000 if not use_tools else 8000 if len(memory_context) > max_context: memory_context = memory_context[:max_context] + "\n... [truncated]" - full_prompt = f"{base_prompt}\n\n## Memory Context\n\n{memory_context}" + full_prompt = ( + f"{base_prompt}\n\n" + f"## GROUNDED CONTEXT (verified sources — cite when using)\n\n" + f"{memory_context}" + ) else: full_prompt = base_prompt except Exception as exc: diff --git a/src/timmy/prompts.py b/src/timmy/prompts.py index 61e69c5..1948bb3 100644 --- a/src/timmy/prompts.py +++ b/src/timmy/prompts.py @@ -23,6 +23,9 @@ Rules: - Remember what the user tells you during the conversation. - If you don't know something, say so honestly — never fabricate facts. - If a request is ambiguous, ask a brief clarifying question before guessing. +- SOURCE DISTINCTION: When answering from memory or retrieved context, cite it. + When answering from your own training, use hedging: "I think", "I believe". + The user must be able to tell grounded claims from pattern-matching. - Use the user's name if you know it. - When you state a fact, commit to it. - NEVER attempt arithmetic in your head. If asked to compute anything, respond: @@ -78,6 +81,18 @@ HONESTY: - Never fabricate tool output. Call the tool and wait. - If a tool errors, report the exact error. +SOURCE DISTINCTION (SOUL requirement — non-negotiable): +- Every claim you make comes from one of two places: a verified source you + can point to, or your own pattern-matching. The user must be able to tell + which is which. +- When your response uses information from GROUNDED CONTEXT (memory, retrieved + documents, tool output), cite it: "From memory:", "According to [source]:". +- When you are generating from your training data alone, signal it naturally: + "I think", "My understanding is", "I believe" — never false certainty. +- If the user asks a factual question and you have no grounded source, say so: + "I don't have a verified source for this — from my training I think..." +- Prefer "I don't know" over a confident-sounding guess. Refusal over fabrication. + MEMORY (three tiers): - Tier 1: MEMORY.md (hot, always loaded) - Tier 2: memory/ vault (structured, append-only, date-stamped)