Context Pipeline
The Context Pipeline is PriveTag’s system for understanding user needs and providing relevant recommendations.The 8 Golden Points
We capture 8 key data points that drive recommendation quality:1. Travel Type
Family, couple, solo, business, friends
2. Nationality
Cultural preferences and language
3. Interests
Activities user enjoys
4. Budget
Spending preferences
5. Age Group
Activity difficulty matching
6. Location
Current or target area
7. Weather
Real-time conditions
8. Time
Time of day relevance
Pipeline Architecture
Data Flow Example
Input: API Request
Step 1: Enrichment
The pipeline enriches the request with external data:Step 2: Ground Truth Lookup
Query historical data for similar profiles:Step 3: Scoring
Each activity is scored on multiple factors:| Factor | Weight | Safari World | Dream World | Night Market |
|---|---|---|---|---|
| Profile Match | 30% | 28/30 | 25/30 | 15/30 |
| Ground Truth | 25% | 24/25 | 20/25 | 10/25 |
| Weather Match | 20% | 18/20 | 18/20 | 12/20 |
| Time Match | 15% | 14/15 | 14/15 | 8/15 |
| Budget Match | 10% | 9/10 | 9/10 | 10/10 |
| Total | 100% | 93 | 86 | 55 |
Step 4: Output
Scoring Factors Explained
1. Profile Match (30%)
How well does the activity match user preferences?| User Attribute | Matching Logic |
|---|---|
travel_type | Family → kid-friendly activities |
interests | Direct category match |
budget | Price range alignment |
age_group | Activity difficulty level |
2. Ground Truth (25%)
Real visit data from similar users:Ground Truth Scoring: Activities that similar profiles actually visited (and verified via NFC/QR) get higher scores than those only booked.
3. Weather Match (20%)
Real-time weather appropriateness:| Condition | Indoor Activities | Outdoor Activities |
|---|---|---|
| Sunny, < 35°C | 15/20 | 20/20 |
| Sunny, > 35°C | 18/20 | 10/20 |
| Rainy | 20/20 | 5/20 |
| Overcast | 17/20 | 18/20 |
4. Time Match (15%)
Activity timing relevance:| Time Period | Best Activities |
|---|---|
| Morning (6-11) | Tours, outdoor, breakfast spots |
| Afternoon (11-17) | Theme parks, museums, malls |
| Evening (17-21) | Dinner, shows, sunset activities |
| Night (21+) | Nightlife, late dining |
5. Budget Match (10%)
Price alignment with stated budget:Context Logging
Every recommendation request creates a context log:Why Context Logging Matters
When a user later books and visits an activity: This feedback loop is what makes PriveTag’s recommendations improve over time.Customization Options
Filters
Override automatic scoring with explicit filters:Boosting
Boost specific factors for the request:Performance
| Metric | Value |
|---|---|
| Average Processing Time | < 200ms |
| Weather API Cache TTL | 15 minutes |
| Ground Truth Query Cache | 1 hour |
| Max Concurrent Requests | 1000/sec |
Best Practices
Always provide lat/lon when available
Always provide lat/lon when available
Location coordinates enable weather-aware recommendations. Without them, we default to city-level weather which may be less accurate.
Include all known user attributes
Include all known user attributes
More context = better recommendations. Even if optional, providing nationality, age_group, and budget significantly improves relevance.
Use context_log_id for bookings
Use context_log_id for bookings
Pass the log_id when booking to complete the feedback loop. This is how Ground Truth data improves over time.
Don't over-filter
Don't over-filter
Let the scoring algorithm work. Excessive filters can eliminate good options that would score highly.