diff --git a/apps/x/packages/core/package.json b/apps/x/packages/core/package.json index cf135019..bb9d1cb7 100644 --- a/apps/x/packages/core/package.json +++ b/apps/x/packages/core/package.json @@ -5,7 +5,11 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { +<<<<<<< HEAD "build": "rm -rf dist && tsc && mkdir -p dist/knowledge dist/pre_built && cp src/knowledge/note_creation_*.md src/knowledge/welcome.md dist/knowledge/ && cp src/pre_built/*.md dist/pre_built/", +======= + "build": "rm -rf dist && tsc", +>>>>>>> 13c5c03f (fix note creation agent) "dev": "tsc -w" }, "dependencies": { diff --git a/apps/x/packages/core/src/agents/runtime.ts b/apps/x/packages/core/src/agents/runtime.ts index 407ba182..43a2dc01 100644 --- a/apps/x/packages/core/src/agents/runtime.ts +++ b/apps/x/packages/core/src/agents/runtime.ts @@ -24,6 +24,9 @@ import { IRunsRepo } from "../runs/repo.js"; import { IRunsLock } from "../runs/lock.js"; import { PrefixLogger } from "@x/shared"; import { parse } from "yaml"; +import { raw as noteCreationMediumRaw } from "../knowledge/note_creation_medium.js"; +import { raw as noteCreationLowRaw } from "../knowledge/note_creation_low.js"; +import { raw as noteCreationHighRaw } from "../knowledge/note_creation_high.js"; export interface IAgentRuntime { trigger(runId: string): Promise; @@ -246,26 +249,20 @@ export async function loadAgent(id: string): Promise> { return CopilotAgent; } - // Built-in agents loaded from checked-in files - const builtinAgents: Record = { - 'meeting-prep': '../pre_built/meeting-prep.md', - 'email-draft': '../pre_built/email-draft.md', - }; - - // Resolve agent file path (note_creation is dynamic based on strictness config) - let agentFilePath: string | null = null; - const currentDir = path.dirname(new URL(import.meta.url).pathname); - if (id === 'note_creation') { const strictness = getNoteCreationStrictness(); - agentFilePath = path.join(currentDir, `../knowledge/note_creation_${strictness}.md`); - } else if (id in builtinAgents) { - agentFilePath = path.join(currentDir, builtinAgents[id]); - } - - if (agentFilePath) { - const raw = fs.readFileSync(agentFilePath, "utf8"); - + let raw = ''; + switch (strictness) { + case 'medium': + raw = noteCreationMediumRaw; + break; + case 'low': + raw = noteCreationLowRaw; + break; + case 'high': + raw = noteCreationHighRaw; + break; + } let agent: z.infer = { name: id, instructions: raw, diff --git a/apps/x/packages/core/src/knowledge/note_creation_high.md b/apps/x/packages/core/src/knowledge/note_creation_high.ts similarity index 94% rename from apps/x/packages/core/src/knowledge/note_creation_high.md rename to apps/x/packages/core/src/knowledge/note_creation_high.ts index 7c72ad7b..71fd268c 100644 --- a/apps/x/packages/core/src/knowledge/note_creation_high.md +++ b/apps/x/packages/core/src/knowledge/note_creation_high.ts @@ -1,4 +1,4 @@ ---- +export const raw = ` model: gpt-5.2 tools: workspace-writeFile: @@ -66,22 +66,22 @@ When you need to: - Find an organization → Look up by name/domain in the index - Resolve "David" to a full name → Check index for people with that name/alias + organization context -**Only use `cat` to read full note content** when you need details not in the index (e.g., existing activity logs, open items). +**Only use \`cat\` to read full note content** when you need details not in the index (e.g., existing activity logs, open items). # Tools Available -You have access to `executeCommand` to run shell commands: -``` +You have access to \`executeCommand\` to run shell commands: +\`\`\` executeCommand("ls {path}") # List directory contents executeCommand("cat {path}") # Read file contents executeCommand("head -50 {path}") # Read first 50 lines executeCommand("write {path} {content}") # Create or overwrite file -``` +\`\`\` **Important:** Use shell escaping for paths with spaces: -``` +\`\`\` executeCommand("cat 'knowledge_folder/People/Sarah Chen.md'") -``` +\`\`\` **NOTE:** Do NOT use grep to search for entities. Use the provided knowledge_index instead. @@ -112,33 +112,33 @@ Either: # Step 0: Determine Source Type Read the source file and determine if it's a meeting or email. -``` +\`\`\` executeCommand("cat '{source_file}'") -``` +\`\`\` **Meeting indicators:** -- Has `Attendees:` field -- Has `Meeting:` title +- Has \`Attendees:\` field +- Has \`Meeting:\` title - Transcript format with speaker labels **Email indicators:** -- Has `From:` and `To:` fields -- Has `Subject:` field +- Has \`From:\` and \`To:\` fields +- Has \`Subject:\` field - Email signature **Set processing mode:** -- `source_type = "meeting"` → Can create new notes -- `source_type = "email"` → Can only update existing notes +- \`source_type = "meeting"\` → Can create new notes +- \`source_type = "email"\` → Can only update existing notes --- ## Calendar Invite Emails -Emails containing calendar invites (`.ics` attachments or inline calendar data) are **high signal** - a scheduled meeting means this person matters. +Emails containing calendar invites (\`.ics\` attachments or inline calendar data) are **high signal** - a scheduled meeting means this person matters. **How to identify:** - Subject contains "Invitation:", "Accepted:", "Declined:", or "Updated:" -- Has `.ics` attachment reference +- Has \`.ics\` attachment reference - Contains calendar metadata (VCALENDAR, VEVENT) **Rules for calendar invite emails:** @@ -301,10 +301,10 @@ If someone only appears in your memory as "CC'd on outreach emails from [Sender] ## Email-Specific Filtering For emails, check if sender/recipients have existing notes: -```bash +\`\`\`bash executeCommand("grep -r -i -l '{sender email}' '{knowledge_folder}/'") executeCommand("grep -r -i -l '{sender name}' '{knowledge_folder}/People/'") -``` +\`\`\` **If no existing note found:** - Check if this is a warm intro from someone in memory (see below) @@ -332,19 +332,19 @@ A warm intro is when someone already in your memory introduces you to someone ne ## Filter Decision Output If skipping: -``` +\`\`\` SKIP Reason: {reason} -``` +\`\`\` If processing, continue to Step 2. --- # Step 2: Read and Parse Source File -``` +\`\`\` executeCommand("cat '{source_file}'") -``` +\`\`\` Extract metadata: @@ -355,8 +355,8 @@ Extract metadata: - **Duration:** If available **For emails:** -- **Date:** From `Date:` header -- **Subject:** From `Subject:` header +- **Date:** From \`Date:\` header +- **Subject:** From \`Subject:\` header - **From:** Sender email/name - **To/Cc:** Recipients @@ -394,12 +394,12 @@ From the source, collect every way entities are referenced: - Combined references: "Acme integration", "the Series A" Create a list of all variants found: -``` +\`\`\` Variants found: - People: "Sarah Chen", "Sarah", "sarah@acme.com", "David", "their CTO" - Organizations: "Acme Corp", "Acme", "@acme.com" - Projects: "the pilot", "Q2 integration" -``` +\`\`\` --- @@ -411,37 +411,37 @@ Variants found: For each person variant (name, email, alias), check the index: -``` +\`\`\` From index, find matches for: - "Sarah Chen" → Check People table for matching name - "Sarah" → Check People table for matching name or alias - "sarah@acme.com" → Check People table for matching email - "@acme.com" → Check People table for matching organization or check Organizations for domain -``` +\`\`\` ## 3b: Look Up Organizations -``` +\`\`\` From index, find matches for: - "Acme Corp" → Check Organizations table for matching name - "Acme" → Check Organizations table for matching name or alias - "acme.com" → Check Organizations table for matching domain -``` +\`\`\` ## 3c: Look Up Projects and Topics -``` +\`\`\` From index, find matches for: - "the pilot" → Check Projects table for related names - "SOC 2" → Check Topics table for matching keywords -``` +\`\`\` ## 3d: Read Full Notes When Needed Only read the full note content when you need details not in the index (e.g., activity logs, open items): -```bash +\`\`\`bash executeCommand("cat '{knowledge_folder}/People/Sarah Chen.md'") -``` +\`\`\` **Why read these notes:** - Find canonical names (David → David Kim) @@ -494,7 +494,7 @@ Using the search results from Step 3, resolve each variant to a canonical name. ## 4a: Build Resolution Map Create a mapping from every source reference to its canonical form: -``` +\`\`\` Resolution Map: - "Sarah Chen" → "Sarah Chen" (exact match found) - "Sarah" → "Sarah Chen" (matched via Acme context) @@ -506,7 +506,7 @@ Resolution Map: - "@acme.com" → "Acme Corp" (domain match) - "the pilot" → "Acme Integration" (project with Acme) - "the integration" → "Acme Integration" (same project) -``` +\`\`\` ## 4b: Apply Source Type Rules @@ -524,7 +524,7 @@ Resolution Map: When multiple candidates match a variant, disambiguate: **By organization (strongest signal):** -```bash +\`\`\`bash # "David" could be David Kim or David Chen executeCommand("grep -i 'Acme' '{knowledge_folder}/People/David Kim.md'") # Output: **Organization:** [[Acme Corp]] @@ -533,20 +533,20 @@ executeCommand("grep -i 'Acme' '{knowledge_folder}/People/David Chen.md'") # Output: **Organization:** [[Other Corp]] # Source is from Acme context → "David" = "David Kim" -``` +\`\`\` **By email (definitive):** -```bash +\`\`\`bash executeCommand("grep -i 'david@acme.com' '{knowledge_folder}/People/David Kim.md'") # Exact email match is definitive -``` +\`\`\` **By role:** -```bash +\`\`\`bash # Source mentions "their CTO" executeCommand("grep -r -i 'Role.*CTO' '{knowledge_folder}/People/'") # Filter results by organization context -``` +\`\`\` **By recency (weakest signal):** If still ambiguous, prefer the person with more recent activity in notes. @@ -558,7 +558,7 @@ If still ambiguous, prefer the person with more recent activity in notes. ## 4d: Resolution Map Output Final resolution map before proceeding: -``` +\`\`\` RESOLVED (use canonical name with absolute path): - "Sarah", "Sarah Chen", "sarah@acme.com" → [[People/Sarah Chen]] - "David" → [[People/David Kim]] @@ -577,7 +577,7 @@ AMBIGUOUS (flag or skip): SKIP (doesn't warrant note): - "their assistant" → Transactional contact -``` +\`\`\` --- @@ -640,11 +640,11 @@ If role is not explicitly stated, infer from context: - "I can make that call" → decision maker **Format in note:** -```markdown +\`\`\`markdown **Role:** Product Lead (inferred from evaluation discussions) **Role:** Senior (inferred — organized cross-company meeting) **Role:** Engineering (inferred — asked technical integration questions) -``` +\`\`\` **Never write just "Unknown" if you can make a reasonable inference.** @@ -666,11 +666,11 @@ If role is not explicitly stated, infer from context: ### Handling Non-Note-Worthy People For people who don't warrant their own note, add to Organization note's Contacts section: -```markdown +\`\`\`markdown ## Contacts - James Wong — Relationship Manager, helped with account setup - Sarah Lee — Support, handled wire transfer issue -``` +\`\`\` ## Organizations (Meetings Only) @@ -742,21 +742,21 @@ Key facts should be **substantive information about the entity** — not comment **If there are no substantive key facts, leave the section empty.** An empty section is better than filler. **Good key facts:** -```markdown +\`\`\`markdown ## Key facts - Evaluating AI copilot for in-app experience - Three use cases discussed: pre-purchase sales, onboarding, coaching - Budget approved for Q2 pilot - Needs SOC 2 compliance before proceeding -``` +\`\`\` **Bad key facts:** -```markdown +\`\`\`markdown ## Key facts - Name only provided; full name/role not in email. - Email address not available. - Meeting was 50 minutes. -``` +\`\`\` ## Open Items @@ -769,9 +769,9 @@ Open items are **commitments and next steps from the conversation** — not task - Follow-ups agreed: "Will loop in their CTO" **Format:** -```markdown +\`\`\`markdown - [ ] {Action} — {owner if not you}, {due date if known} -``` +\`\`\` **Never include:** - Data gaps: "Find their full name", "Get their email", "Add role" @@ -781,20 +781,20 @@ Open items are **commitments and next steps from the conversation** — not task **If there are no actual commitments or next steps, leave the section empty.** **Good open items:** -```markdown +\`\`\`markdown ## Open items - [ ] Send API documentation — by Friday - [ ] Schedule follow-up call with CTO - [ ] Share pricing proposal — after technical review -``` +\`\`\` **Bad open items:** -```markdown +\`\`\`markdown ## Open items - [ ] Find Matteo's full name, role, and email at [[Eight Sleep]] - [ ] Add Anurag's role/title at Groww - [ ] Research Eight Sleep company background -``` +\`\`\` ## Summary @@ -808,28 +808,28 @@ The summary should answer: **"Who is this person and why do I know them?"** **Focus on the relationship, not the communication method.** **Good summaries:** -```markdown +\`\`\`markdown ## Summary Product contact at [[Organizations/Eight Sleep]] exploring an AI copilot for their app. Initial discussions covered sales assistance, onboarding, and coaching use cases. Currently evaluating fit with their product roadmap. -``` -```markdown +\`\`\` +\`\`\`markdown ## Summary VP Engineering at [[Organizations/Acme Corp]] leading their integration project. Key technical decision-maker. Working toward Q2 pilot launch. -``` +\`\`\` **Bad summaries:** -```markdown +\`\`\`markdown ## Summary Contact at [[Organizations/Eight Sleep]]; received an outbound pitch from [[People/Arjun Maheswaran]] about an in-app AI copilot concept. -``` -```markdown +\`\`\` +\`\`\`markdown ## Summary Attendee on the scheduled "Groww <> RowBoat" meeting (Aug 12, 2024). -``` +\`\`\` **Why these are bad:** - "Received an outbound pitch" — describes the email, not the relationship @@ -843,19 +843,19 @@ If role is unknown but context suggests it, say so: ## Activity Summary One line summarizing this source's relevance to the entity: -``` +\`\`\` **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[links]]} -``` +\`\`\` **Important:** Use canonical names with absolute paths from resolution map in all summaries: -``` +\`\`\` # Correct (uses absolute paths): **2025-01-15** (meeting): [[People/Sarah Chen]] confirmed timeline with [[People/David Kim]]. Blocked on [[Topics/Security Compliance]]. # Incorrect (uses variants or relative links): **2025-01-15** (meeting): Sarah confirmed timeline with David. Blocked on SOC 2. **2025-01-15** (meeting): [[Sarah Chen]] confirmed timeline with [[David Kim]]. Blocked on [[Security Compliance]]. -``` +\`\`\` --- @@ -875,14 +875,14 @@ Review the extracted content for signals that existing note fields should be upd | "Launched" / "completed" / "done" / "shipped" | completed | | "Exploring" / "considering" / "evaluating" / "might" | planning | -**Action:** If a related project note exists and the signal is clear, update the `**Status:**` field. +**Action:** If a related project note exists and the signal is clear, update the \`**Status:**\` field. **Example:** -``` +\`\`\` Source: "Great news — leadership approved the pilot!" Current: **Status:** planning Update to: **Status:** active -``` +\`\`\` **Be conservative:** Only update status when the signal is unambiguous. If unclear, add to activity log but don't change status. @@ -901,14 +901,14 @@ Update to: **Status:** active **How to match:** 1. Read existing open items from the note 2. Look for items that match what was delivered/completed -3. Change `- [ ]` to `- [x]` with completion date +3. Change \`- [ ]\` to \`- [x]\` with completion date **Example:** -``` +\`\`\` Source: "Here's the API documentation you requested." Current: - [ ] Send API documentation — by Friday Update to: - [x] Send API documentation — completed 2025-01-16 -``` +\`\`\` **Be conservative:** Only mark complete if there's a clear match. If unsure, add to activity log but don't mark complete. @@ -921,14 +921,14 @@ Update to: - [x] Send API documentation — completed 2025-01-16 - "I've moved to the [X] team" - Different role mentioned than what's in the note -**Action:** Update the `**Role:**` field in person note. +**Action:** Update the \`**Role:**\` field in person note. **Example:** -``` +\`\`\` Source: Email signature shows "VP Engineering" Current: **Role:** Engineering Lead Update to: **Role:** VP Engineering (updated 2025-01-16) -``` +\`\`\` ## 7d: Organization/Relationship Changes @@ -940,26 +940,26 @@ Update to: **Role:** VP Engineering (updated 2025-01-16) - New email domain for known person **Action:** Update relevant fields: -- Person's `**Organization:**` field -- Org's `**Relationship:**` field (prospect → customer, etc.) +- Person's \`**Organization:**\` field +- Org's \`**Relationship:**\` field (prospect → customer, etc.) **Example:** -``` +\`\`\` Source: "Excited to announce we've signed the contract!" Current: **Relationship:** prospect Update to: **Relationship:** customer -``` +\`\`\` ## 7e: Build State Change List Before writing, compile all detected state changes: -``` +\`\`\` STATE CHANGES: - [[Projects/Acme Integration]]: Status planning → active (leadership approved) - [[People/Sarah Chen]]: Role "Engineering Lead" → "VP Engineering" (signature) - [[People/Sarah Chen]]: Open item "Send API documentation" → completed - [[Organizations/Acme Corp]]: Relationship prospect → customer (contract signed) -``` +\`\`\` --- @@ -968,9 +968,9 @@ STATE CHANGES: Before writing, compare extracted content against existing notes. ## Check Activity Log -```bash +\`\`\`bash executeCommand("grep '2025-01-15' '{knowledge_folder}/People/Sarah Chen.md'") -``` +\`\`\` If an entry for this date/source already exists, this may have been processed. Skip or verify different interaction. @@ -998,9 +998,9 @@ If new info contradicts existing: ## 9a: Meetings — Create and Update Notes **For new entities (meetings only):** -```bash +\`\`\`bash executeCommand("write '{knowledge_folder}/People/Jennifer.md' '{content}'") -``` +\`\`\` **For existing entities:** - Read current content first @@ -1011,11 +1011,11 @@ executeCommand("write '{knowledge_folder}/People/Jennifer.md' '{content}'") - Add new decisions - Add new relationships - Update summary ONLY if significant new understanding -```bash +\`\`\`bash executeCommand("cat '{knowledge_folder}/People/Sarah Chen.md'") # ... modify content ... executeCommand("write '{knowledge_folder}/People/Sarah Chen.md' '{full_updated_content}'") -``` +\`\`\` ## 9b: Emails — Update Existing Notes Only @@ -1035,58 +1035,58 @@ For existing notes: For each state change identified in Step 7: ### Update Project Status -```bash +\`\`\`bash # Read current project note executeCommand("cat '{knowledge_folder}/Projects/Acme Integration.md'") # Update the Status field # Change: **Status:** planning # To: **Status:** active -``` +\`\`\` ### Mark Open Items Complete -```bash +\`\`\`bash # Read current note executeCommand("cat '{knowledge_folder}/People/Sarah Chen.md'") # Find matching open item and update # Change: - [ ] Send API documentation — by Friday # To: - [x] Send API documentation — completed 2025-01-16 -``` +\`\`\` ### Update Role -```bash +\`\`\`bash # Read current person note executeCommand("cat '{knowledge_folder}/People/Sarah Chen.md'") # Update role field # Change: **Role:** Engineering Lead # To: **Role:** VP Engineering -``` +\`\`\` ### Update Relationship -```bash +\`\`\`bash # Read current org note executeCommand("cat '{knowledge_folder}/Organizations/Acme Corp.md'") # Update relationship field # Change: **Relationship:** prospect # To: **Relationship:** customer -``` +\`\`\` ### Log State Changes in Activity When applying a state change, also note it in the activity log: -```markdown +\`\`\`markdown - **2025-01-16** (email): Leadership approved pilot. [Status → active] Contract being drafted. -``` +\`\`\` -Use `[Field → new value]` notation to make state changes visible in the activity log. +Use \`[Field → new value]\` notation to make state changes visible in the activity log. ## 9d: Update Aliases If you discovered new name variants during resolution, add them to Aliases field: -```markdown +\`\`\`markdown # Before **Aliases:** Sarah, S. Chen @@ -1094,14 +1094,14 @@ If you discovered new name variants during resolution, add them to Aliases field # After **Aliases:** Sarah, S. Chen, Sarah C. -``` +\`\`\` ## 9e: Writing Rules -- **Always use absolute paths** with format `[[Folder/Name]]` for all links +- **Always use absolute paths** with format \`[[Folder/Name]]\` for all links - Use YYYY-MM-DD format for dates - Be concise: one line per activity entry -- Note state changes with `[Field → value]` in activity +- Note state changes with \`[Field → value]\` in activity - Escape quotes properly in shell commands --- @@ -1114,14 +1114,14 @@ After writing, verify links go both ways. **IMPORTANT:** Always use absolute links with the folder path to avoid ambiguity: -```markdown +\`\`\`markdown [[People/Sarah Chen]] [[Organizations/Acme Corp]] [[Projects/Acme Integration]] [[Topics/Security Compliance]] -``` +\`\`\` -Format: `[[Folder/Note Name]]` +Format: \`[[Folder/Note Name]]\` This ensures: - No ambiguity when names overlap across folders @@ -1130,10 +1130,10 @@ This ensures: ## Check Each New Link -If you added `[[People/Jennifer]]` to `Organizations/Acme Corp.md`: -```bash +If you added \`[[People/Jennifer]]\` to \`Organizations/Acme Corp.md\`: +\`\`\`bash executeCommand("grep 'Acme Corp' '{knowledge_folder}/People/Jennifer.md'") -``` +\`\`\` If not found, update Jennifer.md to add the link. @@ -1152,7 +1152,7 @@ If not found, update Jennifer.md to add the link. # Note Templates ## People -```markdown +\`\`\`markdown # {Full Name} ## Info @@ -1180,10 +1180,10 @@ If not found, update Jennifer.md to add the link. ## Open items {Commitments and next steps only. Leave empty if none. Never include "find their email" type items.} {Mark completed items with [x] and completion date.} -``` +\`\`\` ## Organizations -```markdown +\`\`\`markdown # {Organization Name} ## Info @@ -1216,10 +1216,10 @@ If not found, update Jennifer.md to add the link. ## Open items {Commitments and next steps only. Leave empty if none.} -``` +\`\`\` ## Projects -```markdown +\`\`\`markdown # {Project Name} ## Info @@ -1253,10 +1253,10 @@ If not found, update Jennifer.md to add the link. ## Key facts {Substantive facts only. Leave empty if none.} -``` +\`\`\` ## Topics -```markdown +\`\`\`markdown # {Topic Name} ## About @@ -1284,7 +1284,7 @@ If not found, update Jennifer.md to add the link. ## Key facts {Substantive facts only. Leave empty if none.} -``` +\`\`\` --- @@ -1338,8 +1338,8 @@ If not found, update Jennifer.md to add the link. ## Example 1: Meeting — Creates Notes -**source_file:** `2025-01-15-meeting.md` -``` +**source_file:** \`2025-01-15-meeting.md\` +\`\`\` Meeting: Acme Integration Kickoff Date: 2025-01-15 Attendees: Sarah Chen (sarah@acme.com), David Kim (david@acme.com), Arj (arj@rowboat.com) @@ -1349,11 +1349,11 @@ Sarah: Thanks for meeting. We're excited about the pilot. David: From a technical side, we need API access first. Sarah: Our CTO Jennifer wants to join the next call. ... -``` +\`\`\` ### Step 0: Determine Source Type -Has `Meeting:` and `Attendees:` → `source_type = "meeting"` → Can create notes +Has \`Meeting:\` and \`Attendees:\` → \`source_type = "meeting"\` → Can create notes ### Step 1: Filter @@ -1366,27 +1366,27 @@ Not mass email, not automated. Continue. - Variants: "Sarah Chen", "sarah@acme.com", "David Kim", "David", "Jennifer", "CTO", "Acme", "the pilot" ### Step 3: Search Existing Notes -```bash +\`\`\`bash executeCommand("grep -r -i -l 'Sarah Chen' 'knowledge/'") # Output: (none) executeCommand("grep -r -i -l 'acme' 'knowledge/'") # Output: (none) -``` +\`\`\` No existing notes. This is a new relationship. ### Step 4: Resolve Entities **Resolution Map:** -``` +\`\`\` NEW ENTITIES (meeting — create): - "Sarah Chen" → Create [[People/Sarah Chen]] - "David Kim" → Create [[People/David Kim]] - "Jennifer" (CTO) → Create [[People/Jennifer]] - "Acme" → Create [[Organizations/Acme Corp]] - "the pilot" → Create [[Projects/Acme Integration]] -``` +\`\`\` ### Step 5: Identify New Entities @@ -1412,7 +1412,7 @@ No existing notes → No state changes to detect. Create all notes with extracted content, ensure bidirectional links. **Example output for Sarah Chen:** -```markdown +\`\`\`markdown # Sarah Chen ## Info @@ -1444,10 +1444,10 @@ Leading the technical evaluation. Reports to [[People/Jennifer]] (CTO). ## Open items - [ ] Provide API access to [[People/David Kim]] - [ ] Schedule follow-up call with [[People/Jennifer]] -``` +\`\`\` **Example output for Acme Integration:** -```markdown +\`\`\`markdown # Acme Integration ## Info @@ -1475,14 +1475,14 @@ Kickoff meeting. Team excited about pilot. API access needed first. CTO [[People ## Open items - [ ] Provide API access to [[People/David Kim]] - [ ] Schedule follow-up call with [[People/Jennifer]] -``` +\`\`\` --- ## Example 2: Email with State Changes -**source_file:** `2025-01-20-email.md` -``` +**source_file:** \`2025-01-20-email.md\` +\`\`\` From: sarah@acme.com To: arj@rowboat.com Date: 2025-01-20 @@ -1500,30 +1500,30 @@ Also, I've been promoted to VP of Engineering as of this month! Best, Sarah Chen VP Engineering, Acme Corp -``` +\`\`\` ### Step 0: Determine Source Type -`source_type = "email"` → Can only update existing notes +\`source_type = "email"\` → Can only update existing notes ### Step 1: Filter Check for existing relationship: -```bash +\`\`\`bash executeCommand("grep -r -i -l 'sarah@acme.com' 'knowledge/'") # Output: notes/People/Sarah Chen.md -``` +\`\`\` Existing note found. Continue. ### Steps 2-5: Parse, Search, Resolve, Skip **Resolution Map:** -``` +\`\`\` RESOLVED: - "Sarah", "sarah@acme.com" → [[People/Sarah Chen]] - "Acme" → [[Organizations/Acme Corp]] -``` +\`\`\` ### Step 6: Extract Content @@ -1538,7 +1538,7 @@ RESOLVED: **7b: Open Item Resolution:** - "Here's the API documentation you requested" -- Existing open item: `- [ ] Send API documentation — by Friday` +- Existing open item: \`- [ ] Send API documentation — by Friday\` - Match found → Mark complete ✓ **7c: Role Change:** @@ -1551,17 +1551,17 @@ RESOLVED: - No change **State Change List:** -``` +\`\`\` STATE CHANGES: - [[Projects/Acme Integration]]: Status planning → active - [[People/Sarah Chen]]: Role "Engineering" → "VP Engineering" - [[People/Sarah Chen]]: Open item "Provide API access" → completed (they sent docs) -``` +\`\`\` ### Steps 8-10: Check, Write, Link **Update Sarah Chen.md:** -```markdown +\`\`\`markdown # Sarah Chen ## Info @@ -1594,10 +1594,10 @@ Key technical decision-maker. Recently promoted. ## Open items - [x] Provide API access to [[People/David Kim]] — completed 2025-01-20 - [ ] Schedule follow-up call with [[People/Jennifer]] -``` +\`\`\` **Update Acme Integration.md:** -```markdown +\`\`\`markdown # Acme Integration ## Info @@ -1616,14 +1616,14 @@ Leadership approved pilot. [Status → active] Legal drafting contract. Targetin **2025-01-15** (meeting) Kickoff meeting. Team excited about pilot. API access needed first. CTO [[People/Jennifer]] joining next call. -``` +\`\`\` --- ## Example 3: Email — No Existing Relationship, Skip -**source_file:** `2025-01-16-email.md` -``` +**source_file:** \`2025-01-16-email.md\` +\`\`\` From: sales@randomvendor.com To: arj@rowboat.com Date: 2025-01-16 @@ -1636,37 +1636,37 @@ how we can help with your data infrastructure... Best, John Smith -``` +\`\`\` ### Step 0: Determine Source Type -`source_type = "email"` +\`source_type = "email"\` ### Step 1: Filter Check for existing relationship: -```bash +\`\`\`bash executeCommand("grep -r -i -l 'randomvendor' 'knowledge/'") # Output: (none) executeCommand("grep -r -i -l 'John Smith' 'knowledge/'") # Output: (none) -``` +\`\`\` No existing note. This is an email. Cannot create notes. **Output:** -``` +\`\`\` SKIP Reason: No existing relationship (email from unknown contact) -``` +\`\`\` --- ## Example 4: Email — Warm Intro (Exception) -**source_file:** `2025-01-16-email.md` -``` +**source_file:** \`2025-01-16-email.md\` +\`\`\` From: david@friendly.vc To: arj@rowboat.com Cc: jennifer@newco.com @@ -1683,19 +1683,19 @@ Jennifer — Arj is the founder of Rowboat, doing great work on AI agents. I'll let you two take it from here! David -``` +\`\`\` ### Step 0: Determine Source Type -`source_type = "email"` +\`source_type = "email"\` ### Step 1: Filter Check for sender: -```bash +\`\`\`bash executeCommand("grep -r -i -l 'david@friendly.vc' 'knowledge/'") # Output: notes/People/David Park.md -``` +\`\`\` Sender exists in memory. Check if this is a warm intro: - Subject contains "Intro:" ✓ @@ -1707,14 +1707,14 @@ Sender exists in memory. Check if this is a warm intro: ### Steps 2-4: Parse, Search, Resolve **Resolution Map:** -``` +\`\`\` RESOLVED: - "David" → [[People/David Park]] (sender, exists) NEW ENTITIES (warm intro exception — create): - "Jennifer Lee" → Create [[People/Jennifer Lee]] - "NewCo" → Create [[Organizations/NewCo]] -``` +\`\`\` ### Step 5: Create Notes (Exception) @@ -1732,8 +1732,8 @@ Creates 2 new notes ([[People/Jennifer Lee]], [[Organizations/NewCo]]). Updates ## Example 5: Meeting — Transactional, Minimal Notes -**source_file:** `2025-01-15-meeting.md` -``` +**source_file:** \`2025-01-15-meeting.md\` +\`\`\` Meeting: HSBC Account Setup Date: 2025-01-15 Attendees: James Wong (james@hsbc.com), Sarah Lee (sarah.lee@hsbc.com), Arj @@ -1742,11 +1742,11 @@ Transcript: James: Let's go through the account setup process. Sarah: I'll handle the wire transfer limits after. ... -``` +\`\`\` ### Step 0: Determine Source Type -`source_type = "meeting"` → Can create notes +\`source_type = "meeting"\` → Can create notes ### Step 5: Identify New Entities @@ -1758,7 +1758,7 @@ Apply "Would I prep?" test: **Action:** Create org note only, list people in Contacts section. ### Output -```markdown +\`\`\`markdown # HSBC ## Info @@ -1787,7 +1787,7 @@ Business banking provider. Account setup completed January 2025. - Daily wire limit: $50,000 ## Open items -``` +\`\`\` --- @@ -1816,10 +1816,10 @@ Business banking provider. Account setup completed January 2025. ## How to Log State Changes -In activity entries, use `[Field → value]` notation: -```markdown +In activity entries, use \`[Field → value]\` notation: +\`\`\`markdown - **2025-01-20** (email): Leadership approved. [Status → active] Contract in progress. -``` +\`\`\` ## When NOT to Change State @@ -1854,7 +1854,7 @@ Before completing, verify: - [ ] Extracted all name variants from source - [ ] Searched notes including Aliases fields - [ ] Built resolution map before writing -- [ ] Used absolute paths `[[Folder/Name]]` in ALL links +- [ ] Used absolute paths \`[[Folder/Name]]\` in ALL links - [ ] Updated Aliases fields with new variants discovered **Filtering:** @@ -1880,9 +1880,10 @@ Before completing, verify: - [ ] Only applied clear, unambiguous state changes **Structure:** -- [ ] All entity mentions use `[[Folder/Name]]` absolute links +- [ ] All entity mentions use \`[[Folder/Name]]\` absolute links - [ ] Activity entries are reverse chronological - [ ] No duplicate activity entries - [ ] Dates are YYYY-MM-DD - [ ] Bidirectional links are consistent -- [ ] New notes in correct folders \ No newline at end of file +- [ ] New notes in correct folders +`; \ No newline at end of file diff --git a/apps/x/packages/core/src/knowledge/note_creation_low.md b/apps/x/packages/core/src/knowledge/note_creation_low.ts similarity index 94% rename from apps/x/packages/core/src/knowledge/note_creation_low.md rename to apps/x/packages/core/src/knowledge/note_creation_low.ts index 7fe6d9eb..7ce72fce 100644 --- a/apps/x/packages/core/src/knowledge/note_creation_low.md +++ b/apps/x/packages/core/src/knowledge/note_creation_low.ts @@ -1,3 +1,4 @@ +export const raw = ` --- model: gpt-5.2 tools: @@ -66,22 +67,22 @@ When you need to: - Find an organization → Look up by name/domain in the index - Resolve "David" to a full name → Check index for people with that name/alias + organization context -**Only use `cat` to read full note content** when you need details not in the index (e.g., existing activity logs, open items). +**Only use \`cat\` to read full note content** when you need details not in the index (e.g., existing activity logs, open items). # Tools Available -You have access to `executeCommand` to run shell commands: -``` +You have access to \`executeCommand\` to run shell commands: +\`\`\` executeCommand("ls {path}") # List directory contents executeCommand("cat {path}") # Read file contents executeCommand("head -50 {path}") # Read first 50 lines executeCommand("write {path} {content}") # Create or overwrite file -``` +\`\`\` **Important:** Use shell escaping for paths with spaces: -``` +\`\`\` executeCommand("cat 'knowledge_folder/People/Sarah Chen.md'") -``` +\`\`\` **NOTE:** Do NOT use grep to search for entities. Use the provided knowledge_index instead. @@ -119,33 +120,33 @@ This mode prioritizes comprehensive capture over selectivity. The goal is to nev # Step 0: Determine Source Type Read the source file and determine if it's a meeting or email. -``` +\`\`\` executeCommand("cat '{source_file}'") -``` +\`\`\` **Meeting indicators:** -- Has `Attendees:` field -- Has `Meeting:` title +- Has \`Attendees:\` field +- Has \`Meeting:\` title - Transcript format with speaker labels **Email indicators:** -- Has `From:` and `To:` fields -- Has `Subject:` field +- Has \`From:\` and \`To:\` fields +- Has \`Subject:\` field - Email signature **Set processing mode:** -- `source_type = "meeting"` → Create notes for all external attendees -- `source_type = "email"` → Create notes for sender if identifiable human +- \`source_type = "meeting"\` → Create notes for all external attendees +- \`source_type = "email"\` → Create notes for sender if identifiable human --- ## Calendar Invite Emails -Emails containing calendar invites (`.ics` attachments) are **high signal** - a scheduled meeting means this person matters. +Emails containing calendar invites (\`.ics\` attachments) are **high signal** - a scheduled meeting means this person matters. **How to identify:** - Subject contains "Invitation:", "Accepted:", "Declined:", or "Updated:" -- Has `.ics` attachment reference +- Has \`.ics\` attachment reference **Rules:** 1. **CREATE a note for the primary contact** - the person you're meeting with @@ -193,19 +194,19 @@ Once a note exists, subsequent emails will enrich it. When the meeting happens, **Important:** When in doubt, PROCESS. In low strictness mode, we err on the side of capturing more. If skipping: -``` +\`\`\` SKIP Reason: {reason} -``` +\`\`\` If processing, continue to Step 2. --- # Step 2: Read and Parse Source File -``` +\`\`\` executeCommand("cat '{source_file}'") -``` +\`\`\` Extract metadata: @@ -216,8 +217,8 @@ Extract metadata: - **Duration:** If available **For emails:** -- **Date:** From `Date:` header -- **Subject:** From `Subject:` header +- **Date:** From \`Date:\` header +- **Subject:** From \`Subject:\` header - **From:** Sender email/name - **To/Cc:** Recipients @@ -263,37 +264,37 @@ Create a list of all variants found. For each person variant (name, email, alias), check the index: -``` +\`\`\` From index, find matches for: - "Sarah Chen" → Check People table for matching name - "Sarah" → Check People table for matching name or alias - "sarah@acme.com" → Check People table for matching email - "@acme.com" → Check People table for matching organization or check Organizations for domain -``` +\`\`\` ## 3b: Look Up Organizations -``` +\`\`\` From index, find matches for: - "Acme Corp" → Check Organizations table for matching name - "Acme" → Check Organizations table for matching name or alias - "acme.com" → Check Organizations table for matching domain -``` +\`\`\` ## 3c: Look Up Projects and Topics -``` +\`\`\` From index, find matches for: - "the pilot" → Check Projects table for related names - "SOC 2" → Check Topics table for matching keywords -``` +\`\`\` ## 3d: Read Full Notes When Needed Only read the full note content when you need details not in the index (e.g., activity logs, open items): -```bash +\`\`\`bash executeCommand("cat '{knowledge_folder}/People/Sarah Chen.md'") -``` +\`\`\` **Why read these notes:** - Find canonical names (David → David Kim) @@ -368,7 +369,7 @@ When multiple candidates match a variant, disambiguate by: ## 4d: Resolution Map Output Final resolution map before proceeding: -``` +\`\`\` RESOLVED (use canonical name with absolute path): - "Sarah", "Sarah Chen", "sarah@acme.com" → [[People/Sarah Chen]] @@ -377,7 +378,7 @@ NEW ENTITIES (create notes): AMBIGUOUS (create with disambiguation note): - "Mike" (no context) → Create [[People/Mike]] with note about ambiguity -``` +\`\`\` --- @@ -508,9 +509,9 @@ Write 2-3 sentences covering their role/function, context of the relationship, a ## Activity Summary One line summarizing this source's relevance to the entity: -``` +\`\`\` **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[links]]} -``` +\`\`\` --- @@ -554,9 +555,9 @@ Before writing: ## 9a: Create and Update Notes **For new entities:** -```bash +\`\`\`bash executeCommand("write '{knowledge_folder}/People/Jennifer.md' '{content}'") -``` +\`\`\` **For existing entities:** - Read current content first @@ -575,7 +576,7 @@ Add newly discovered name variants to Aliases field. ## 9d: Writing Rules -- **Always use absolute paths** with format `[[Folder/Name]]` for all links +- **Always use absolute paths** with format \`[[Folder/Name]]\` for all links - Use YYYY-MM-DD format for dates - Be concise: one line per activity entry - Escape quotes properly in shell commands @@ -589,12 +590,12 @@ After writing, verify links go both ways. ## Absolute Link Format **IMPORTANT:** Always use absolute links: -```markdown +\`\`\`markdown [[People/Sarah Chen]] [[Organizations/Acme Corp]] [[Projects/Acme Integration]] [[Topics/Security Compliance]] -``` +\`\`\` ## Bidirectional Link Rules @@ -611,7 +612,7 @@ After writing, verify links go both ways. # Note Templates ## People -```markdown +\`\`\`markdown # {Full Name} ## Info @@ -638,10 +639,10 @@ After writing, verify links go both ways. ## Open items {Commitments and next steps only. Leave empty if none.} -``` +\`\`\` ## Organizations -```markdown +\`\`\`markdown # {Organization Name} ## Info @@ -673,10 +674,10 @@ After writing, verify links go both ways. ## Open items {Commitments and next steps only. Leave empty if none.} -``` +\`\`\` ## Projects -```markdown +\`\`\`markdown # {Project Name} ## Info @@ -709,10 +710,10 @@ After writing, verify links go both ways. ## Key facts {Substantive facts only.} -``` +\`\`\` ## Topics -```markdown +\`\`\`markdown # {Topic Name} ## About @@ -740,7 +741,7 @@ After writing, verify links go both ways. ## Key facts {Substantive facts only.} -``` +\`\`\` --- @@ -780,7 +781,7 @@ Before completing, verify: - [ ] Extracted all name variants - [ ] Searched existing notes - [ ] Built resolution map -- [ ] Used absolute paths `[[Folder/Name]]` +- [ ] Used absolute paths \`[[Folder/Name]]\` **Filtering:** - [ ] Excluded only self and @user.domain @@ -798,7 +799,8 @@ Before completing, verify: - [ ] Logged changes in activity **Structure:** -- [ ] All links use `[[Folder/Name]]` format +- [ ] All links use \`[[Folder/Name]]\` format - [ ] Activity entries reverse chronological - [ ] Dates are YYYY-MM-DD - [ ] Bidirectional links consistent +`; \ No newline at end of file diff --git a/apps/x/packages/core/src/knowledge/note_creation_medium.md b/apps/x/packages/core/src/knowledge/note_creation_medium.ts similarity index 95% rename from apps/x/packages/core/src/knowledge/note_creation_medium.md rename to apps/x/packages/core/src/knowledge/note_creation_medium.ts index 3716c889..297e19fc 100644 --- a/apps/x/packages/core/src/knowledge/note_creation_medium.md +++ b/apps/x/packages/core/src/knowledge/note_creation_medium.ts @@ -1,4 +1,4 @@ ---- +export const raw = `--- model: gpt-5.2 tools: workspace-writeFile: @@ -66,22 +66,22 @@ When you need to: - Find an organization → Look up by name/domain in the index - Resolve "David" to a full name → Check index for people with that name/alias + organization context -**Only use `cat` to read full note content** when you need details not in the index (e.g., existing activity logs, open items). +**Only use \`cat\` to read full note content** when you need details not in the index (e.g., existing activity logs, open items). # Tools Available -You have access to `executeCommand` to run shell commands: -``` +You have access to \`executeCommand\` to run shell commands: +\`\`\` executeCommand("ls {path}") # List directory contents executeCommand("cat {path}") # Read file contents executeCommand("head -50 {path}") # Read first 50 lines executeCommand("write {path} {content}") # Create or overwrite file -``` +\`\`\` **Important:** Use shell escaping for paths with spaces: -``` +\`\`\` executeCommand("cat 'knowledge_folder/People/Sarah Chen.md'") -``` +\`\`\` **NOTE:** Do NOT use grep to search for entities. Use the provided knowledge_index instead. @@ -118,33 +118,33 @@ Either: # Step 0: Determine Source Type Read the source file and determine if it's a meeting or email. -``` +\`\`\` executeCommand("cat '{source_file}'") -``` +\`\`\` **Meeting indicators:** -- Has `Attendees:` field -- Has `Meeting:` title +- Has \`Attendees:\` field +- Has \`Meeting:\` title - Transcript format with speaker labels **Email indicators:** -- Has `From:` and `To:` fields -- Has `Subject:` field +- Has \`From:\` and \`To:\` fields +- Has \`Subject:\` field - Email signature **Set processing mode:** -- `source_type = "meeting"` → Can create new notes -- `source_type = "email"` → Can create notes if personalized and relevant +- \`source_type = "meeting"\` → Can create new notes +- \`source_type = "email"\` → Can create notes if personalized and relevant --- ## Calendar Invite Emails -Emails containing calendar invites (`.ics` attachments or inline calendar data) are **high signal** - a scheduled meeting means this person matters. +Emails containing calendar invites (\`.ics\` attachments or inline calendar data) are **high signal** - a scheduled meeting means this person matters. **How to identify:** - Subject contains "Invitation:", "Accepted:", "Declined:", or "Updated:" -- Has `.ics` attachment reference +- Has \`.ics\` attachment reference - Contains calendar metadata (VCALENDAR, VEVENT) **Rules for calendar invite emails:** @@ -333,19 +333,19 @@ For emails, evaluate if the content is personalized and business-relevant: ## Filter Decision Output If skipping: -``` +\`\`\` SKIP Reason: {reason} -``` +\`\`\` If processing, continue to Step 2. --- # Step 2: Read and Parse Source File -``` +\`\`\` executeCommand("cat '{source_file}'") -``` +\`\`\` Extract metadata: @@ -356,8 +356,8 @@ Extract metadata: - **Duration:** If available **For emails:** -- **Date:** From `Date:` header -- **Subject:** From `Subject:` header +- **Date:** From \`Date:\` header +- **Subject:** From \`Subject:\` header - **From:** Sender email/name - **To/Cc:** Recipients @@ -395,12 +395,12 @@ From the source, collect every way entities are referenced: - Combined references: "Acme integration", "the Series A" Create a list of all variants found: -``` +\`\`\` Variants found: - People: "Sarah Chen", "Sarah", "sarah@acme.com", "David", "their CTO" - Organizations: "Acme Corp", "Acme", "@acme.com" - Projects: "the pilot", "Q2 integration" -``` +\`\`\` --- @@ -412,37 +412,37 @@ Variants found: For each person variant (name, email, alias), check the index: -``` +\`\`\` From index, find matches for: - "Sarah Chen" → Check People table for matching name - "Sarah" → Check People table for matching name or alias - "sarah@acme.com" → Check People table for matching email - "@acme.com" → Check People table for matching organization or check Organizations for domain -``` +\`\`\` ## 3b: Look Up Organizations -``` +\`\`\` From index, find matches for: - "Acme Corp" → Check Organizations table for matching name - "Acme" → Check Organizations table for matching name or alias - "acme.com" → Check Organizations table for matching domain -``` +\`\`\` ## 3c: Look Up Projects and Topics -``` +\`\`\` From index, find matches for: - "the pilot" → Check Projects table for related names - "SOC 2" → Check Topics table for matching keywords -``` +\`\`\` ## 3d: Read Full Notes When Needed Only read the full note content when you need details not in the index (e.g., activity logs, open items): -```bash +\`\`\`bash executeCommand("cat '{knowledge_folder}/People/Sarah Chen.md'") -``` +\`\`\` **Why read these notes:** - Find canonical names (David → David Kim) @@ -495,7 +495,7 @@ Using the search results from Step 3, resolve each variant to a canonical name. ## 4a: Build Resolution Map Create a mapping from every source reference to its canonical form: -``` +\`\`\` Resolution Map: - "Sarah Chen" → "Sarah Chen" (exact match found) - "Sarah" → "Sarah Chen" (matched via Acme context) @@ -507,7 +507,7 @@ Resolution Map: - "@acme.com" → "Acme Corp" (domain match) - "the pilot" → "Acme Integration" (project with Acme) - "the integration" → "Acme Integration" (same project) -``` +\`\`\` ## 4b: Apply Source Type Rules (Medium Strictness) @@ -525,7 +525,7 @@ Resolution Map: When multiple candidates match a variant, disambiguate: **By organization (strongest signal):** -```bash +\`\`\`bash # "David" could be David Kim or David Chen executeCommand("grep -i 'Acme' '{knowledge_folder}/People/David Kim.md'") # Output: **Organization:** [[Acme Corp]] @@ -534,20 +534,20 @@ executeCommand("grep -i 'Acme' '{knowledge_folder}/People/David Chen.md'") # Output: **Organization:** [[Other Corp]] # Source is from Acme context → "David" = "David Kim" -``` +\`\`\` **By email (definitive):** -```bash +\`\`\`bash executeCommand("grep -i 'david@acme.com' '{knowledge_folder}/People/David Kim.md'") # Exact email match is definitive -``` +\`\`\` **By role:** -```bash +\`\`\`bash # Source mentions "their CTO" executeCommand("grep -r -i 'Role.*CTO' '{knowledge_folder}/People/'") # Filter results by organization context -``` +\`\`\` **By recency (weakest signal):** If still ambiguous, prefer the person with more recent activity in notes. @@ -559,7 +559,7 @@ If still ambiguous, prefer the person with more recent activity in notes. ## 4d: Resolution Map Output Final resolution map before proceeding: -``` +\`\`\` RESOLVED (use canonical name with absolute path): - "Sarah", "Sarah Chen", "sarah@acme.com" → [[People/Sarah Chen]] - "David" → [[People/David Kim]] @@ -575,7 +575,7 @@ AMBIGUOUS (flag or skip): SKIP (doesn't warrant note): - "their assistant" → Transactional contact -``` +\`\`\` --- @@ -642,11 +642,11 @@ If role is not explicitly stated, infer from context: - "I can make that call" → decision maker **Format in note:** -```markdown +\`\`\`markdown **Role:** Product Lead (inferred from evaluation discussions) **Role:** Senior (inferred — organized cross-company meeting) **Role:** Engineering (inferred — asked technical integration questions) -``` +\`\`\` **Never write just "Unknown" if you can make a reasonable inference.** @@ -670,11 +670,11 @@ If role is not explicitly stated, infer from context: ### Handling Non-Note-Worthy People For people who don't warrant their own note, add to Organization note's Contacts section: -```markdown +\`\`\`markdown ## Contacts - James Wong — Relationship Manager, helped with account setup - Sarah Lee — Support, handled wire transfer issue -``` +\`\`\` ## Organizations @@ -758,9 +758,9 @@ Open items are **commitments and next steps from the conversation** — not task - Follow-ups agreed: "Will loop in their CTO" **Format:** -```markdown +\`\`\`markdown - [ ] {Action} — {owner if not you}, {due date if known} -``` +\`\`\` **Never include:** - Data gaps: "Find their full name", "Get their email", "Add role" @@ -783,18 +783,18 @@ The summary should answer: **"Who is this person and why do I know them?"** ## Activity Summary One line summarizing this source's relevance to the entity: -``` +\`\`\` **{YYYY-MM-DD}** ({meeting|email}): {Summary with [[links]]} -``` +\`\`\` **Important:** Use canonical names with absolute paths from resolution map in all summaries: -``` +\`\`\` # Correct (uses absolute paths): **2025-01-15** (meeting): [[People/Sarah Chen]] confirmed timeline with [[People/David Kim]]. Blocked on [[Topics/Security Compliance]]. # Incorrect (uses variants or relative links): **2025-01-15** (meeting): Sarah confirmed timeline with David. Blocked on SOC 2. -``` +\`\`\` --- @@ -814,7 +814,7 @@ Review the extracted content for signals that existing note fields should be upd | "Launched" / "completed" / "done" / "shipped" | completed | | "Exploring" / "considering" / "evaluating" / "might" | planning | -**Action:** If a related project note exists and the signal is clear, update the `**Status:**` field. +**Action:** If a related project note exists and the signal is clear, update the \`**Status:**\` field. **Be conservative:** Only update status when the signal is unambiguous. If unclear, add to activity log but don't change status. @@ -833,7 +833,7 @@ Review the extracted content for signals that existing note fields should be upd **How to match:** 1. Read existing open items from the note 2. Look for items that match what was delivered/completed -3. Change `- [ ]` to `- [x]` with completion date +3. Change \`- [ ]\` to \`- [x]\` with completion date **Be conservative:** Only mark complete if there's a clear match. If unsure, add to activity log but don't mark complete. @@ -846,7 +846,7 @@ Review the extracted content for signals that existing note fields should be upd - "I've moved to the [X] team" - Different role mentioned than what's in the note -**Action:** Update the `**Role:**` field in person note. +**Action:** Update the \`**Role:**\` field in person note. ## 7d: Organization/Relationship Changes @@ -862,13 +862,13 @@ Review the extracted content for signals that existing note fields should be upd ## 7e: Build State Change List Before writing, compile all detected state changes: -``` +\`\`\` STATE CHANGES: - [[Projects/Acme Integration]]: Status planning → active (leadership approved) - [[People/Sarah Chen]]: Role "Engineering Lead" → "VP Engineering" (signature) - [[People/Sarah Chen]]: Open item "Send API documentation" → completed - [[Organizations/Acme Corp]]: Relationship prospect → customer (contract signed) -``` +\`\`\` --- @@ -877,9 +877,9 @@ STATE CHANGES: Before writing, compare extracted content against existing notes. ## Check Activity Log -```bash +\`\`\`bash executeCommand("grep '2025-01-15' '{knowledge_folder}/People/Sarah Chen.md'") -``` +\`\`\` If an entry for this date/source already exists, this may have been processed. Skip or verify different interaction. @@ -907,9 +907,9 @@ If new info contradicts existing: ## 9a: Create and Update Notes **For new entities (meetings and qualifying emails):** -```bash +\`\`\`bash executeCommand("write '{knowledge_folder}/People/Jennifer.md' '{content}'") -``` +\`\`\` **For existing entities:** - Read current content first @@ -920,11 +920,11 @@ executeCommand("write '{knowledge_folder}/People/Jennifer.md' '{content}'") - Add new decisions - Add new relationships - Update summary ONLY if significant new understanding -```bash +\`\`\`bash executeCommand("cat '{knowledge_folder}/People/Sarah Chen.md'") # ... modify content ... executeCommand("write '{knowledge_folder}/People/Sarah Chen.md' '{full_updated_content}'") -``` +\`\`\` ## 9b: Apply State Changes @@ -936,10 +936,10 @@ If you discovered new name variants during resolution, add them to Aliases field ## 9d: Writing Rules -- **Always use absolute paths** with format `[[Folder/Name]]` for all links +- **Always use absolute paths** with format \`[[Folder/Name]]\` for all links - Use YYYY-MM-DD format for dates - Be concise: one line per activity entry -- Note state changes with `[Field → value]` in activity +- Note state changes with \`[Field → value]\` in activity - Escape quotes properly in shell commands --- @@ -951,12 +951,12 @@ After writing, verify links go both ways. ## Absolute Link Format **IMPORTANT:** Always use absolute links with the folder path: -```markdown +\`\`\`markdown [[People/Sarah Chen]] [[Organizations/Acme Corp]] [[Projects/Acme Integration]] [[Topics/Security Compliance]] -``` +\`\`\` ## Bidirectional Link Rules @@ -973,7 +973,7 @@ After writing, verify links go both ways. # Note Templates ## People -```markdown +\`\`\`markdown # {Full Name} ## Info @@ -1000,10 +1000,10 @@ After writing, verify links go both ways. ## Open items {Commitments and next steps only. Leave empty if none.} -``` +\`\`\` ## Organizations -```markdown +\`\`\`markdown # {Organization Name} ## Info @@ -1035,10 +1035,10 @@ After writing, verify links go both ways. ## Open items {Commitments and next steps only. Leave empty if none.} -``` +\`\`\` ## Projects -```markdown +\`\`\`markdown # {Project Name} ## Info @@ -1072,10 +1072,10 @@ After writing, verify links go both ways. ## Key facts {Substantive facts only. Leave empty if none.} -``` +\`\`\` ## Topics -```markdown +\`\`\`markdown # {Topic Name} ## About @@ -1103,7 +1103,7 @@ After writing, verify links go both ways. ## Key facts {Substantive facts only. Leave empty if none.} -``` +\`\`\` --- @@ -1143,7 +1143,7 @@ Before completing, verify: - [ ] Extracted all name variants from source - [ ] Searched notes including Aliases fields - [ ] Built resolution map before writing -- [ ] Used absolute paths `[[Folder/Name]]` in ALL links +- [ ] Used absolute paths \`[[Folder/Name]]\` in ALL links **Filtering:** - [ ] Excluded self (user.name, user.email, @user.domain) @@ -1166,9 +1166,10 @@ Before completing, verify: - [ ] Logged all state changes in activity **Structure:** -- [ ] All entity mentions use `[[Folder/Name]]` absolute links +- [ ] All entity mentions use \`[[Folder/Name]]\` absolute links - [ ] Activity entries are reverse chronological - [ ] No duplicate activity entries - [ ] Dates are YYYY-MM-DD - [ ] Bidirectional links are consistent - [ ] New notes in correct folders +`; \ No newline at end of file