Overview
Home Mixer is the primary orchestration service that powers the For You feed on X. It coordinates multiple subsystems to retrieve, rank, and filter posts, returning a personalized feed for each user. The service leverages the Candidate Pipeline framework to compose a multi-stage recommendation pipeline, combining both in-network content (from Thunder) and out-of-network content (from Phoenix Retrieval).Architecture
Home Mixer exposes a gRPC endpoint (ScoredPostsService) that processes feed requests through a series of pipeline stages:
Pipeline Stages
ThePhoenixCandidatePipeline implements the complete feed generation flow:
Query Hydration
Fetch user context before retrieving candidates:
- User Action Sequence: Recent engagement history (likes, replies, reposts)
- User Features: Following list, preferences, language, country
Candidate Sourcing
Retrieve candidates from multiple sources in parallel:
- Thunder: In-network posts from followed accounts
- Phoenix Retrieval: Out-of-network posts discovered via ML-based similarity search
Hydration
Enrich candidates with additional metadata:
- Core post data (text, media, timestamps)
- Author information (username, verification status)
- Video duration for video posts
- Subscription eligibility
Pre-Scoring Filters
Remove ineligible candidates:
- Duplicates and reposts of same content
- Posts older than retention threshold
- Self-posts (user’s own tweets)
- Blocked/muted authors
- Muted keywords
- Previously seen/served posts
Scoring
Apply multiple scorers sequentially:
- Phoenix Scorer: ML predictions from transformer model
- Weighted Scorer: Combine predictions into relevance score
- Author Diversity Scorer: Attenuate repeated authors
- OON Scorer: Adjust out-of-network content scores
Post-Selection Processing
Final validation and cleanup:
- Visibility filtering (spam, violence, gore detection)
- Conversation deduplication
Implementation
The pipeline is constructed using the builder pattern, assembling all components:home-mixer/candidate_pipeline/phoenix_candidate_pipeline.rs
Request Flow
When a user requests their For You feed:home-mixer/server.rs
Key Components
Sources
Two primary candidate sources run in parallel:Thunder Source
Retrieves recent posts from accounts the user follows (in-network)
Phoenix Source
ML-based retrieval of relevant posts from the global corpus (out-of-network)
Filters
Home Mixer applies extensive filtering to ensure feed quality:| Filter | Purpose |
|---|---|
DropDuplicatesFilter | Remove duplicate post IDs |
CoreDataHydrationFilter | Remove posts missing core metadata |
AgeFilter | Remove posts older than threshold |
SelfTweetFilter | Remove user’s own posts |
RetweetDeduplicationFilter | Dedupe reposts of same content |
IneligibleSubscriptionFilter | Remove paywalled content user can’t access |
PreviouslySeenPostsFilter | Remove already seen posts |
PreviouslyServedPostsFilter | Remove posts served in current session |
MutedKeywordFilter | Remove posts with muted keywords |
AuthorSocialgraphFilter | Remove blocked/muted authors |
VFFilter | Remove spam/violence/gore |
DedupConversationFilter | Deduplicate conversation threads |
Scorers
Multiple scorers combine to produce the final relevance score:Phoenix Scorer
Calls the Phoenix ranking model to get ML predictions for each engagement type (like, reply, repost, etc.)
Configuration
Key parameters controlling pipeline behavior:Performance Characteristics
The pipeline is highly optimized for low latency:
- Parallel execution: Sources and hydrators run concurrently
- Sub-millisecond lookups: Thunder provides in-memory access to recent posts
- Batch prediction: Phoenix scores all candidates in a single inference call
- Streaming responses: gRPC with Zstd compression for efficient transport
Monitoring
Home Mixer emits detailed metrics at each pipeline stage:Related Components
Candidate Pipeline
Framework that powers Home Mixer’s orchestration
Phoenix
ML component for retrieval and ranking
Thunder
In-memory post store for in-network content
Example Request
Set
in_network_only: true to disable Phoenix retrieval and only return posts from followed accounts.