Elon Musk has delivered on another open-source promise. On July 22, X (formerly Twitter) released the source code for its latest "For You" recommendation algorithm on GitHub. This is not a stripped-down architecture description but a fully executable version with the core machinery behind the timeline.
Shift to Grok Architecture, Hand-Engineered Rules Dropped
According to the GitHub repo (xai-org/x-algorithm), the May 15, 2026 update eliminates almost all hand-engineered features and traditional heuristic rules. The new core, called "Phoenix", is a Transformer model ported from xAI's open-sourced Grok-1 and fine-tuned for recommendation. It predicts the probability of a user liking, replying, retweeting, or clicking on each post based on historical interactions.
How the For You Timeline Is Built
The recommendation system is orchestrated by a coordinator named "Home Mixer." When you open the app, it pulls content from two parallel sources:
- Thunder (in-network content): Uses Kafka to ingest real-time data, quickly surfacing posts from accounts you follow.
- Phoenix Retrieval (out-of-network content): Uses a Two-Tower model with vector embeddings to search the entire platform for unfamiliar posts you might like.
Candidates go through deduplication and filtering, then Phoenix scores them for engagement probability. A special Author diversity scorer prevents a few active accounts from dominating your timeline.
The Most Generous Open-Source Package: End-to-End Pipeline + 3GB Mini Model
For AI developers and algorithm researchers, the key highlight is runability. The repo includes phoenix/run_pipeline.py, an end-to-end inference pipeline from retrieval to ranking. xAI also provides a 3GB pre-trained "mini Phoenix model" (256 dims, 4 attention heads, 2 layers) that anyone can download and test locally.
Beyond the recommendation algorithm, the open-source release includes the Grox content understanding system for spam detection and an ad insertion module. By laying bare X's most valuable commercial asset, Musk both upholds his promise of algorithm transparency and drops a bombshell on the open-source community.

