# EMEA Daily Intelligence Brief

Standalone playbook for the `regional_support` TiDB database.  
SQL queries: [`EMEA-Daily-Intelligence-Brief.sql`](./EMEA-Daily-Intelligence-Brief.sql)

---

## 1. What this data source can see

| Table | Scope | Key signals |
|-------|-------|-------------|
| `emea_new_signup` | EMEA tenants registered **today** (daily scan) | email, country, plan, AI category, business description, website |
| `emea_active_tenants` | EMEA **active** tenants with usage enrichment | + cluster_count, tenant_avg_qps, has_credit_card, sales_owner |
| `domain_intelligence` | Email-domain AI classification cache | category, description, source, expires_at |

**Entity AI categories**

Full classification rubric (canonical, living doc): **[`entity-ai-category-rubric.md`](./entity-ai-category-rubric.md)**

| Category | Meaning (short) |
|----------|-----------------|
| `company_ai_core` | AI is the core product / primary offering |
| `company_ai_related` | AI is a clear part of the product, not the main business |
| `company_non_ai` | Real company; AI not core on public positioning |
| `institution_non_ai` | School, NGO, government, etc. |
| `individual` | Personal / free email (gmail, etc.) |
| `unknown` | Enrichment failed or inconclusive |

**What this data cannot see** (do not infer in the brief):
- Marketing channel / UTM attribution
- Funnel milestones (first query, first import, churn date)
- In-product behavior beyond avg QPS and cluster count
- Whether the user already received an email or was contacted

---

## 2. SLG routing rules

Each record gets exactly **one primary route**. When multiple rules match, use the **highest priority** rule (P0 beats P1).

### Query 2 output — per-user action contract

Every row from Query 2 includes **executable fields**, not just labels:

| Column | Purpose |
|--------|---------|
| `recommended_action` | Machine tag (automation key) |
| `action_title` | Human-readable action name |
| `timeline` | When to act (same day / Day 3 / 48h / etc.) |
| `due_date` | Concrete deadline date |
| `action_steps` | Numbered steps — what to do |
| `content_brief` | Personalized email/Slack copy (placeholders filled from row) |
| `success_criteria` | How to know the action is done |
| `assign_to` / `owner_label` | Who executes |

### 2.1 Route definitions

| Route | Destination | Purpose |
|-------|-------------|---------|
| `slack_and_hubspot` | Slack `#emea-slg-alerts` + HubSpot contact/task | Same-day human action required |
| `hubspot` | HubSpot only (list + task) | SLG action within 48h–7d; no real-time Slack noise |
| `slack_review` | Slack `#emea-gtm-review` | Needs human judgment before CRM |
| `plg_nurture` | Email automation / in-product onboarding | No sales touch |
| `cs_ticket` | CS / ops queue | Technical or data issue |
| `monitor` | Weekly rollup only | No daily action |

### 2.2 New signup rules (`emea_new_signup`, `DATE(created_at) = brief_date`)

| Priority | Condition | Route | Action | Owner |
|----------|-----------|-------|--------|-------|
| **P0** | `entity_ai_category = 'company_ai_core'` | `slack_and_hubspot` | Personalized same-day outreach using `business_description` + `official_website` | `sales_owner_email` if set, else `emea-ae-pool` |
| **P1** | `entity_ai_category = 'company_ai_related'` | `hubspot` | Outreach within 48h; lead with AI use-case angle | `sales_owner_email` if set, else `emea-ae-pool` |
| **P1** | `entity_ai_category = 'company_non_ai'` AND corporate email domain | `hubspot` | Qualify (company size, use case) then outreach within 48h | `sales_owner_email` if set, else `emea-ae-pool` |
| **P1** | `entity_ai_category = 'unknown'` | `slack_review` | Manual re-enrich; re-route after category resolved | `#emea-gtm-review` |
| **P2** | `entity_ai_category IN ('company_non_ai', 'institution_non_ai')` AND free email | `plg_nurture` | Enterprise nurture track (no AE) | PLG automation |
| **P3** | `entity_ai_category = 'individual'` | `plg_nurture` | Standard trial onboarding (no AE) | PLG automation |

