diff --git a/apps/x/packages/core/src/knowledge/build_graph.ts b/apps/x/packages/core/src/knowledge/build_graph.ts index 8cb0cfa7..05c23989 100644 --- a/apps/x/packages/core/src/knowledge/build_graph.ts +++ b/apps/x/packages/core/src/knowledge/build_graph.ts @@ -89,7 +89,19 @@ function moveVoiceMemosToKnowledge(state: GraphState): { sourcePath: string; tar // Read original content and wrap in markdown format const originalContent = fs.readFileSync(sourcePath, 'utf-8'); - const mdContent = `# Voice Memo - ${date}\n\n**Recorded:** ${date}\n\n## Transcript\n\n${originalContent}\n`; + // Create a relative path for linking (from knowledge/ root) + const relativePath = `Voice Memos/${date}/${baseName}`; + + const mdContent = `# Voice Memo - ${date} + +**Type:** voice memo +**Recorded:** ${date} +**Path:** ${relativePath} + +## Transcript + +${originalContent} +`; // Write to knowledge directory fs.writeFileSync(targetPath, mdContent); diff --git a/apps/x/packages/core/src/knowledge/note_creation_high.ts b/apps/x/packages/core/src/knowledge/note_creation_high.ts index 81d14dcf..2e8c6a65 100644 --- a/apps/x/packages/core/src/knowledge/note_creation_high.ts +++ b/apps/x/packages/core/src/knowledge/note_creation_high.ts @@ -19,7 +19,7 @@ tools: --- # Task -You are a memory agent. Given a single source file (email or meeting transcript), you will: +You are a memory agent. Given a single source file (email, meeting transcript, or voice memo), you will: 1. **Determine source type (meeting or email)** 2. **Evaluate if the source is worth processing** @@ -31,7 +31,7 @@ You are a memory agent. Given a single source file (email or meeting transcript) 8. Create new notes (meetings only) or update existing notes 9. **Apply state changes to existing notes** -The core rule: **Meetings create notes. Emails enrich them.** +The core rule: **Meetings and voice memos create notes. Emails enrich them.** You have full read access to the existing knowledge directory. Use this extensively to: - Find existing notes for people, organizations, projects mentioned @@ -126,9 +126,15 @@ executeCommand("cat '{source_file}'") - Has \`Subject:\` field - Email signature +**Voice memo indicators:** +- Has \`**Type:** voice memo\` field +- Has \`**Path:**\` field with path like \`Voice Memos/YYYY-MM-DD/...\` +- Has \`## Transcript\` section + **Set processing mode:** - \`source_type = "meeting"\` → Can create new notes - \`source_type = "email"\` → Can only update existing notes +- \`source_type = "voice_memo"\` → Can create new notes (treat like meetings) --- @@ -844,7 +850,12 @@ If role is unknown but context suggests it, say so: One line summarizing this source's relevance to the entity: \`\`\` -**{YYYY-MM-DD}** ({meeting|email}): {Summary with [[links]]} +**{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[links]]} +\`\`\` + +**For voice memos:** Include a link to the voice memo file using the Path field: +\`\`\` +**2025-01-15** (voice memo): Discussed [[Projects/Acme Integration]] timeline. See [[Voice Memos/2025-01-15/voice-memo-2025-01-15T10-30-00-000Z]] \`\`\` **Important:** Use canonical names with absolute paths from resolution map in all summaries: @@ -1179,7 +1190,7 @@ If not found, update Jennifer.md to add the link. - [[Projects/{Project}]] — {role} ## Activity -- **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[Folder/Name]] links} {[State changes if any]} +- **{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[Folder/Name]] links} {[State changes if any]} ## Key facts {Substantive facts only. Leave empty if none. Never include data gap commentary.} @@ -1216,7 +1227,7 @@ If not found, update Jennifer.md to add the link. - [[Projects/{Project}]] — {relationship} ## Activity -- **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[Folder/Name]] links} {[State changes if any]} +- **{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[Folder/Name]] links} {[State changes if any]} ## Key facts {Substantive facts only. Leave empty if none.} @@ -1803,10 +1814,16 @@ Business banking provider. Account setup completed January 2025. | Source Type | Creates Notes? | Updates Notes? | Detects State Changes? | |-------------|---------------|----------------|------------------------| | Meeting | Yes | Yes | Yes | +| Voice memo | Yes | Yes | Yes | | Email (known contact) | No | Yes | Yes | | Email (unknown contact) | No | No (SKIP) | No | | Email (warm intro) | Yes (exception) | Yes | Yes | +**Voice memo activity format:** Always include a link to the source voice memo: +\`\`\` +**2025-01-15** (voice memo): Discussed project timeline with [[People/Sarah Chen]]. See [[Voice Memos/2025-01-15/voice-memo-...]] +\`\`\` + --- # State Change Reference diff --git a/apps/x/packages/core/src/knowledge/note_creation_low.ts b/apps/x/packages/core/src/knowledge/note_creation_low.ts index ac8239f9..26d32bca 100644 --- a/apps/x/packages/core/src/knowledge/note_creation_low.ts +++ b/apps/x/packages/core/src/knowledge/note_creation_low.ts @@ -19,7 +19,7 @@ tools: --- # Task -You are a memory agent. Given a single source file (email or meeting transcript), you will: +You are a memory agent. Given a single source file (email, meeting transcript, or voice memo), you will: 1. **Determine source type (meeting or email)** 2. **Evaluate if the source is worth processing** @@ -31,7 +31,7 @@ You are a memory agent. Given a single source file (email or meeting transcript) 8. Create new notes or update existing notes 9. **Apply state changes to existing notes** -The core rule: **Capture broadly. Both meetings and emails create notes for most external contacts.** +The core rule: **Capture broadly. Meetings, voice memos, and emails create notes for most external contacts.** You have full read access to the existing knowledge directory. Use this extensively to: - Find existing notes for people, organizations, projects mentioned @@ -133,9 +133,15 @@ executeCommand("cat '{source_file}'") - Has \`Subject:\` field - Email signature +**Voice memo indicators:** +- Has \`**Type:** voice memo\` field +- Has \`**Path:**\` field with path like \`Voice Memos/YYYY-MM-DD/...\` +- Has \`## Transcript\` section + **Set processing mode:** - \`source_type = "meeting"\` → Create notes for all external attendees - \`source_type = "email"\` → Create notes for sender if identifiable human +- \`source_type = "voice_memo"\` → Create notes for all mentioned entities (treat like meetings) --- @@ -509,7 +515,12 @@ Write 2-3 sentences covering their role/function, context of the relationship, a One line summarizing this source's relevance to the entity: \`\`\` -**{YYYY-MM-DD}** ({meeting|email}): {Summary with [[links]]} +**{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[links]]} +\`\`\` + +**For voice memos:** Include a link to the voice memo file using the Path field: +\`\`\` +**2025-01-15** (voice memo): Discussed [[Projects/Acme Integration]] timeline. See [[Voice Memos/2025-01-15/voice-memo-2025-01-15T10-30-00-000Z]] \`\`\` --- @@ -638,7 +649,7 @@ After writing, verify links go both ways. - [[Projects/{Project}]] — {role} ## Activity -- **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[Folder/Name]] links} +- **{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[Folder/Name]] links} ## Key facts {Substantive facts only. Leave empty if none.} @@ -673,7 +684,7 @@ After writing, verify links go both ways. - [[Projects/{Project}]] — {relationship} ## Activity -- **{YYYY-MM-DD}** ({meeting|email}): {Summary} +- **{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary} ## Key facts {Substantive facts only. Leave empty if none.} @@ -705,7 +716,7 @@ After writing, verify links go both ways. - [[Topics/{Topic}]] — {relationship} ## Timeline -**{YYYY-MM-DD}** ({meeting|email}) +**{YYYY-MM-DD}** ({meeting|email|voice memo}) {What happened.} ## Decisions @@ -756,9 +767,15 @@ After writing, verify links go both ways. | Source Type | Creates Notes? | Updates Notes? | Detects State Changes? | |-------------|---------------|----------------|------------------------| | Meeting | Yes — ALL external attendees | Yes | Yes | +| Voice memo | Yes — all mentioned entities | Yes | Yes | | Email (any human sender) | Yes | Yes | Yes | | Email (automated/newsletter) | No (SKIP) | No | No | +**Voice memo activity format:** Always include a link to the source voice memo: +\`\`\` +**2025-01-15** (voice memo): Discussed project timeline with [[People/Sarah Chen]]. See [[Voice Memos/2025-01-15/voice-memo-...]] +\`\`\` + **Philosophy:** Capture broadly, filter later if needed. --- diff --git a/apps/x/packages/core/src/knowledge/note_creation_medium.ts b/apps/x/packages/core/src/knowledge/note_creation_medium.ts index 746d4fac..40336c42 100644 --- a/apps/x/packages/core/src/knowledge/note_creation_medium.ts +++ b/apps/x/packages/core/src/knowledge/note_creation_medium.ts @@ -19,7 +19,7 @@ tools: --- # Task -You are a memory agent. Given a single source file (email or meeting transcript), you will: +You are a memory agent. Given a single source file (email, meeting transcript, or voice memo), you will: 1. **Determine source type (meeting or email)** 2. **Evaluate if the source is worth processing** @@ -132,9 +132,15 @@ executeCommand("cat '{source_file}'") - Has \`Subject:\` field - Email signature +**Voice memo indicators:** +- Has \`**Type:** voice memo\` field +- Has \`**Path:**\` field with path like \`Voice Memos/YYYY-MM-DD/...\` +- Has \`## Transcript\` section + **Set processing mode:** - \`source_type = "meeting"\` → Can create new notes - \`source_type = "email"\` → Can create notes if personalized and relevant +- \`source_type = "voice_memo"\` → Can create new notes (treat like meetings) --- @@ -784,7 +790,12 @@ The summary should answer: **"Who is this person and why do I know them?"** One line summarizing this source's relevance to the entity: \`\`\` -**{YYYY-MM-DD}** ({meeting|email}): {Summary with [[links]]} +**{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[links]]} +\`\`\` + +**For voice memos:** Include a link to the voice memo file using the Path field: +\`\`\` +**2025-01-15** (voice memo): Discussed [[Projects/Acme Integration]] timeline. See [[Voice Memos/2025-01-15/voice-memo-2025-01-15T10-30-00-000Z]] \`\`\` **Important:** Use canonical names with absolute paths from resolution map in all summaries: @@ -1000,7 +1011,7 @@ After writing, verify links go both ways. - [[Projects/{Project}]] — {role} ## Activity -- **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[Folder/Name]] links} +- **{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[Folder/Name]] links} ## Key facts {Substantive facts only. Leave empty if none.} @@ -1035,7 +1046,7 @@ After writing, verify links go both ways. - [[Projects/{Project}]] — {relationship} ## Activity -- **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[Folder/Name]] links} +- **{YYYY-MM-DD}** ({meeting|email|voice memo}): {Summary with [[Folder/Name]] links} ## Key facts {Substantive facts only. Leave empty if none.} @@ -1119,11 +1130,17 @@ After writing, verify links go both ways. | Source Type | Creates Notes? | Updates Notes? | Detects State Changes? | |-------------|---------------|----------------|------------------------| | Meeting | Yes | Yes | Yes | +| Voice memo | Yes | Yes | Yes | | Email (personalized, business-relevant) | Yes | Yes | Yes | | Email (mass/automated/consumer) | No (SKIP) | No | No | | Email (cold outreach with personalization) | Yes | Yes | Yes | | Email (generic cold outreach) | No | No | No | +**Voice memo activity format:** Always include a link to the source voice memo: +\`\`\` +**2025-01-15** (voice memo): Discussed project timeline with [[People/Sarah Chen]]. See [[Voice Memos/2025-01-15/voice-memo-...]] +\`\`\` + --- # Error Handling