August 20, 2026 · By YasKad
xai-org/x-algorithm

X For You Feed Algorithm: the published version of X's recommender

xai-org/x-algorithm · 33,414★ · 5,421 forks

Everything worth knowing about xai-org/x-algorithm: reference code for the system that retrieves, ranks, and filters posts for X’s “For You” tab.


What X For You Feed Algorithm is

X For You Feed Algorithm is xAI’s repository describing the core of X’s “For You” timeline recommender. It combines posts from followed accounts with out-of-network candidates obtained through machine-learning-based retrieval, and ranks them with Phoenix, a transformer adapted from Grok-1.

It isn’t an X client, a public recommendation API, or an instant-install program for a real timeline. The project itself clarifies that Phoenix is representative of the internal model except for scale optimizations, and that the distributed artifact is a frozen checkpoint; so the repository mainly serves to study the architecture and run the included demo.

Striking hero illustration of X's For You algorithm: a glowing neural network transformer core labeled "Phoenix" at the center, surrounded by two glowing towers of light representing the two-tower retrieval model, with data streams of social media posts flowing through a dark cyberpunk pipeline.

The origin: a new opening of X’s algorithm

GitHub dates the repository’s creation to January 19, 2026. In the early hours of January 20, the verified account @Engineering announced on X that a new algorithm based on the same Grok transformer architecture had been published, and linked this repository; the post showed 41.2 million views at retrieval time.

The relevant predecessor is twitter/the-algorithm, the earlier release of X’s recommender. That repository describes several shared services, models, and frameworks — including Home Mixer, user signals, and safety classifiers — and acknowledges it didn’t have a complete top-level build-and-test system. The 2026 change shifts the explanation toward Phoenix and a runnable retrieval-then-ranking demo.

Futuristic GitHub repository interface rendered as a holographic projection in dark mode: the name "xai-org/x-algorithm" glows in neon cyan, with floating counters showing "26,967 stars" and "4,589 forks" in bright magenta digits, and the Apache-2.0 license badge pulsing with green neon light.

Philosophy and principles

The published technical direction can be summarized as follows:

  • Learn relevance from interaction sequences, not manual content rules: the README states it removed manually engineered features and most heuristics.
  • Separate retrieval from ranking: a large corpus is first reduced through similarity; then a more expensive model predicts interaction with each candidate.
  • Predict several actions, not a single notion of relevance: favorites, replies, reposts, clicks, read time, and negative signals become a weighted score.
  • Keep each candidate’s score independent of the batch: Phoenix’s attention mask prevents candidates from attending to each other, which the project presents as a condition for consistent, cacheable scores.

How it works

The request enters Home Mixer, which hydrates the person’s context, fetches candidates, enriches them, filters, scores, selects the top-ranked ones, and applies final visibility filters.

Abstract visualization of the two-tower retrieval architecture: two towering pillars of light stand on opposite sides of a dark void, one labeled "User History" glowing in electric blue, the other "Posts" glowing in vibrant magenta, with glowing dot-product similarity lines connecting matching data points.

  1. Thunder keeps recent posts in memory and consumes creation and deletion events from Kafka to serve content from the followed network.
  2. Phoenix Retrieval uses a two-tower model: one tower encodes the person’s history and features; the other encodes posts. Dot-product similarity retrieves out-of-network candidates.
  3. Phoenix Ranking processes the context and those candidates with a transformer and estimates action probabilities. The Weighted Scorer combines the probabilities; a diversity component then dampens repeated authors.
  4. The Rust candidate-pipeline framework expresses extensions as Source, Hydrator, Filter, Scorer, Selector, and SideEffect, with parallel execution where applicable.

Dramatic representation of the Phoenix transformer model adapted from Grok-1: a glowing phoenix made of luminous neural pathways rises from a dark circuit board, its wings formed by attention weight matrices, with the attention mask visualized as a semi-transparent barrier isolating candidate posts from each other.

The May 15, 2026 update added a single inference entry point, phoenix/run_pipeline.py, demo models and corpus, a grox/ service for content understanding, additional sources, and ad mixing.

Cyberpunk pipeline visualization of the Home Mixer system: a dark metallic industrial pipeline structure processes streams of glowing post cards through distinct stages — "Hydrate," "Filter," "Score," "Select," and "Visibility" — each a neon-lit chamber.

Official and semi-official status

The repository belongs to the xai-org organization, and @Engineering’s post links directly to it as X’s open algorithm; these two pieces of evidence establish official release status, not a community fork.