**Corporate email heuristic** (used in SQL): email NOT matching  
`@(gmail|yahoo|hotmail|outlook|icloud|proton|pm.me|aol).`

### 2.3 Active tenant rules (`emea_active_tenants`)

| Priority | Condition | Route | Action | Owner |
|----------|-----------|-------|--------|-------|
| **P0** | `company_ai_core` or `company_ai_related` AND `tenant_avg_qps >= 50` | `slack_and_hubspot` | TAM escalation — high-volume AI customer | `emea-tam-pool` or existing `sales_owner_email` |
| **P0** | `company_ai_core` or `company_ai_related` AND `tenant_avg_qps >= 1` | `slack_and_hubspot` | Expansion call — active usage, upsell Dedicated/Enterprise | `sales_owner_email` or `emea-ae-pool` |
| **P0** | `plan = 'poc'` AND not `individual` | `slack_and_hubspot` | POC conversion follow-up before expiry | `sales_owner_email` or `emea-ae-pool` |
| **P1** | `cluster_count >= 3` AND `has_credit_card = 0` AND not `individual` | `hubspot` | Payment conversion assist — multi-cluster, no card on file | `sales_owner_email` or `emea-ae-pool` |
| **P2** | `error_message` is not empty | `cs_ticket` | Investigate cluster/API error | CS queue |
| **P2** | All other active records | `monitor` | Include in weekly rollup only | — |

### 2.4 Per-user action playbook

Use this when writing the brief or creating HubSpot tasks.

#### New signup — SLG actions

| `recommended_action` | Who acts | What to do | Done when |
|---------------------|----------|------------|-----------|
| `slg_same_day_outreach` | AE | Send personalized email referencing `business_description` and `official_website`. Offer 15-min architecture call. | Contact logged in HubSpot, reply or meeting booked |
| `slg_48h_outreach` | AE | Same as above; AI-adjacent angle. Lower urgency than core. | Task completed in HubSpot |
| `slg_qualify_and_outreach` | AE / SDR | Confirm company identity via website. Ask about workload (HTAP, scale, compliance). | Qualified or disqualified in HubSpot |
| `manual_enrich_then_route` | GTM ops | Re-run domain enrich or manual research. Update category. Re-apply routing rules. | Category no longer `unknown` |

#### New signup — PLG actions

| `recommended_action` | Who acts | What to do | Done when |
|---------------------|----------|------------|-----------|
| `plg_standard_onboarding` | Automation | Day 0 welcome → Day 3 nudge if no cluster → Day 7 referral ask | Enrolled in PLG email sequence |
| `plg_enterprise_nurture` | Automation | Enterprise case-study track; no AE unless they create cluster + sustained QPS | Enrolled in enterprise nurture sequence |

#### Active tenant — expansion actions

| `recommended_action` | Who acts | What to do | Done when |
|---------------------|----------|------------|-----------|
| `tam_escalation` | TAM | Proactive health check. Review QPS trend, offer architecture review, discuss Dedicated tier. | TAM note in HubSpot |
| `expansion_call` | AE | Call/email: acknowledge usage (cite QPS tier), discuss scaling, pricing, support tier. | Meeting or expansion opp created |
| `poc_conversion_followup` | AE | Schedule POC review. Present production plan + pricing. | POC → on_demand or closed-lost |
| `payment_conversion_assist` | AE | Offer billing setup call. Address multi-cluster cost concerns. | Credit card added or explicit decline |
| `cs_investigate_error` | CS | Check `error_message` (e.g. cluster 404). Fix or escalate to eng. | Error cleared or ticket filed |
| `monitor_only` | — | No action today | — |

---

## 3. Daily runbook

