The input to a user representation has two main pieces: aggregated stats we pre-compute in SQL (the model is bad at math — pre-compute what you can), and input types we layer end-of-funnel first (orders → carts → viewed items → merchants → searches → clicks). Below is what each looks like in practice for one iFood user.
Numeric summaries computed in SQL. Each user gets one row of these stats, grouped into logical columns. They double as prompt context for the model and as queryable SQL features for downstream filters.
{
"account_id": "...",
"registration_date": "2020-09-21",
"platform": "IOS",
"analysis_period": {"days": 367},
"unique_device_count": 2,
"concurrent_device_usage": true,
"devices": [
{"device_name": "Apple iPhone 14 Pro", "total_orders": 72, "total_sessions": 274}
]
}
{
"primary": {"city": "SAO JOSE", "state": "SC"},
"delivery_districts": [{"district": "Kobrasol", "district_count": 155, "district_percentage": 35.07}],
"merchant_districts": [{"merchant_district": "Centro", "merchant_district_percentage": 10.63}]
}
{
"entry_points_for_converted_sessions": [{"entry_point": "search", "count": 84}],
"filters_usage": {
"summary": {"sessions_with_filters_viewed": 179, "total_filters_clicked": 5},
"by_page": [{"page": "category_home", "top_filters_clicked": ["Ordenar"]}]
}
}
{
"shift_day_matrix": {
"orders": [{"session_shift": "Dinner", "weekday": 84, "weekend": 38}],
"conversion_pct": [{"session_shift": "Lunch", "weekday": 27.42, "weekend": 25.71}],
"avg_spend": [{"session_shift": "Dinner", "weekday": 100.20, "weekend": 115.07}]
},
"day_type_totals": {
"weekday": {"orders": 102, "total_spend": 9589.81},
"weekend": {"orders": 48, "total_spend": 4876.51}
}
}
[
{"month": "2025-08", "orders": 11, "total_spend": 755.75, "avg_order_value": 68.7, "sessions": 31, "orders_weekday": 7, "orders_weekend": 4},
{"month": "2025-09", "orders": 14, "total_spend": 1320.40, "avg_order_value": 94.3, "sessions": 42, "orders_weekday": 9, "orders_weekend": 5}
]
{
"summary": {"window_orders": 157, "avg_order_value": 95.72, "median_order_value": 80, "avg_weekly_orders": 3.02},
"payment_methods": [{"method": "CREDIT", "brand": ["MASTERCARD"], "pct": 45.86}],
"vouchers": {"usage_rate_pct": 0.70, "types_used": [{"type": "clube", "pct": 90}]},
"delivery": {"fees": {"avg_gross": 5.64, "avg_paid": 4.24}, "time_minutes": {"avg": 42.95}}
}
{
"distribution": [
{"current_status": "CONCLUDED", "count": 153, "pct": 97.45},
{"current_status": "CANCELLED", "count": 3, "pct": 1.91}
]
}
{
"categories": [{"category": "Lanches", "orders": 35, "sessions_viewed": 56, "total_views": 136}],
"recurring_merchant_interest": [
{"merchant_name": "Dingo Smash Burger", "total_views": 20, "converted": true},
{"merchant_name": "Jungle Burguer", "total_views": 5, "converted": false}
]
}
Beyond the aggregated stats, the model gets event-level text. We layer signals from closest-to-purchase down to broadest browsing — each layer drops whatever the layer above already captured, so the model never sees the same behaviour twice. Click any tag to see what that layer looks like in the prompt.
Example — one order line in the prompt2025-08-15 | Fri | Dinner [TOP] [NEW] Habib's Esfiha - Augusta 4.6 (Internal: 4.8) - [30x] Esfiha Carne: pão tradicional (R$ 5.50) - [4x] Pizza Margherita: queijo mussarela (R$ 38.00) [molho extra] Delivery: 45mins | 2.3km | Fee: 8.99→0.00 Entry Point: home_carousel [VOUCHER UNUSED] clube_5_off | CREDIT (MASTERCARD) Review: "comida deliciosa, entrega rápida" Order Rating: 5/5 | Delivery Rating: 5/5 Total: R$ 245.40 | Discount: R$ 12.00 (4.9%)
Example — abandoned cart2025-07-22 | Sun | Dinner [ABANDONED] Pizza Hut [Initiated][Viewed][Dropped] - [1x] Pizza Família (8 fatias): mussarela + calabresa (R$ 89.90) Time-to-cart: 4m20s | ETA: 50mins | Fee: 12.99 [ERR:PAYMENT]
Example — items viewed but never cartedAçaí Tradicional 500ml — Açaí da Vila (R$ 19.90) [viewed 3x, 2 sessions] Poke Bowl Salmão — Poke Box (R$ 42.00) [viewed 5x, 3 sessions] Temaki Atum — Yamato Sushi (R$ 28.00) [viewed 2x, 2 sessions]
Example — merchants visited, no item action followedFit de Fato [visited 3x, no item action] Salada Express [visited 2x, no item action] Sucos da Praça [visited 4x across 2 weeks, no item action]
Example — queries that did not convert"poke" [term, global] → no conversion "japonesa" [historic, global] → no conversion "saudável" [trend, global] → no conversion "sushi delivery" [term, global] → no conversion
Example — per-session navigation journeySession 1: Home → Restaurant Home → Search → Merchant Page → no_conversion Session 2: Push deeplink → Merchant Page → Cart → Checkout → conversion Session 3: Home → Promo Page → Merchant → Item Detail → no_conversion
Clube, VOUCHER, Dinner, anything that could be misread. Small, surgical, reused for every artifact. You’ll write yours during pre-work.