
On August 13, X published the full source code for its For You feed ranking system — not a whitepaper, not a sanitized summary. Actual Rust and Python code, Apache 2.0, at github.com/xai-org/x-algorithm. The repo hit 1,600 GitHub stars in six hours and now sits at 29,500 and climbing. This August drop is 10 to 15 times larger than January’s initial release and, for the first time, accepts pull requests from external developers. Here is what the code actually contains — and what you can do with it.
What Is in the Repo
The codebase is organized around four core components, written primarily in Rust (57%) with Python and JAX for model training:
- Home Mixer — orchestrates the entire pipeline; handles query hydration, coordinates candidate sources, enforces post-selection rules. Scoring weights live in
home-mixer/params/param.rsand are periodically synced from production. - Thunder — in-memory post store for followed accounts; sub-millisecond lookups backed by live Kafka streams.
- Phoenix — the ML ranking model; a two-tower transformer that replaced a 48-million-parameter MaskNet. Computes user-post similarity via dot product. The full training pipeline is included in
phoenix/. - Candidate Pipeline — composable framework for parallel stage execution; pulls candidates from social graph, SimClusters topic communities, and semantic similarity sources.
Also in scope: content classifiers (Grox pipeline structure), account reputation via TweepCred (a PageRank-based score from 0 to 100), ad blending, the BotMaker rule engine, and the visibility-filtering service. What is deliberately absent: Grok’s rule-violation prediction prompts and some BotMaker rules. X’s reasoning is defensible — releasing those specifics hands spammers a ready bypass guide.
What You Can Actually Run
The phoenix/ directory ships a full Cargo workspace, a pyproject.toml, a quickstart guide, and a synthetic data generator. You can train and serve a small Phoenix model end-to-end on a local machine. This is not a toy demo — it is the same architecture X runs in production, minus the scale optimizations and the production-trained weights.
Home Mixer’s param.rs is the most immediately readable part of the repo. It contains the actual scoring weights X uses to rank posts. Paired with OpenTweet’s technical analysis, which cross-referenced the weights against observed platform behavior, the numbers are specific:
| Signal | Weight | Relative to a Like |
|---|---|---|
| Author replies to a reply | +75.0 | 150× |
| Direct reply | +13.5 | 27× |
| Bookmark | +10.0 | 20× |
| Repost | +1.0 | 2× |
| Like | +0.5 | baseline |
| Mute | −74.0 | −148× |
| Report | −369.0 | catastrophic |
TweepCred below 65 caps distribution at three posts per feed cycle — effectively invisible outside your existing followers. Time decay is steep: posts lose roughly half their algorithmic visibility every six hours and approach zero after 24. There is a viral threshold: 10 replies within 15 minutes triggers cascade amplification in Phoenix.
The Shadowban Checker
Alongside the code drop, X launched “Under the Hood” — a settings page for users with 10 or more posts in the past month to download their visibility-impacting labels as a JSON file. The intended workflow: take that JSON, feed it to any LLM, and instruct the model to cross-reference it against the GitHub repo. The LLM will explain which labels are suppressing which content and why.
This is the most concrete algorithmic transparency any major social platform has offered. Whether you trust the labels is a separate question — but the mechanism is real, the JSON format is documented, and the code producing those labels is readable on GitHub.
Three Design Decisions Worth Stealing
Beyond understanding X specifically, the architecture has ideas worth applying to your own recommendation work:
Candidate isolation. During ranking, posts score independently — no cross-post attention. Each post is evaluated against the user context alone, not relative to other candidates in the batch. This makes scores cacheable and consistent, which matters when you are narrowing 500 million daily tweets down to roughly 1,500 candidates per feed refresh.
Multi-action prediction. Phoenix predicts 15+ distinct engagement probabilities — favorites, replies, reposts, bookmarks, follows, mutes, blocks, reports — and combines them via a weighted sum. Goodhart’s Law is why single-metric optimization breaks recommendation systems. X’s approach trades some interpretability for robustness against gaming any one signal.
Separated ranking and visibility. What a post scores and what actually gets shown are handled by two distinct service pipelines in the repo. Understanding that distinction explains a lot: a highly ranked post can still be suppressed, and the suppression decision lives in the visibility-filtering path, not the ranking path.
The Honest Limitations
The repo does not ship trained model weights for the production Phoenix model — only a mini model for local testing. Full reproduction requires Kafka infrastructure that is not documented here. There is also a disclaimer worth reading: the published code is “representative of the model used internally with the exception of specific scaling optimizations.” That is another way of saying the production system has diverged in ways you cannot inspect.
None of that makes this irrelevant. As TechCrunch noted, this is the first time any major social platform has opened a PR submission process for its core ranking algorithm. The architecture is the most complete public reference for global-scale recommendation engineering available. The PR door is open. That is worth something.
What to Do With It
Clone the repo. Read param.rs. Run the Phoenix quickstart. The candidate isolation pattern and multi-action prediction framework translate directly to recommendation systems outside the social media context.
If you are building on the X API: the scoring weights clarify what drives reach. Author participation in reply threads is the single highest-value signal in the system at 75× a like. Bookmarks outperform reposts by 10×. Likes barely move the needle.
If you want to contribute: X engineers review external PRs at xai-org/x-algorithm. It is probably the strangest open-source project you will ever submit a pull request to. But the infrastructure is real.













