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
ClientContext
required
Product
required
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
ProductContext
Product-specific parameters and configuration options
list<int64>
Tweet IDs to exclude from recommendations (already seen or dismissed tweets)
Response
list<TweetRecommendation>
List of recommended tweets with scores and metadata
int64
required
Unique identifier for the recommended tweet
double
required
Recommendation score (higher is better)
list<MetricTag>
Tags for tracking and attribution
int64
User ID of the tweet author
CandidateGenerationKey
Information about how the candidate was generated (source algorithm, similarity engine)
int64
Timestamp of the most recent engagement signal used (null if not from engagement signals)
Exceptions
ValidationExceptionList
Validation errors with details reported to clients
ServerError
Server errors (details not reported to clients)
getRelatedTweetsForQueryTweet
Returns tweets related to a specific query tweet.Request
InternalId
required
Internal identifier (tweet ID or user ID) to find related content for
Product
required
Product surface making the request
ClientContext
required
Client context (userId may be None for logged-out users)
list<int64>
Tweet IDs to exclude from results
Response
list<RelatedTweet>
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
ClientContext
required
Client context
Product
required
Product surface
ProductContext
Product-specific parameters
list<int64>
Tweets to exclude
Response
list<UtegTweet>
UTEG-based tweet recommendations
int64
required
Tweet identifier
double
required
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.
map<SocialProofType, list<int64>>
required
User social proofs grouped by engagement type (likes, retweets, replies, etc.)
getTopicTweetRecommendations
Returns tweet recommendations for specific topics.Request
ClientContext
required
Client context
Product
required
Product surface
list<int64>
required
List of topic IDs to get recommendations for
ProductContext
Product-specific parameters
list<int64>
Tweets to exclude
Response
map<int64, list<TopicTweet>>
required
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