Overview
Feature stores numeric metrics for ML/MAB consumption. A single item per LeadOrganization.Feature Categories
RFM (Recency, Frequency, Monetary)
| Feature | Description |
|---|---|
recency_days | Days since last interaction |
frequency_conversations_30d | Conversations in the last 30 days |
frequency_purchases_90d | Purchases in the last 90 days |
monetary_total | Total amount spent (lifetime) |
monetary_avg_ticket | Average purchase amount |
Engagement
| Feature | Description |
|---|---|
avg_response_time_seconds | Lead’s average response time |
avg_messages_per_conversation | Average messages per conversation |
sentiment_avg_30d | Average sentiment score (0-1) in the last 30 days |
Behavior
| Feature | Description |
|---|---|
discount_request_rate | Rate of conversations where lead asked for a discount |
conversion_rate | Rate of conversations that resulted in a purchase |
support_ticket_rate_30d | Support tickets in the last 30 days |
days_since_last_purchase | Days since last purchase |
has_purchased | 1 if lead has any purchase, 0 otherwise |
engagement_score | Composite engagement score (0-1) |
Temporal Patterns
| Feature | Description |
|---|---|
preferred_hour_of_day | Hour the lead most frequently interacts |
preferred_day_of_week | Day of week the lead most frequently interacts |
channel_diversity | Number of different channels used |
Campaign
| Feature | Description |
|---|---|
campaign_open_rate | Rate of opened campaigns |
campaign_click_rate | Rate of clicked campaigns |
campaigns_received_30d | Campaigns received in the last 30 days |
Future: ML and MAB
The Lead Domain is designed to support Machine Learning and Multi-Armed Bandit (MAB):| MAB Concept | In the ADP |
|---|---|
| Arms | Different agents + different approaches |
| Context (features) | Lead feature vector served by the Lead Domain |
| Reward | Conversion, revenue, engagement (measured by the AI Agents domain) |
Computation
Features are updated by two triggers:SQS: feature-processing (near-realtime)
Triggered when a new event arrives via thelead-events SNS fan-out. Recalculates only the features affected by that specific event.
Example: a purchase_completed event arrives → recalculates monetary_total, frequency_purchases_90d, days_since_last_purchase, has_purchased. Other features (like sentiment_avg_30d) are not touched.
EventBridge Scheduler (periodic batch)
Some features change over time even without new events:| Feature | Why it changes without events |
|---|---|
recency_days | Yesterday it was 5, today it is 6. No event happened. |
days_since_last_purchase | Same — increments daily. |
campaign_ignored | Lead received a campaign 7 days ago and never engaged. |
sentiment_avg_30d | Old sentiment events fall out of the 30-day window. |