```
06:00 UTC  Scan job completes → emea_* tables updated (check processed_at)
06:15 UTC  Run SQL freshness check (query 0)
06:20 UTC  Run queries 1–7 → assemble JSON bundle
06:25 UTC  Agent generates brief narrative
06:30 UTC  Automation pushes:
             • P0 → Slack #emea-slg-alerts
             • HubSpot list → queries 4 rows
             • PLG → query 5 export
             • Review queue → Slack #emea-gtm-review (query 6)
```

---

## 4. Agent prompt template

Copy everything between `--- PROMPT START ---` and `--- PROMPT END ---`.

--- PROMPT START ---

### System

You are an EMEA regional intelligence analyst for TiDB Cloud. You write a daily brief for sales, growth, and cloud ops teams.

You receive a JSON snapshot from the `regional_support` database. The snapshot contains:
- `meta` — brief date, scan freshness, signup counts
- `category_mix` — today's signups by `entity_ai_category` vs yesterday
- `action_queue` — every record with pre-computed `priority`, `route`, `recommended_action`, `assign_to`
- `plg_nurture` — records routed to PLG only
- `manual_review` — unknown categories and errors

**Hard rules**

1. **Numeric grounding** — Every number you cite must appear in the input JSON. Do not compute new percentages unless the input already includes them.
2. **No invented context** — Do not claim channel attribution, funnel stage, or prior contact history unless present in the input.
3. **Action fidelity** — Every recommended action for a user must match their `recommended_action` field. Do not upgrade `plg_nurture` to SLG or downgrade P0 to monitor.
4. **Small-N hedging** — If `new_signups_today` < 5, say "early read" or "small sample"; do not over-interpret day-over-day deltas.
5. **Stale data** — If `freshness_status` is `STALE`, lead the brief with a data-quality warning and still report what is available.
6. **Tone** — Direct, operational, no marketing language, no emoji.

**Output format** — Return a JSON object with these string fields (each 2–5 sentences, except `user_actions` which is an array):

```json
{
  "headline": "",
  "signup_quality": "",
  "slg_priority": "",
  "expansion_signals": "",
  "plg_and_monitor": "",
  "data_quality": "",
  "user_actions": [
    {
      "tenant_id": "",
      "name": "",
      "email": "",
      "record_type": "",
      "priority": "",
      "route": "",
      "recommended_action": "",
      "assign_to": "",
      "action_summary": "",
      "talking_points": []
    }
  ]
}
```

**Section guidance**

| Field | Content |
|-------|---------|
| `headline` | One sentence: total signups today, count of P0 SLG items, anything urgent |
| `signup_quality` | Mix by category vs yesterday; note if AI company share shifted |
| `slg_priority` | Narrate all P0/P1 items from `action_queue`; name companies, countries, why they matter |
| `expansion_signals` | Active tenants with QPS ≥ 1 or POC plan; cite QPS and cluster count from input |
| `plg_and_monitor` | Count of individuals on PLG track; P2/P3 items requiring no same-day action |
| `data_quality` | Scan freshness, unknown count, error_message count |
| `user_actions` | One object per row in `action_queue` where `priority` ≤ P1; `action_summary` = one imperative sentence; `talking_points` = 2–3 bullets from `business_description` / usage signals only |

### User message template

```
Generate the EMEA Daily Intelligence Brief for {{brief_date}}.

<input>
{{JSON_BUNDLE}}
</input>
```

--- PROMPT END ---

---

## 5. JSON bundle assembly (pseudo-code)

Run after SQL queries 1–7. Pass result to the agent.

