# Personal Intel + Collapsible Funnel Plan

> "Know the BUSINESS, build the RELATIONSHIP"

## Vision
Before calling someone, you should know:
- Their name and role
- Their company, projects, and hiring needs
- Pain points they've mentioned in conversations
- Industry news relevant to their trade
- The full call script funnel - collapsible to bullet points

## AI Guardrails (Updated Jan 2026)
**Professional boundaries matter.** The AI now respects these rules:
- ✅ Reference work/business topics, LinkedIn info, company news
- ✅ Surface things the lead has actually shared with us in conversations
- ❌ Don't ask about family, hobbies, or trips unless THEY brought it up first
- ❌ Don't fake familiarity - we're building trust, not manipulating

**Why this matters:** Construction values authenticity. Asking about someone's daughter's netball game when we've never met feels creepy, not personal. Professional rapport > artificial familiarity.

## Current State
- `searchPerson()` in perplexity.js - Only fetches professional info (LinkedIn, job title)
- `lead_intel` table exists but has limited fields
- CallPrepPage has full funnel but sections aren't collapsible

## What We'll Build

### 1. Enhanced Person Research (Backend)

**Extend `searchPerson()` prompt to include:**
```json
{
  "linkedin_url": "...",
  "job_title": "...",
  "summary": "...",

  // NEW - Personal Profile
  "personal_profile": {
    "family_status": "married with 2 kids" or null,
    "hobbies": ["golf", "fishing", "rugby league"],
    "interests": ["property investment", "4WDs", "camping"],
    "location_suburb": "Parramatta, NSW",
    "personality_notes": "Seems like a straight-shooter based on LinkedIn posts"
  },

  // NEW - Conversation Starters (WORK-FOCUSED)
  "conversation_starters": [
    "Ask about the Westmead project he mentioned - how's it going?",
    "Follow up on the formworkers he said he needs",
    "He mentioned agency fees were killing him - good opening"
  ]
}
```

**New function: `searchPersonalNews(leadId)`**
- Takes the person's hobbies/interests
- Searches for recent news/events related to them
- Returns talking points like:
  - "The NRL finals are next week - good opener if he's into rugby"
  - "Fishing season just opened at Lake Eucumbene"
  - "Property market in Western Sydney is hot right now"

### 2. Database Schema Update

**Extend `lead_intel` table:**
```sql
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS family_status TEXT;
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS hobbies TEXT[];
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS interests TEXT[];
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS location_suburb TEXT;
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS personality_notes TEXT;
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS conversation_starters TEXT[];
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS personal_news JSONB;
ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS social_profiles JSONB;
```

### 3. Frontend - Business Context Card

**New section at top of CallPrepPage:**
```
┌──────────────────────────────────────────────────────────┐
│  [JM]  John Mitchell                                     │
│        Operations Manager at BuildCorp                   │
│        Parramatta, NSW                                   │
│                                                          │
│  🏗️ 6-month Westmead Hospital project                   │
│  👷 Needs 2-3 formworkers urgently                       │
│  💰 Currently paying 35% agency markup                   │
│                                                          │
│  💬 CONVERSATION STARTERS:                               │
│  • Ask how the Westmead project is going                │
│  • Follow up on the formworkers he mentioned needing    │
│  • He said agency fees are killing him - good opener    │
│                                                          │
│  📰 INDUSTRY NEWS:                                       │
│  • Construction hiring up 15% in Western Sydney         │
│  • New infrastructure projects announced in Parramatta  │
└──────────────────────────────────────────────────────────┘
```

*Note: Personal details (family, hobbies) only shown if the lead shared them in conversation first.*

### 4. Collapsible Funnel Sections

Each section (Opening, Discovery, Value Props, Objections, Closing) becomes collapsible:

**Collapsed state (bullet mode):**
```
▸ 👋 Opening
  "Hey John, quick question about your crew situation..."

▸ 🔍 Discovery (3 questions)
  • Current crew size? • Peak season needs? • Worst reliability issue?

▸ 💎 Value Props (3 points)
  • 9.9% vs 30-40% agency • Same-day matching • Rating system

▸ 🛡️ Objections (2 prepared)
  • "Already have reliable guys" → ... • "Don't trust platforms" → ...

▸ 🎯 Closing
  "Let's get you set up - takes 2 minutes..."
```

**Expanded state (full detail):**
Click any section to expand and see full scripts with context.

## Implementation Steps

### Phase 1: Backend - COMPLETE
1. [x] Update `searchPerson()` prompt in perplexity.js to include personal profile
2. [x] Add `extractPersonalIntelFromConversations()` function in ai.js
3. [x] Create migration for new `lead_intel` columns
4. [x] Update `/api/ai/live-intel/:leadId` to combine Perplexity + conversation intel

### Phase 2: Frontend - COMPLETE
1. [x] Add PersonalProfileCard at top of CallPrepPage
2. [x] Make funnel sections collapsible with expand/collapse
3. [x] Add conversation starters section
4. [x] Add weekend plans, important dates, personality traits
5. [x] Build and deploy

### Phase 3: Test
1. [ ] Run migration in Supabase
2. [ ] Test with real lead that has company/name
3. [ ] Verify personal intel appears from conversations
4. [ ] Test collapsible sections work
5. [ ] Test on mobile

## Privacy & Professional Boundaries
- Uses publicly available business information (LinkedIn, company websites)
- Extracts context ONLY from conversations the lead has had with us
- Personal topics (family, hobbies) never scraped or assumed
- AI respects professional boundaries - no fake familiarity
- Cached for 30 days to avoid repeated API calls

## Why This Matters
Construction is a relationship business built on TRUST. Knowing someone's business pain points, projects, and hiring needs transforms a cold call into a valuable conversation. We earn rapport through relevance, not by pretending we know their personal life.

**The principle:** AI guides, humans personalize. Suggestions are starting points - reps should adapt in their own voice. Construction industry notices when interactions feel "too AI".

---

**Ready for approval?**