No evidence was retrieved that it’s a package accepted into a marketplace, a product-supported library, or a standard specification. Its practical status is narrower: official documentation and demo of a production architecture, with data, checkpoint, and scale optimizations deliberately reduced.

The ecosystem

Verified sibling repositories

Searching xai-org’s public repositories retrieved the following organization-related projects, without that proving a technical dependency except where the README specifies it:

  • xai-org/grok-1 — 52,107 stars; this repository’s README states its transformer implementation, adapted for Phoenix, comes from there.
  • xai-org/grok-build — 24,589 stars; the organization’s coding-agent harness and TUI.
  • xai-org/grok-prompts — 4,318 stars; instructions for the Grok assistant and the @grok bot.
  • xai-org/xai-sdk-python — 536 stars; official Python SDK for the xAI API.
  • xai-org/xai-cookbook — 527 stars; practical examples for Grok’s APIs.
  • xai-org/grok-build-plugin-cc — 187 stars; a Claude Code plugin for the Grok Build CLI.
  • xai-org/plugin-marketplace — 147 stars; xAI’s official plugin marketplace.
  • xai-org/xai-proto — 142 stars; public Protocol Buffers definitions for xAI’s gRPC API.

Cyberpunk ecosystem map showing the xai-org repository family: at the center, a glowing node labeled "x-algorithm" pulses with cyan light, surrounded by, connected by luminous data streams, satellite nodes for "grok-1," "grok-build," "grok-prompts," and others, each displaying its star count in small neon digits.

Forks, ports, and extensions

The API reported 4,589 forks. The highest-starred fork retrieved was AbdelStark/x-algorithm, with 12; it keeps the same description. MaoTouHU/x-algorithm also turned up, a Chinese fork with 4 stars whose description promises a general algorithms library in Python/C++; that claim contradicts the Rust source code and the original’s specific purpose, so it shouldn’t be treated as a translation or a verified port.

No fork with retrieved documentation demonstrating it’s a maintained port, a faithful translation, or a relevant functional extension was identified. This is a limitation of the search, not a claim that no derivatives exist outside the public results consulted.

Repo numbers

Measured: August 10, 2026, GitHub API.

MetricValue
Stars26,967
Forks4,589
Real subscribers313
Primary languageRust
LicenseApache-2.0
CreatedJanuary 19, 2026
Last code pushMay 15, 2026
Metadata refreshAugust 10, 2026
GitHub releasesNone retrieved
Open issues reported by the API0

The contributors query didn’t return a rankable listing, so no “top contributors” are attributed. watchers_count mirrors the total star count in this API; that’s why subscribers_count is reported as real subscribers. open_issues_count can include open pull requests, though separate queries for issues and pull requests returned no entries at this measurement.

How to contribute

The root tree contains no CONTRIBUTING.md, CONTRIBUTING, .github/CONTRIBUTING.md, or CHANGELOG.md, and no issues or pull requests documenting an alternative policy were retrieved either. So there’s no retrievable contribution flow — branches, a request template, or an evaluation harness — for this repository. That doesn’t prevent opening a fork under Apache-2.0; it just means it shouldn’t be presented as an officially documented contribution process.

How the community received it

  • The Hacker News thread 46688173, submitted by grainier, linked the repository on January 20, 2026, and had 125 points and 65 comments. swyx called the README useful but objected that, without published weights, each feature’s actual influence remained largely invisible, describing it as a black box; that’s their assessment, not an independent audit.
  • In the same thread, nailer noted the Apache license meets the free-software definition; that’s a specific observation about the license, not a guarantee that the entire production system is available.
  • big_toast, in a later discussion, considered interaction signals — clicks, read time, and “not interested,” for example — important, and asked how they could be captured in other recommendation ecosystems. The objection points to the practical dependency on behavioral data that an external demo doesn’t have.
  • @Engineering’s official announcement also received a reply from @quasimondo asking about the real weights used when scoring a post. The source post is promotional; the reply only shows that specific question, not a consensus.

Dark holographic interface showing a Hacker News thread with the title "X For You Feed Algorithm" glowing in neon orange, with floating comment cards displaying quotes about "black box" concerns and "Apache license" observations, and a separate panel showing an X announcement from @Engineering with a "41.2M views" counter in bright cyan.

Reddit, Product Hunt, Dev.to, X, YouTube, and podcast searches were attempted. Reddit returned a 403 block and Product Hunt another 403, so no absence of coverage is inferred. The X search did retrieve the official announcement. No exact mention of the repository was retrieved on Dev.to or in the podcast search. No verifiable Hashnode review was found during this run.

X For You Feed Algorithm versus other approaches

