x-algorithm (xai-org/x-algorithm)

Searching Database…

What is this?This is the open-source code behind X's (Twitter's) 'For You' feed algorithm. It finds, scores, ranks, and filters which posts each viewer sees, blending posts from followed accounts with ML-discovered out-of-network content.
Is this a complete running application or reference code for the algorithm's components?It's the actual component source code (Thunder, Phoenix, SimClusters, visibility-filtering, home-mixer, etc.) split by function, not a single installable app — individual pipeline stages can be toggled on or off rather than you deploying the whole 'For You' feed.
Can I actually run the ranking model myself?Yes, as a proof of concept — the repo includes the training code for Phoenix (the ranking model) along with synthetic data generation, so you can run a proof-of-concept training run without needing real X user data.
Does ranking just maximize raw engagement counts?No — the weights scale each viewer's own predicted probability of actions like Like, Share, Block, or Report (and predicted values like dwell time); they don't multiply raw engagement counts, so a higher weight on Report doesn't mean one report simply cancels out hundreds of likes.
How does visibility filtering differ from ranking?Ranking (RankingScorer, VMRanker) decides the order of posts, while visibility-filtering runs separately per post and viewer to decide whether to show, drop, or hide a post behind an interstitial, based on blocks, mutes, and labels from systems like Botmaker, Scarecrow, and Agatha.
What is SimClusters?SimClusters is an additional out-of-network retrieval source that surfaces posts from accounts a viewer doesn't follow based on cluster similarity, running alongside Thunder (in-network) and Phoenix retrieval.
Does the feed apply any region-specific content rules?Yes — as of August 2026 it runs Brazil2026ElectionFilter, which removes posts from accounts reported to Brazil's Electoral Court for the 2026 election unless the viewer explicitly follows the account.
Can I see what labels are affecting my own account's visibility?The repo ships an 'Under the Hood' transparency tool that shows aggregate statistics about the labels attached to your account and posts that can limit their visibility.
Creator
xai-org
Size
7.9 MB
Stars
34.5K
Updated
CommitNov 25
Age
10mo
Commits · 90 Days