```json
{
  "meta": {
    "brief_date": "2026-05-20",
    "new_signup_last_scan": "2026-05-20T08:17:50Z",
    "active_last_scan": "2026-05-20T08:17:39Z",
    "freshness_status": "OK",
    "new_signups_today": 3,
    "new_signups_yesterday": 5
  },
  "category_mix": [
    {
      "entity_ai_category": "individual",
      "signups_today": 2,
      "signups_yesterday": 4,
      "delta_vs_yesterday": -2
    },
    {
      "entity_ai_category": "company_ai_core",
      "signups_today": 1,
      "signups_yesterday": 0,
      "delta_vs_yesterday": 1
    }
  ],
  "action_queue": [],
  "plg_nurture": [],
  "manual_review": []
}
```

Populate `action_queue` from SQL query 2, `plg_nurture` from query 5, `manual_review` from query 6.

---

## 6. HubSpot + Slack field mapping

### Slack message template (P0)

```
🔴 EMEA SLG P0 — {{brief_date}}

{{#each p0_items}}
• [{{record_type}}] {{name}} ({{country}}) — {{entity_ai_category}}
  {{email}} | plan: {{plan}} | QPS: {{tenant_avg_qps}}
  → {{recommended_action}} → @{{assign_to}}
  {{business_description}}
{{/each}}
```

### HubSpot contact properties to set

| Property | Source field |
|----------|-------------|
| Email | `email` |
| Company | `name` |
| Country | `country` |
| TiDB Tenant ID | `tenant_id` |
| AI Category | `entity_ai_category` |
| Business Description | `business_description` |
| Website | `official_website` |
| Recommended Action | `recommended_action` |
| Priority | `priority` |
| HubSpot Owner | lookup from `assign_to` email |

### HubSpot task template

| Field | Value |
|-------|-------|
| Subject | `[EMEA {{priority}}] {{recommended_action}} — {{name}}` |
| Body | See `business_description`. Website: {{official_website}}. Plan: {{plan}}. QPS: {{tenant_avg_qps}}. Clusters: {{cluster_count}}. |
| Due date | P0 = today, P1 = +2 days, P2 = +7 days |
| Queue | `hubspot_list_name` from SQL query 4 |

---

## 7. Example brief output (illustrative)

Given 1 new `company_ai_core` signup and 1 active tenant with QPS 370:

**Headline:**  
Today EMEA saw 3 new signups; 1 is AI-core (PREA, DE) requiring same-day SLG outreach. One active AI customer (Quickfire, GB) is running at 370 QPS — expansion P0.

**SLG priority:**  
- **PREA** (claas.gnerlich@prea.eu, DE, `new_user`) — real estate AI consulting. Route: Slack + HubSpot. Action: same-day outreach referencing their AI-driven property analytics.  
- **Quickfire** (fred@quickfiredigital.com, GB, `on_demand`, QPS 370) — Shopify agency at scale. Route: Slack + HubSpot. Action: expansion call; discuss Dedicated tier and peak-traffic support.

**PLG and monitor:**  
2 individual gmail signups → standard PLG onboarding, no AE.

---

## 8. Decision tree (quick reference)

```
NEW SIGNUP
├── company_ai_core ──────────────► P0 → Slack + HubSpot → same-day outreach
├── company_ai_related ───────────► P1 → HubSpot → 48h outreach
├── company_non_ai + corp email ──► P1 → HubSpot → qualify + outreach
├── company_non_ai + free email ──► P2 → PLG enterprise nurture
├── institution_non_ai ───────────► P2 → PLG enterprise nurture
├── individual ───────────────────► P3 → PLG standard onboarding
└── unknown ──────────────────────► P1 → Slack review → manual enrich

ACTIVE TENANT
├── AI company + QPS ≥ 50 ────────► P0 → Slack + HubSpot → TAM escalation
├── AI company + QPS ≥ 1 ─────────► P0 → Slack + HubSpot → expansion call
├── plan = poc (not individual) ──► P0 → Slack + HubSpot → POC conversion
├── clusters ≥ 3, no credit card ─► P1 → HubSpot → payment conversion assist
├── error_message set ────────────► P2 → CS ticket
└── else ─────────────────────────► monitor (weekly rollup)
```