ApproachVerifiable overlapVerifiable difference
twitter/the-algorithmBoth publish components of X’s recommender and explain the “For You” timeline.The earlier repository exposes a broad portfolio of services and models; x-algorithm presents Phoenix, a demo pipeline, and retrieval-plus-ranking with a transformer.
xai-org/grok-1Phoenix states it adapts its transformer implementation.Grok-1 is the language model’s release; Phoenix adds recommendation inputs, two-tower retrieval, and a candidate-isolation mask.

No unrelated comparators were added without retrieving documentation demonstrating a concrete technical relationship.

Quick-start guide

Installation and first run

The published runnable part is the Phoenix demo, not X’s full service. Install uv and, from phoenix/, run:

uv sync
unzip artifacts/oss-phoenix-artifacts.zip -d artifacts/
uv run run_pipeline.py --artifacts_dir artifacts/oss-phoenix-artifacts

Dark-mode terminal interface showing the Phoenix demo pipeline execution: glowing neon green text on a black background displays the commands "uv sync," "unzip artifacts," and "uv run run_pipeline.py," with holographic output floating above showing ranked post lists with probability scores for actions like "favorite," "reply," and "retweet."

The oss-phoenix-artifacts.zip file is obtained from phoenix/artifacts/ via Git LFS. The first run loads the retrieval and ranking checkpoints, uses the example history, and shows the ranked list with per-action probabilities.

Common workflows

  1. Run the full example: the command above retrieves the 200 most relevant posts from a sports corpus of about 537,000 posts and reranks them.
  2. Change the simulated history: edit phoenix/example_sequence.json; each item requires post_id, author_id, and actions.
  3. Retrieve more candidates: use --top_k_retrieval 500 before ranking.
  4. Show more results: use --top_k_display 50.
  5. Check the example models: run uv run pytest test_recsys_model.py test_recsys_retrieval_model.py.

Essential configuration

  • artifacts/oss-phoenix-artifacts/retrieval/config.json: model and hash-function parameters for retrieval.
  • artifacts/oss-phoenix-artifacts/ranker/config.json: ranker and action-head configuration.
  • example_sequence.json: synthetic interaction history feeding the demo.
  • --artifacts_dir: path to the extracted artifacts directory.
  • --top_k_retrieval and --top_k_display: retrieval depth and number of printed results.

Common pitfalls and fixes

  • This isn’t an install of X’s feed: don’t expect to connect to accounts or production; the corpus is sports-focused, covers a six-hour window, and the checkpoint is frozen.
  • Missing model files: the ZIP is managed with Git LFS and must be extracted under phoenix/artifacts/ before running the pipeline.
  • Storage cost: the retrieval and ranking embedding tables take up roughly 1.4 GB each; reserve space before downloading the artifacts.
  • The score doesn’t explain production weights: the project shows per-action probabilities and a weighted combination, but community criticism noted the real weights aren’t published.

Abstract visualization of multi-action prediction scoring: floating holographic icons represent different user actions — a heart, a speech bubble, a retweet arrow, a cursor, a clock — each connected via glowing weighted lines to a central "Weighted Scorer" module that outputs a unified ranking score.

Integrations and migration

The README doesn’t document integration with editors, CI, MCP servers, messaging, or an automated migration from twitter/the-algorithm. The verifiable integration is conceptual and code-level: Phoenix adapts xai-org/grok-1’s transformer implementation; X’s earlier project serves as an architectural predecessor, not a published migration path.

Use cases and who this repository can help

  • Recommender engineering: offers a concrete reference for studying the retrieval → ranking split, multi-action probabilities, and a composable candidate pipeline.
  • Machine learning research and teaching: the Phoenix demo lets you modify a synthetic history, vary the number of candidates, and observe probabilities over a bounded corpus, without claiming it reproduces production.
  • Teams designing product signals: the documented filters, author diversity, and negative actions allow discussing what information a recommender would need and what policies would apply before and after scoring.
  • Technical transparency audits: the code reveals structure and design decisions, but the absence of published weights and the scale reduction are explicit limits that must be kept in mind when assessing the transparency achieved.

Dramatic split-screen visualization comparing the old and new X algorithm repositories: on the left, a tangled web of services, models, and frameworks labeled "twitter/the-algorithm" glowing in dim blue tones; on the right, a streamlined pipeline showing "Phoenix Retrieval" feeding into "Phoenix Ranking" glowing in vibrant cyan and magenta.

Resources


Note: this article combines documentation and the GitHub API, an official X post, Hacker News, and a video retrieved on August 10, 2026. Metrics change over time.

Comments