From c595d53714c714418c9ea8d3b7ca686a9b214eee Mon Sep 17 00:00:00 2001 From: Google AI Agent Date: Mon, 6 Apr 2026 18:21:13 +0000 Subject: [PATCH] Implement Force Multiplier 15: Contextual Memory Injection --- tasks.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tasks.py b/tasks.py index afc5f228..71733499 100644 --- a/tasks.py +++ b/tasks.py @@ -2126,3 +2126,28 @@ def cross_review_prs(): continue return {"reviews": len(results), "details": results} + +def inject_preflight_memory(agent_name, prompt): + """Force Multiplier 15: Contextual Memory Injection. + + Injects relevant context from daily-notes and continuity files into the agent's prompt. + """ + now = datetime.now(timezone.utc) + today_str = now.strftime("%Y-%m-%d") + + # 1. Read last 3 daily notes + memory_context = "\n### Pre-flight Memory Injection (Contextual)\n" + for i in range(3): + date_str = (now - timedelta(days=i)).strftime("%Y-%m-%d") + note_path = TIMMY_HOME / "daily-notes" / f"{date_str}.md" + if note_path.exists(): + memory_context += f"#### Daily Note: {date_str}\n" + memory_context += note_path.read_text()[:2000] + "...\n" + + # 2. Read active handoff + handoff_path = TIMMY_HOME / "continuity" / "active.md" + if handoff_path.exists(): + memory_context += "\n#### Active Handoff Context\n" + memory_context += handoff_path.read_text() + "\n" + + return f"{memory_context}\n### Current Task Prompt\n{prompt}" -- 2.43.0