Skip to main content

"People to Follow" Slates

Social networks, community forums, marketplaces, and collaborative platforms thrive on connection. Helping users discover and connect with others who share their interests, behaviors, or roles is fundamental to growth, engagement, and creating a vibrant ecosystem. A common and powerful way to facilitate this is through "People to Follow," "Suggested Connections," or "Similar Users" recommendations.

Surfacing relevant profiles for a user to connect with can spark new interactions, expand their network, expose them to new content or opportunities, and ultimately make the platform more engaging and valuable. However, identifying who is genuinely similar or relevant to a specific user is a complex task. Simply suggesting friends-of-friends or matching basic profile tags often misses the deeper signals that drive meaningful connections. Building a system to intelligently identify these affinities is a significant technical undertaking.

The Shaped Approach: Simplified User Similarity with similar_users

Building an effective user similarity engine involves navigating complex data integration, machine learning modeling, and infrastructure challenges. Shaped drastically simplifies this with its dedicated similar_users endpoint, powered by the same sophisticated models that drive personalized recommendations.

Shaped's models learn deep representations (embeddings) of your users based on their interactions, profile attributes (if provided during training), and their relationships within the platform's ecosystem. The similar_users endpoint provides direct, low-latency access to this learned understanding of user affinity.

How Shaped Streamlines Similar User Recommendations:

  • Unified Data & Model: Leverages the same connected data (interactions, user profiles, item data) and the same core model trained for personalized item ranking (rank) to understand user similarities. No need to build and maintain a separate system.
  • Automated Learning: Shaped automatically learns complex relationships and similarities between users by analyzing behavioral patterns and profile features during the model training process.
  • Dedicated similar_users API: A single, straightforward API call retrieves a list of user IDs deemed most similar to a given user_id, based on the model's deep understanding.
  • Managed Infrastructure: Shaped handles the complex model training, embedding generation, efficient similarity lookups, and low-latency API delivery.

Building a "People to Follow" Feature with Shaped

Let's illustrate using Shaped's similar_users endpoint to populate a "Who to Follow" suggestion list for a user on a social platform.

Goal: When USER_123 visits their feed or a dedicated discovery page, show them the 5 most relevant users they aren't already following.

1. Ensure Data is Connected: Assume user_interactions (likes, posts, shares, follows, profile views), user_profiles (optional but helpful: interests, location, bio), and potentially content_metadata datasets are connected to Shaped.

2. Define Your Shaped Model (YAML): A standard model definition that includes user interactions is typically sufficient. Including user profile features can help the model learn richer user representations.

model:
name: social_discovery_engine
connectors:
- type: Dataset
name: user_interactions
id: interactions
- type: Dataset # Optional but recommended
name: user_profiles
id: users
# Potentially connect item/content data if interactions relate to items
fetch:
# Define how to fetch user events (likes, follows, posts, etc.)
events: |
SELECT
user_id,
post_id AS item_id, # Map content interactions too
timestamp AS created_at,
'like' AS event_type
FROM like_events
UNION ALL
# ... include other relevant interaction types ...
users: |
SELECT
user_id,
location,
declared_interests,
Signup_date,
follower_userids,
FROM users
  • Key Point: The model learns user similarity from the patterns in the events data and potentially enriched by the users data.

3. Create the Model:

shaped create-model --file user_similarity_model.yaml

4. Monitor Training: Wait for the model social_discovery_engine to become ACTIVE.

shaped view-model --model-name social_discovery_engine

5. Fetch Similar Users (Application Backend Logic): When you need to generate suggestions for USER_123:

const { Shaped } = require('@shaped/shaped');

const shapedClient = new Shaped();
const modelName = 'social_discovery_engine';
const currentUserId = 'USER_123';
const numSuggestions = 10;
const response = await shapedClient.similarUsers({
modelName: modelName,
userId: userId,
limit: numSuggestions,

// Ensures Shaped doesn't return profiles the user already follows.
filter_predicate: "not array_has_any(follower_userids, user_id)"
});
console.log(`Found ${response.metadata.length} relevant users to suggest for ${userId}`);

Example API Response:

{
"ids":[
"user427010",
"user182094",
"user332874",
"user827918",
"user403528",
"user991002",
# ... up to the limit requested ...
]
}
  • Step C (Your Backend/Frontend): After receiving the list of similar user IDs from Shaped and performing necessary filtering (removing self, removing existing connections), use these IDs to fetch the full user profile details (name, avatar, bio, follower count, etc.) from your own user database. Then, render the "People to Follow" UI component with this information.

Conclusion: Spark Connections with Effortless User Similarity

Helping users discover meaningful connections is key to building thriving online communities and social platforms. Yet, traditional approaches to user similarity detection often require complex machine learning models and significant infrastructure overhead.

Shaped dramatically streamlines this process with the similar_users endpoint. By tapping into the deep user understanding already learned by your core Shaped models, you can retrieve highly relevant lists of similar users with a single API call. Eliminate the need for separate similarity engines, reduce development complexity, and focus on building features that foster meaningful connections between your users.

Ready to help your users build their network?

Request a demo of Shaped today to see how easy it is to power connection discovery. Or, start exploring immediately with our free trial sandbox.