
xAI Releases Open-Source Code for X's 'For You' Feed Recommendation Algorithm
Translate this article
xAI has published the core source code for the recommendation system that powers the “For You” feed on X (formerly Twitter). The open-source repository, released under an Apache 2.0 license, provides a detailed look at the architecture designed to rank and personalize content for users.
According to the technical documentation, the system generates a feed by combining two primary content sources:
1. In-Network Content: Recent posts from accounts a user follows, served via a subsystem called “Thunder.”
2. Out-of-Network Content: Posts discovered from a global corpus through an ML-based retrieval system named “Phoenix.”
Architecture and Ranking Model
The central orchestration is handled by a component called “Home Mixer.” It manages a pipeline that retrieves content from both sources, enriches it with user data, filters ineligible posts, and ranks the remainder.
A key component is the “Phoenix” ranking model, which is based on the Grok-1 transformer architecture released by xAI last year. This model is responsible for scoring posts by predicting a user’s probability of various engagements—such as liking, replying, or sharing—based on their history. The system then calculates a final weighted score from these predictions to determine the feed’s order.
Key Design Philosophy
The documentation emphasizes a move away from manual rules. “We have eliminated every single hand-engineered feature and most heuristics from the system,” it states, noting that the Grok-based model handles relevance by learning directly from user engagement sequences.
The code also reveals various filtering stages designed to remove duplicates, old posts, content from blocked accounts, and posts with muted keywords before and after the ranking process.
The release provides one of the most comprehensive public views into the inner workings of a major social platform’s recommendation engine, following a trend of transparency in algorithmic systems. Developers and researchers can now inspect the Rust and Python-based code on the public repository.
About the Author

Leo Silva
Leo Silva is an Air correspondent from Brazil.
Recent Articles
Subscribe to Newsletter
Enter your email address to register to our newsletter subscription!