Skip to content

Commit ea401a7

Browse files
committed
Simplify LLM prompts for diary task extraction and add current-date context
1 parent b857563 commit ea401a7

File tree

1 file changed

+5
-38
lines changed

1 file changed

+5
-38
lines changed

brain_cli/plan_commands.py

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -49,44 +49,11 @@ def extract_tasks_from_diary(diary_entry_content: str, diary_date: str, llm_clie
4949
if not diary_entry_content or len(diary_entry_content.strip()) < 50:
5050
return []
5151

52-
system_prompt = """You are an intelligent task extraction assistant. Analyze diary entries and extract actionable tasks for the next day.
53-
54-
Extract tasks that:
55-
- Are mentioned as incomplete, pending, or needing follow-up
56-
- Represent specific actions (not vague intentions)
57-
- Are relevant for the next day or future
58-
- Include follow-ups from meetings or conversations
59-
- Are scheduled events with specific times (e.g., "10:30 meeting", "3pm call")
60-
- Are mentioned in future context even if narrative (e.g., "Tomorrow I have to...", "I will need to...", "On Friday I should...")
61-
- Require preparation based on context (e.g., "meeting with VP" implies "prepare talking points")
62-
63-
Be SMART about temporal context:
64-
- "Tomorrow I have to X" = future action, extract it
65-
- "I will have to X" = future action, extract it
66-
- "I need to X" = action item, extract it
67-
- "On [day/date] I'm doing X" = scheduled action, extract it
68-
- Look for time markers: tomorrow, next, Friday, specific times (10:30, 3pm, etc.)
69-
70-
Do NOT extract:
71-
- Already completed activities (e.g., "I did X", "X was finished", "I went through X and it's done")
72-
- General reflections about feelings or mood
73-
- Past events with no follow-up needed
74-
- Vague intentions without actionable steps
75-
76-
Format: Return ONLY a numbered list of tasks, one per line.
77-
Example:
78-
1. Pick up rental car at 10:30 AM
79-
2. Prepare talking points for Patrick meeting at 3:05 PM
80-
3. Moderate Pamela's stream
81-
4. Review deck changes before stream
82-
83-
If no actionable tasks are found, return: NO_TASKS"""
84-
85-
user_prompt = f"""Analyze this diary entry from [[{diary_date}]] and extract actionable tasks for today:
86-
87-
{diary_entry_content}
88-
89-
Extract specific, actionable tasks that should be done today. Return as a numbered list or NO_TASKS if none found."""
52+
system_prompt = """you are an expert task extractor. Given a diary entry from the prior day, identify specific, actionable tasks that the user should complete today. Focus on clear, concise tasks that can be realistically accomplished within a day. If no tasks are found, respond with NO_TASKS."""
53+
current_date = date.today().isoformat()
54+
user_prompt = f"""Today is {current_date}. You are about to analyze a diary entry from [[{diary_date}]].
55+
Here is the content of that diary entry: {diary_entry_content}
56+
Extract specific, actionable tasks that should be done today. Return as a numbered list or NO_TASKS if none found."""
9057

9158
try:
9259
start_time = time.time()

0 commit comments

Comments
 (0)