qobrix_cohort
Identify repeat customers by analyzing contacts across multiple deals or opportunities. Supports buyer, seller, and lead modes with deal counts, volumes, commissions, and dates.
Instructions
Find contacts that appear on multiple deals or opportunities — the 'repeat customer' report every CRM analyst gets asked for. Three modes: 'buyers' (default) walks closed contracts → opportunity_id → opportunities.contact_name to identify the buyer behind each closed sale. 'sellers' walks contracts → property_id → properties.seller. 'leads' groups all opportunities by contact_name regardless of close. Returns each repeat contact with deal_count, total_volume, total_commission, first_deal, last_deal, and a deals[] breakdown. Example uses: 2026 repeat buyers: { kind: 'buyers', year: 2026, min_count: 2 }. All-time loyal customers: { kind: 'buyers', min_count: 3 }. Recurring sellers this year: { kind: 'sellers', year: 2026 }. Frequent enquirers (any close): { kind: 'leads', since_days: 365 }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ISO exclusive upper bound. | |
| top | No | Max repeat contacts to return (default 20). | |
| from | No | ISO inclusive lower bound. | |
| kind | No | Which population to cohort (default 'buyers'). 'buyers' = contacts behind closed contracts (contract.opportunity_id → opportunity.contact_name). 'sellers' = contacts on the listing side (contract.property_id → property.seller). 'leads' = contacts on opportunities regardless of close. | |
| year | No | Calendar year window. | |
| min_count | No | Minimum deal/opportunity count per contact to include them in the cohort (default 2). | |
| since_days | No | Rolling window in days. | |
| contract_types | No | Contract types for buyers/sellers (default ['cos']). | |
| contract_statuses | No | Contract statuses for buyers/sellers (default ['agreed']). |