Skip to content

feat: Auto-extract preferences from conversations #2

Description

@krishagel

Summary

Enable Geoffrey to detect preference statements in natural conversation and offer to save them to preferences.json. Reduces friction of manual preference updates while maintaining user control through confirmation.

User Story

As a user, I want Geoffrey to notice when I state preferences in conversation and offer to remember them so that I don't have to explicitly invoke the knowledge-manager skill.

Requirements

  • Detect preference-indicating phrases in conversation
  • Extract structured preference (category, key, value)
  • Calculate confidence score based on statement strength
  • Ask for confirmation before saving
  • Update preferences.json only on confirmation

Trigger Phrases (Examples)

Pattern Example Confidence
"I always..." "I always book aisle seats" 1.0
"I prefer..." "I prefer Marriott over Hilton" 0.9
"I never..." "I never use American Airlines" 1.0
"I like..." "I like window seats on short flights" 0.8
"I usually..." "I usually take the 6am flight" 0.7
"I want..." "I want high floors at hotels" 0.8
"Don't ever..." "Don't ever book me a middle seat" 1.0

Confirmation Workflow

Step 1: Detection
User: "I always drink English Breakfast tea in the morning"
Geoffrey detects: Preference statement

Step 2: Confirmation Prompt
Geoffrey: "Should I remember this preference?

  • Category: personal.beverages
  • Preference: English Breakfast tea, mornings
  • Confidence: 1.0 (explicit 'always')

[Yes] [No] [Edit]"

Step 3a: User confirms
Geoffrey: "✓ Saved to preferences. I'll remember your tea preference."

Step 3b: User declines
Geoffrey: "No problem, I won't store that."

Step 3c: User edits
Geoffrey: "What would you like to change?"
→ Allows category/value adjustment before saving

Acceptance Criteria

  • Detect 7+ preference-indicating phrase patterns
  • Extract category, key, value from natural language
  • Calculate confidence based on statement strength
  • Display confirmation with preview of what will be saved
  • Allow user to edit before saving
  • Save to preferences.json with proper structure
  • Never save without confirmation
  • Handle negations correctly ("never" vs "always")

Technical Considerations

Architecture

  • Detection Layer: Pattern matching for trigger phrases
  • Extraction Layer: NLP-style parsing for category/key/value
  • Confirmation Layer: AskUserQuestion or inline confirmation
  • Storage Layer: preferences.json via knowledge-manager

Implementation Notes

  • Use regex patterns for initial detection, then semantic parsing
  • Map to existing preference categories when possible
  • Create new categories if needed (with confirmation)
  • Handle context: "I always book aisle seats" needs flight context

Edge Cases

  • Multiple preferences in one statement: Handle each separately
  • Conflicting preferences: Note conflict, ask which is correct
  • Context-dependent: "I prefer Marriott" (for hotels, not general)
  • Temporary vs permanent: "I want to try..." is not a preference

Performance

  • Detection should be fast (regex-based)
  • Only trigger confirmation for high-confidence matches

Testing Plan

  • Unit tests: Pattern detection, extraction parsing
  • Integration tests: Full workflow with preferences.json
  • Manual tests: Natural conversation scenarios

Related Files

  • ~/Library/Mobile Documents/com~apple~CloudDocs/Geoffrey/knowledge/preferences.json
  • skills/knowledge-manager/SKILL.md

Phase

Future enhancement - builds on existing knowledge-manager foundation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions