Guides
Personalization Library
Personalization Prompt Library
This library provides ready-to-use prompt patterns for common consumer personalization use cases. Each template demonstrates how to effectively combine application data with Crosshatch personal timeline data to create powerful, personalized experiences.
Shopping & Style Patterns
Personal Shopping Assistant
This pattern helps recommend products based on a user's shopping behavior.
const prompt = ` CUSTOMER INFORMATION Recently Viewed Items: ${recentlyViewed.map((item) => item.name).join(", ")} Past Purchases: ${pastPurchases.map((p) => p.productName).join(", ")} Cart Abandons: ${abandonedItems.map((a) => a.productName).join(", ")} Customer Since: ${customerSince} Based on the customer's transaction history across retailers {purchase_history} and our current seasonal inventory ${availableInventory.seasonalFocus}, recommend 3-5 items that: 1. Complement their past purchases 2. Align with styles they've shown interest in 3. Include items similar to those they've abandoned 4. Are available in our current inventory 5. Would be appropriate for the current season For each recommendation, explain briefly why it's relevant to this customer. `; const contextQueries = { purchase_history: { select: [ "originalTimestamp", "object_name", "object_style", "object_brand", "order_total", ], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "SHOPPING" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 15, }, };
Wardrobe Planner
This pattern helps suggest outfits based on weather and upcoming calendar events.
const prompt = ` USER CONTEXT Recent Purchases: ${recentPurchases.map((p) => p.itemName).join(", ")} Browsing Categories: ${browsingCategories.join(", ")} Location: ${userLocation} Current Season: ${currentSeason} Based on the user's clothing purchases across retailers {clothing_purchases} and upcoming calendar events {calendar_events}, create a personalized outfit guide that: 1. Focuses on items they've actually purchased 2. Suggests combinations they might not have considered 3. Takes into account the current weather and season 4. Proposes appropriate outfits for upcoming events 5. Includes accessories and layering options when relevant Organize recommendations by event type or day, with specific outfit details. `; const contextQueries = { clothing_purchases: { select: [ "originalTimestamp", "object_name", "object_style", "object_brand", "object_category", ], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "SHOPPING" }, { field: "object_subcategory", op: "=", value: "APPAREL" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 30, }, calendar_events: { select: [ "object_name", "object_start_time", "object_end_time", "object_location", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "google-calendar" }, { field: "event", op: "=", value: "confirmed" }, { field: "object_start_time", op: ">", value: "2024-02-24T00:00:00Z" }, ], orderBy: [{ field: "object_start_time", dir: "asc" }], limit: 10, }, };
Travel & Entertainment Patterns
Personalized Travel Planner
This pattern helps create customized travel experiences based on a user's behavior.
const prompt = ` TRAVEL INQUIRY Destination Interest: ${searchedDestination} Dates Browsed: ${browsedDates} Price Range Viewed: ${viewedPriceRange} Previous Bookings: ${previousBookings.map((b) => b.destination).join(", ")} Based on this traveler's: - Past hotel stays across travel sites {hotel_history} - Restaurant visits {dining_history} - Activity level from fitness apps {activity_data} - Upcoming calendar {calendar_events} Create a personalized travel itinerary that: 1. Suggests accommodations similar to places they've enjoyed before 2. Recommends restaurants matching their demonstrated dining preferences 3. Proposes activities appropriate for their typical activity level 4. Works around their existing calendar commitments 5. Stays within their browsed price range Provide a day-by-day breakdown with specific recommendations and reasoning. `; const contextQueries = { hotel_history: { select: [ "originalTimestamp", "object_name", "object_style", "object_city", "order_total", ], from: "personalTimeline", where: [ { field: "object_subcategory", op: "=", value: "HOTELS_ACCOMMODATIONS" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 10, }, dining_history: { select: [ "originalTimestamp", "object_name", "object_style", "object_city", "order_total", ], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "FOOD_DRINK" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 15, }, activity_data: { select: [ "originalTimestamp", "object_name", "object_duration", "object_distance", ], from: "personalTimeline", where: [ { field: "channel", op: "in", value: ["fitbit", "strava"] }, { field: "event", op: "=", value: "exercised" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 20, }, calendar_events: { select: ["object_name", "object_start_time", "object_end_time"], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "google-calendar" }, { field: "event", op: "=", value: "confirmed" }, { field: "object_start_time", op: ">", value: "2024-02-24T00:00:00Z" }, ], orderBy: [{ field: "object_start_time", dir: "asc" }], limit: 10, }, };
Music Festival Scheduler
This pattern helps prioritize performances based on a user's music preferences.
const prompt = ` FESTIVAL DETAILS Festival Name: ${festival.name} Dates: ${festival.dates} User's Saved Artists: ${savedArtists.join(", ")} Viewed Performances: ${viewedPerformances.join(", ")} LINEUP ${festivalLineup.map((a) => `- ${a.name}: ${a.genre} - ${a.stage} @ ${a.time}`).join("\n")} Based on this user's music listening history across platforms {music_history}, create a personalized festival schedule that: 1. Prioritizes artists similar to their most-played tracks and genres 2. Includes their explicitly saved artists 3. Discovers new artists aligned with their taste 4. Creates a realistic schedule considering venue locations and set times 5. Includes appropriate breaks Format as a day-by-day, hour-by-hour schedule with recommendations and alternatives. `; const contextQueries = { // Note: Apple Music integration coming in Q1 2025 // Contact Crosshatch for early access music_history: { select: [ "originalTimestamp", "object_name", "object_artist", "object_genre", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "apple-music" }, { field: "event", op: "=", value: "played" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 30, }, };
Health & Wellness Patterns
Personalized Health Dashboard
This pattern helps users understand how their lifestyle choices affect their health metrics.
const prompt = ` USER APP DATA Current Goal: ${currentGoal} Last Logged Metrics: ${lastLoggedMetrics} App Usage Frequency: ${appUsageFrequency} Self-Reported Concerns: ${selfReportedConcerns.join(", ")} Based on this user's: - Wearable activity data {activity_data} - Sleep patterns {sleep_data} - Food purchases {food_purchases} Create a personalized health insights report that: 1. Shows correlations between activities and their health metrics 2. Identifies positive patterns they should continue 3. Suggests specific adjustments that would help them reach their goal 4. Notes progress toward their stated goal 5. Provides actionable recommendations prioritized by potential impact Format as a clear, supportive analysis that empowers rather than judges. `; const contextQueries = { activity_data: { select: [ "originalTimestamp", "object_name", "object_duration", "object_distance", "object_calories", ], from: "personalTimeline", where: [ { field: "channel", op: "in", value: ["fitbit", "strava", "oura"] }, { field: "event", op: "=", value: "exercised" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 20, }, sleep_data: { select: [ "originalTimestamp", "object_duration", "object_quality", "object_deep_sleep", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "fitbit" }, { field: "event", op: "=", value: "slept" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 10, }, food_purchases: { select: ["originalTimestamp", "object_name", "object_category"], from: "personalTimeline", where: [ { field: "object_category", op: "in", value: ["FOOD_DRINK", "GROCERIES"], }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 30, }, };
Adaptive Workout Generator
This pattern helps create personalized workout plans based on recent performance and goals.
const prompt = ` FITNESS APP DATA Current Goal: ${currentGoal} Completed Workouts: ${completedWorkouts.map((w) => w.type).join(", ")} Typical Duration: ${typicalDuration} minutes Preferred Workout Days: ${preferredDays.join(", ")} Based on this user's: - Recent workout history from connected devices {workout_history} - Performance trends {performance_data} - Sleep quality {sleep_data} - Upcoming schedule {calendar_events} Create a personalized workout plan for the next 7 days that: 1. Aligns with their current fitness goal 2. Builds on their recently completed workouts 3. Adapts intensity based on recent performance data 4. Schedules rest days based on sleep patterns 5. Fits around their calendar commitments Provide specific exercises, sets, reps, and duration for each workout session. `; const contextQueries = { workout_history: { select: [ "originalTimestamp", "object_name", "object_duration", "object_distance", "object_calories", ], from: "personalTimeline", where: [ { field: "channel", op: "in", value: ["fitbit", "strava"] }, { field: "event", op: "=", value: "exercised" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 15, }, performance_data: { select: [ "originalTimestamp", "object_name", "object_duration", "object_distance", "object_pace", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "strava" }, { field: "event", op: "=", value: "exercised" }, { field: "object_name", op: "contains", value: "run" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 10, }, sleep_data: { select: ["originalTimestamp", "object_duration", "object_quality"], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "fitbit" }, { field: "event", op: "=", value: "slept" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 7, }, calendar_events: { select: ["object_name", "object_start_time", "object_end_time"], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "google-calendar" }, { field: "event", op: "=", value: "confirmed" }, { field: "object_start_time", op: ">", value: "2024-02-24T00:00:00Z" }, ], orderBy: [{ field: "object_start_time", dir: "asc" }], limit: 20, }, };
Food & Nutrition Patterns
Personalized Recipe Suggester
This pattern helps recommend recipes based on a user's food preferences.
const prompt = ` RECIPE APP DATA Saved Recipes: ${savedRecipes.map((r) => r.name).join(", ")} Recipe Search History: ${recipeSearches.join(", ")} Diet Filters: ${dietFilters.join(", ")} Meal Plan Subscription: ${mealPlanType} Based on this person's: - Recent grocery purchases {grocery_history} - Restaurant dining patterns {restaurant_history} - Weekly schedule {calendar_events} Create a personalized meal plan that: 1. Incorporates their demonstrated food preferences 2. Uses ingredients likely available based on recent purchases 3. Respects their dietary filters 4. Accounts for their schedule (quick meals on busy days) 5. Includes variety throughout the week Provide 5 dinner recipes with ingredient lists, noting which ingredients they likely already have. `; const contextQueries = { grocery_history: { select: [ "originalTimestamp", "object_name", "object_category", "order_summary", ], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "GROCERIES" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 10, }, restaurant_history: { select: ["originalTimestamp", "object_name", "object_style", "object_city"], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "FOOD_DRINK" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 15, }, calendar_events: { select: ["object_name", "object_start_time", "object_end_time"], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "google-calendar" }, { field: "event", op: "=", value: "confirmed" }, { field: "object_start_time", op: ">", value: "2024-02-24T00:00:00Z" }, ], orderBy: [{ field: "object_start_time", dir: "asc" }], limit: 10, }, };
Smart Party Planner
This pattern helps plan events with personalized recommendations.
const prompt = ` EVENT APP DATA Event Type: ${eventType} Guest Count: ${guestCount} Budget Range: ${budgetRange} Previous Events Created: ${previousEvents.map((e) => e.type).join(", ")} Based on the host's: - Past food and beverage purchases {food_purchases} - Restaurant preferences {restaurant_history} - Previous events {past_events} Create a comprehensive party plan that: 1. Suggests a menu based on demonstrated food preferences 2. Recommends beverages based on past purchases 3. Proposes entertainment aligned with previous events 4. Includes a shopping list with estimated costs 5. Provides a preparation timeline Format as a complete event plan with specific recommendations and alternatives. `; const contextQueries = { food_purchases: { select: [ "originalTimestamp", "object_name", "object_category", "order_summary", ], from: "personalTimeline", where: [ { field: "object_category", op: "in", value: ["GROCERIES", "FOOD_DRINK"], }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 20, }, restaurant_history: { select: ["originalTimestamp", "object_name", "object_style", "order_total"], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "FOOD_DRINK" }, { field: "object_subcategory", op: "=", value: "RESTAURANTS" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 15, }, past_events: { select: [ "originalTimestamp", "object_name", "object_description", "object_location", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "google-calendar" }, { field: "event", op: "=", value: "confirmed" }, { field: "object_name", op: "contains", value: "party" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 5, }, };
Communication & Productivity Patterns
Smart Home Optimizer
This pattern helps adjust home settings based on a user's patterns.
const prompt = ` SMART HOME APP DATA Connected Devices: ${connectedDevices.join(", ")} Current Settings: ${currentSettings} Automation Rules: ${automationRules.map((r) => r.name).join(", ")} Home Location: ${homeLocation} Based on the user's: - Typical daily schedule {calendar_patterns} - Device usage patterns {device_usage} - Upcoming calendar {calendar_events} Create a personalized home automation plan that: 1. Adjusts settings based on their demonstrated preferences 2. Optimizes for both comfort and energy efficiency 3. Accounts for their upcoming calendar events 4. Creates routines for different times of day 5. Suggests improvements to their existing automation rules Format as a schedule of recommended settings with specific device instructions. `; const contextQueries = { calendar_patterns: { select: ["object_name", "object_start_time", "object_day_of_week"], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "google-calendar" }, { field: "event", op: "=", value: "confirmed" }, { field: "object_is_recurring", op: "=", value: true }, ], limit: 10, }, device_usage: { select: ["originalTimestamp", "object_name", "object_category"], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "HOME_GARDEN" }, { field: "object_subcategory", op: "=", value: "HOME_APPLIANCES" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 30, }, calendar_events: { select: ["object_name", "object_start_time", "object_end_time"], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "google-calendar" }, { field: "event", op: "=", value: "confirmed" }, { field: "object_start_time", op: ">", value: "2024-02-24T00:00:00Z" }, ], orderBy: [{ field: "object_start_time", dir: "asc" }], limit: 10, }, };
Entertainment & Financial Patterns
Cross-Platform Media Recommender
This pattern helps suggest content across streaming services.
const prompt = ` STREAMING APP DATA Recently Watched: ${recentlyWatched.map((w) => w.title).join(", ")} Watchlist Items: ${watchlist.map((w) => w.title).join(", ")} Content Ratings: ${contentRatings.map((r) => r.title + ": " + r.rating).join(", ")} Subscribed Services: ${subscribedServices.join(", ")} Based on the user's: - Viewing history across platforms {viewing_history} - Music listening patterns {music_history} - Content engagement {content_engagement} Create personalized content recommendations that: 1. Work across all their available streaming services 2. Include a mix of content types they've engaged with 3. Suggest both trending items and hidden gems 4. Consider their viewing habits and preferences 5. Group recommendations by mood and category Format as a curated guide with specific titles and where to find them. `; const contextQueries = { viewing_history: { select: [ "originalTimestamp", "object_name", "object_category", "object_genre", "object_creator", ], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "ARTS_ENTERTAINMENT" }, { field: "object_subcategory", op: "in", value: ["MOVIES", "TV_VIDEO"] }, { field: "event", op: "=", value: "confirmed" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 30, }, // Note: Apple Music integration coming in Q1 2025 // Contact Crosshatch for early access music_history: { select: [ "originalTimestamp", "object_name", "object_artist", "object_genre", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "apple-music" }, { field: "event", op: "=", value: "played" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 30, }, content_engagement: { select: ["originalTimestamp", "object_name", "object_category", "event"], from: "personalTimeline", where: [ { field: "object_category", op: "=", value: "ARTS_ENTERTAINMENT" }, { field: "event", op: "=", value: "confirmed" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 20, }, };
Personal Financial Advisor
This pattern helps suggest financial strategies based on spending behavior.
const prompt = ` FINANCIAL APP DATA Account Types: ${accountTypes.join(", ")} Recent Transactions: ${recentTransactions.length} in the last 30 days Savings Goals: ${savingsGoals.map((g) => g.name).join(", ")} Budget Categories: ${budgetCategories.map((c) => c.name).join(", ")} Based on the user's: - Spending patterns {spending_history} - Regular expenses {recurring_expenses} - Upcoming bills {upcoming_bills} Create a personalized financial advisory report that: 1. Analyzes spending patterns to identify savings opportunities 2. Highlights budget categories where they're over/under spending 3. Suggests specific adjustments to help reach their goals 4. Identifies potentially unnecessary subscriptions 5. Proposes a realistic savings plan based on their actual behavior Format as a supportive financial analysis with actionable recommendations. `; const contextQueries = { spending_history: { select: [ "originalTimestamp", "object_name", "object_category", "order_total", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "plaid" }, { field: "event", op: "=", value: "purchased" }, ], orderBy: [{ field: "originalTimestamp", dir: "desc" }], limit: 50, }, recurring_expenses: { select: [ "object_name", "object_category", "order_total", "object_frequency", ], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "plaid" }, { field: "event", op: "=", value: "purchased" }, { field: "object_is_recurring", op: "=", value: true }, ], limit: 20, }, upcoming_bills: { select: ["object_name", "object_due_date", "order_total"], from: "personalTimeline", where: [ { field: "channel", op: "=", value: "plaid" }, { field: "event", op: "=", value: "bill_due" }, { field: "object_due_date", op: ">", value: "2024-02-24T00:00:00Z" }, ], orderBy: [{ field: "object_due_date", dir: "asc" }], limit: 10, }, };
Adapting These Templates
These patterns can be customized for your specific use case:
- Start with what you have: Begin with the application data you collect
- Complement with timeline data: Use Crosshatch to fill gaps in understanding
- Focus on specific use cases: Target personalization to solve concrete user problems
- Start simple: Begin with basic personalization before attempting complex scenarios
Best Practices
When implementing these personalization patterns:
- Test your queries: Use the Query API to verify your context queries return useful data
- Honor user privacy: Only query the data needed for your specific use case
- Plan for missing data: Ensure your prompts work even if certain context is unavailable
- Collect feedback: Refine your patterns based on user reactions
- Be transparent: Let users know how their data is being used to personalize experiences
Next Steps
- Learn more about Prompt Templates for effective variable usage
- Explore Context Layer Querying for advanced query techniques
- Review the AI API Reference for implementation details