← back to Rentv Sheet Enrich Refine

AGENT_INSTRUCTIONS.md

39 lines

# Enrichment worker — instructions

You enrich one batch of the RENTV CRE contact spreadsheet. **Provenance:** every contact
is Steve Bloom's (RENTV) — you only ADD data, never change originals.

## Steps
1. Load the Exa tool: call ToolSearch with `select:mcp__exa__web_search_exa`.
2. Read your batch file: `~/Projects/rentv-sheet-enrich/data/batches/batch_<NN>.json`.
   It has `gid` and `targets` = list of `{row, company, contact, email, domain}`.
3. For EACH target, run ONE Exa `mcp__exa__web_search_exa` call (numResults 4):
   query = `category:people Marketing Manager or VP of Marketing or senior executive at <company> (commercial real estate)`
   You may run several targets' searches in parallel (multiple tool calls per message).
4. From each company's results, extract (ALL optional — blank is correct when unsure):
   - **company_li**: a result's `[<Company>](https://www.linkedin.com/company/SLUG)` whose
     company name matches the target → `https://www.linkedin.com/company/SLUG`.
   - **contact_li**: if a result person's name matches the target's `contact` field →
     that person's `https://www.linkedin.com/in/...` URL.
   - **mvp**: the best MARKETING person (title has Marketing/CMO/Communications/PR) tied to
     THIS company; else a VP/President tied to this company. Format: `Name — Title — <their linkedin URL>`.
   - **updated_email**: ONLY if a real corporate email string appears in results that is
     better than the row's `email` (e.g. corporate vs the row's gmail/hotmail). Do NOT guess
     `first.last@domain` patterns. Almost always blank.
   - **website**: only if the row's `domain` is empty AND a real company domain is discoverable.
5. **HARD RULES — no fabrication.** Accept a person ONLY if their result explicitly ties to
   the target company (matching company slug or company name in the highlight). Wrong-company
   results (a different firm bleeding in) must be ignored. Blanks beat guesses.
   - **why**: a short rationale for the marketing/VP you chose (e.g. "CMO — top marketing exec",
     "Phoenix-based marketing dir — local to the AZ event", "no marketing role; senior-most VP",
     "small firm — matched your existing contact"). ALWAYS include a why when you set mvp OR when
     you deliberately left mvp blank.
6. Write results: build a JSON list of `{company, company_li, contact_li, mvp, updated_email, website, why}`
   — **key each item by the exact "company" string from your batch** (NOT a row number). Include
   only companies with at least one found field. Save to `/tmp/result_<NN>.json`, then run:
   `python3 ~/Projects/rentv-sheet-enrich/write_by_name.py <gid> /tmp/result_<NN>.json`
   (gid is in your batch file). This writer matches by COMPANY NAME (row-shift immune), greens
   cells, and skips any already-filled cell.
7. Return ONE line: `batch <NN>: <N> companies, <cells> cells written, <k> marketing/VP found`.
   Do NOT return the full data — the writer already persisted it.