Skip to content

feat: expand fact extraction patterns for personal assistant use #67

Description

@wtthornton

Summary

The current 16 extraction patterns in extraction.py are tuned for code-repo contexts ("we decided", "root cause", "convention:"). A personal assistant receives very different input that these patterns miss entirely.

Examples That Fail Today

User Input Expected Extraction Current Result
"I prefer mornings for meetings" preference: morning meetings ❌ No match
"My wife's name is Sarah" relationship: wife = Sarah ❌ No match
"I'm allergic to shellfish" health: shellfish allergy ❌ No match
"I always take the 8am train" routine: 8am train ❌ No match
"I don't like spicy food" preference: no spicy food ❌ No match
"My dentist is Dr. Smith at 555-1234" contact: dentist = Dr. Smith ❌ No match

Proposed Solution

Add personal-assistant extraction patterns, ideally gated by profile so repo-brain isn't affected:

Preference patterns

  • I prefer ..., I like ..., I don't like ..., I love ..., I hate ...
  • I always ..., I never ..., I usually ...

Relationship / identity patterns

  • My (wife|husband|partner|boss|doctor|dentist|...) is ...
  • I am ..., I'm a ..., I work at ..., I live in ...

Health / constraint patterns

  • I'm allergic to ..., I can't eat ..., I don't drink ...

Routine patterns

  • Every (Monday|morning|week) I ..., On (Tuesdays|weekends) I ...
  • I usually ... at (time)

Tier inference for personal patterns

  • Identity patterns → identity tier
  • Preference patterns → long-term tier
  • Routine patterns → procedural tier (see #procedural-tier issue)
  • Temporal/recent → short-term tier

Alternatives Considered

  • LLM-based extraction only: Higher quality but adds cost, latency, and API dependency. Better to use deterministic extraction as the primary path and LLM extraction as a complement (with source: agent lower trust).
  • NLP libraries (spaCy, etc.): Heavier dependency. Regex patterns are sufficient for common personal expressions.

Effort

Medium — pattern design + testing for false positives across both profiles.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions