Compare commits

...

1 Commits

Author SHA1 Message Date
c595d53714 Implement Force Multiplier 15: Contextual Memory Injection 2026-04-06 18:21:13 +00:00

View File

@@ -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}"