The below strategies used to take hundreds of hours, interviews, developers and costs. We provide it all with a simple API and offer the possibilities below to grow Revenue, Retention and Conversion and beat your competitors
Onairos Integration: Practical Examples
These examples demonstrate how to leverage sentiment and trait data to enhance personalization and functionality.
1. Example: Using Onairos Data for Matching
In a dating or social networking app, you can use Onairos' Traits JSON and Sentiment JSON data to create highly personalized matches. Hereโs an example of matching based on positive personality traits and compatible characteristics.
// Sample function for matching users based on personality traits
function findBestMatch(userTraits, potentialMatches) {
return potentialMatches.sort((a, b) => {
const scoreA = getCompatibilityScore(userTraits, a.traits);
const scoreB = getCompatibilityScore(userTraits, b.traits);
return scoreB - scoreA; // Higher score = better match
})[0]; // Return the best match
}
function getCompatibilityScore(userTraits, matchTraits) {
let score = 0;
for (let trait in userTraits.positive_traits) {
// Increase score if match has similar strong positive traits
if (matchTraits.positive_traits[trait] >= 8) {
score += matchTraits.positive_traits[trait];
}
}
return score;
}
// Sample usage
const userTraits = { positive_traits: { trait1: 9.5, trait2: 8.7, trait3: 9.0 } };
const potentialMatches = [
{ id: 1, traits: { positive_traits: { trait1: 8.8, trait2: 9.0, trait3: 9.1 } } },
{ id: 2, traits: { positive_traits: { trait1: 7.5, trait2: 8.9, trait3: 8.2 } } }
];
const bestMatch = findBestMatch(userTraits, potentialMatches);
console.log("Best Match:", bestMatch);
In this example:
We score each potential match based on how closely their strong traits align with the user's traits.
This approach allows the app to recommend matches with compatible personalities.
2. Example: Using Onairos Data in LLM Personalization
Incorporate Onairos' personality data into a language model to adjust responses based on the userโs characteristics. This example shows how to modify a prompt with user personality traits to provide a tailored response.
// Function to personalize LLM prompt based on user traits
function personalizeLLMPrompt(userTraits, basePrompt) {
const personalityDescription = Object.entries(userTraits.positive_traits)
.map(([trait, score]) => `${trait}: ${score}`)
.join(", ");
return `User Personality Traits: ${personalityDescription}. ${basePrompt}`;
}
// Example usage with base prompt
const userTraits = {
positive_traits: { trait1: 9.2, trait2: 8.5, trait3: 9.8 },
traits_to_improve: { trait1: 2.1, trait2: 3.4 }
};
const basePrompt = "Suggest an ideal vacation plan based on the user's preferences.";
const personalizedPrompt = personalizeLLMPrompt(userTraits, basePrompt);
console.log("Personalized LLM Prompt:", personalizedPrompt);
// Sample output for LLM prompt:
// "User Personality Traits: trait1: 9.2, trait2: 8.5, trait3: 9.8. Suggest an ideal vacation plan based on the user's preferences."
In this example:
The personalizeLLMPrompt function appends a description of the userโs personality traits to the LLM prompt.
This allows the LLM to generate responses tailored to the userโs personality.
3. Example: Using Sentiment Data in Content Recommendation
Leverage Onairosโ Sentiment JSON output to recommend content that aligns with the user's current sentiment. High sentiment scores suggest positivity, which could be used to recommend uplifting content.
recommendContent selects either positive or neutral content based on the userโs sentiment scores.
Users with high sentiment scores receive uplifting content, enhancing user experience through personalization.
4. Example: Personalized Messaging Based on Traits and Sentiments
Use a combination of traits and sentiment data to personalize messaging in a customer support scenario, tailoring responses to the user's personality and mood.
javascriptCopy code// Function to customize support message
function createSupportMessage(userTraits, sentimentScore) {
let message = "Thank you for reaching out!";
if (sentimentScore < 0.5) {
message += " We understand things might feel challenging right now.";
}
if (userTraits.positive_traits.trait1 > 8) {
message += " Given your strength in optimism, we're confident you'll overcome this.";
} else if (userTraits.traits_to_improve.trait1 < 3) {
message += " Let's work on this together!";
}
return message;
}
// Example usage
const userTraits = {
positive_traits: { trait1: 9.0 },
traits_to_improve: { trait1: 2.5 }
};
const sentimentScore = 0.4;
const supportMessage = createSupportMessage(userTraits, sentimentScore);
console.log("Support Message:", supportMessage);
In this example:
createSupportMessage generates a message that aligns with the userโs current mood and personality traits.
Users with low sentiment scores receive a more comforting message, while positive traits trigger encouraging language.
๐ฑ๏ธ
Matching based on Traits or Qualities (which you define)
Onairos response data can act as CRUCIAL user context/memory
Improve current recommendations based on
what your users have viewed throughout their
WHOLE internet history
Personalized messaging for products, basic dialogue and more!