Overview
CR-Mixer is a candidate generation service that speeds up iteration and development of candidate generation and light ranking. It acts as a lightweight coordinating layer that delegates candidate generation tasks to underlying compute services. The service provides:- Centralized platform for fetching and mixing candidate sources
- Light ranking layer for candidates
- Common filtering and deduplication
- Feature switch management and version control
- Performance optimization and caching
Service Definition
CR Mixer is defined incr-mixer/thrift/src/main/thrift/cr_mixer.thrift
getTweetRecommendations
Returns personalized tweet recommendations for a user.Request
Client context containing user identification and device information
User ID requesting recommendations (optional for logged-out users)
Guest ID for logged-out users
Application identifier
User’s country code
User’s language preference
Product surface requesting recommendations. Enum values:
Home(1) - Home timelineNotifications(2) - Notification recommendationsEmail(3) - Email recommendationsMoreTweetsModule(4) - Related tweets moduleImmersiveMediaViewer(5) - Media viewerVideoCarousel(6) - Video recommendationsExploreTopics(7) - Topic explorationAds(8) - Ads recommendationsHomeRealTime(9) - Real-time home tabTopicLandingPage(10) - Topic pages
Product-specific parameters and configuration options
Tweet IDs to exclude from recommendations (already seen or dismissed tweets)
Response
List of recommended tweets with scores and metadata
Unique identifier for the recommended tweet
Recommendation score (higher is better)
Tags for tracking and attribution
User ID of the tweet author
Information about how the candidate was generated (source algorithm, similarity engine)
Timestamp of the most recent engagement signal used (null if not from engagement signals)
Exceptions
Validation errors with details reported to clients
Server errors (details not reported to clients)
getRelatedTweetsForQueryTweet
Returns tweets related to a specific query tweet.Request
Internal identifier (tweet ID or user ID) to find related content for
Product surface making the request
Client context (userId may be None for logged-out users)
Tweet IDs to exclude from results
Response
getRelatedTweetsForQueryAuthor
Returns tweets related to a specific author’s content. Uses the same request/response structure asgetRelatedTweetsForQueryTweet.
getUtegTweetRecommendations
Returns tweet recommendations based on User Tweet Entity Graph (UTEG) engagement signals.Request
Client context
Product surface
Product-specific parameters
Tweets to exclude
Response
UTEG-based tweet recommendations
Tweet identifier
Sum of weights of seed users who engaged with the tweet. If a user engaged multiple times (e.g., liked and retweeted), their weight is counted for each engagement.
User social proofs grouped by engagement type (likes, retweets, replies, etc.)
getTopicTweetRecommendations
Returns tweet recommendations for specific topics.Request
Client context
Product surface
List of topic IDs to get recommendations for
Product-specific parameters
Tweets to exclude
Response
getFrsBasedTweetRecommendations
Returns tweet recommendations based on Follow Recommendations Service (FRS) suggestions - tweets from accounts the user may be interested in following. See Thrift Definitions for complete type definitions.Related APIs
- Home Mixer API - Main consumer of CR Mixer
- Follow Recommendations Service - Account recommendations
- Thrift Definitions - Complete API type definitions