X Algorithm: The Feed Finally Shows Its Math
github.com/xai-org/x-algorithm | License: Apache-2.0
Open any social app after a bad week and the same question shows up fast: why this post, from that person, right now? X Algorithm matters because it answers that question with actual architecture instead of PR fog. This repo is not a toy recommender or a vague research drop. It is the production logic behind the For You feed, exposed in enough detail to show how ranking, filtering, and discovery really collide. Honestly, the striking part is not that the feed is algorithmic. Everyone knew that. The striking part is how many separate judgment systems sit behind one scroll.
The Drop: Recommendation Systems Stop Pretending
Plenty of people talk about feeds as if one giant model stares at the internet and picks winners. X Algorithm shows the opposite. The problem was never just “find engaging posts.” The harder problem is building a timeline that feels immediate, personal, safe enough, and never fully repetitive, while mixing content from people you follow with strangers you did not ask for but might actually like.
Behind that is a nasty product tension. Pure follow graphs go stale. Pure discovery feels invasive. Pure engagement optimization turns into sludge, because the easiest things to optimize are often outrage, addiction loops, and familiar creators soaking up all the distribution. Then add compliance rules, blocks, mutes, stale-post decay, subscription access, already-seen content, and moderation labels from other systems. Suddenly “ranking a feed” looks less like one feature and more like a live negotiation between relevance, safety, novelty, and business goals.
That gap drove this repo. Not transparency as branding, but transparency into the messy stack of decisions that shape attention.
The Stack: Rust Holding the Timeline Together
Under the hood, X Algorithm is primarily Rust, with surrounding services and model pipelines in a mix of Scala and Python. The core feed assembly runs through Home Mixer, candidate retrieval comes from Thunder, Phoenix, and SimClusters, and reranking uses a separate VM Ranker service with a transformer-based scoring layer.
The Sauce: One Feed, Many Judges
Instead of treating feed generation as a single ranking pass, X Algorithm splits the job into distinct systems that each own a different kind of judgment. Home Mixer orchestrates the request, pulling candidates from in-network and out-of-network sources in parallel, hydrating them with metadata, applying pre-scoring exclusions, then handing them into model scoring and reranking. That separation sounds obvious, but it is architecturally important because “can this be shown?” and “should this be high in the feed?” are not the same question.
The repo makes that explicit through visibility filtering, a parallel decision layer that governs whether a post is shown normally, hidden, or placed behind friction. That means moderation is not bolted onto ranking as a penalty term. It is its own gate, informed by labels from account quality models, media analysis, enforcement systems, and user-specific actions like blocks and mutes. Product-wise, that is a big deal. It reduces the temptation to let one objective score quietly absorb every moral and policy tradeoff.
Then there is the ranking stack itself. Phoenix predicts the probability that a viewer will take multiple actions on a post, e.g. like, reply, dwell, report. Those predictions are combined with weights, then adjusted with heuristics like repeated-author decay, new-author boosts, and out-of-network discounts. The repo even clarifies a subtle point many people get wrong: weights scale predicted probabilities, not raw engagement counts. That makes the feed less “what the crowd liked” and more “what this viewer is likely to do next.” The interesting part is not personalization alone. It is personalization with modular veto power.
The Move: Read Platforms Like Operators Do
There are at least three practical uses here, and none require shipping a social network. First, product teams can study X Algorithm as a blueprint for any ranked surface where inventory comes from multiple sources, e.g. marketplaces, creator feeds, job recommendations, even AI answer ranking. The repo shows how to separate retrieval, gating, scoring, and blending so one overloaded model does not own every product decision.
Second, trust and safety teams can use this architecture as a benchmark. The standout lesson is that policy enforcement becomes more legible when labels, filters, and ranking live in different layers. If a company runs any recommendation system, this is a strong reference for how to make moderation logic auditable without exposing every proprietary signal.
Third, founders building “AI for discovery” should pay attention to the out-of-network machinery. SimClusters and Phoenix demonstrate a strategic pattern: combine graph-based neighborhood signals with model-based intent prediction, then add reranking for diversity and repetition control. That is useful well beyond social. Music apps, shopping apps, news products, and knowledge tools all face the same problem: how much familiarity can a product preserve while still surprising the user enough to stay valuable? X Algorithm gives a serious answer.
The Aura: Attention Becomes Inspectable
Scrolling starts to feel different once people can see that a feed is assembled, not ordained. That matters on a human level. Opaque software trains learned helplessness, where weird outcomes get written off as “the algorithm” like weather. A repo like this nudges the opposite behavior. Users, regulators, creators, and competitors can point to actual components, actual weights, actual filters.
That does not make the system neutral. Far from it. But it changes the expectation from blind trust to inspectable influence. The broader shift seems bigger than X: products that shape perception will increasingly be expected to show their reasoning layers, not just their output.
The Play: Infra for Attention Markets
From a VC lens, this is not a clean 0-to-1 startup wedge. It is a public teardown of one of the highest-value ranking stacks on the internet, and that creates second-order opportunities around recommendation infrastructure, auditability, and trust tooling. TAM is broad because every feed, marketplace, media app, and AI discovery surface now competes on ranking quality, but the moat here is not code alone. The moat is execution speed, behavioral data, and the feedback loops that tune multi-objective systems in production. PMF signals are obvious, 32,764 stars on infrastructure-grade code is not tourist traffic.
Winners:
Daydream: Better recommendation primitives lower the cost of building discovery-first shopping, and that compounds because smaller teams can ship feed quality that previously required platform-scale lore.
Character.AI: More legible ranking and safety layering strengthens consumer AI feed design, especially where session depth and content diversity drive LTV.
Spotify: Discovery surfaces get sharper when graph signals, intent models, and moderation gates are treated as separate systems, which reinforces retention without materially raising CAC.
Losers:
Artifact News: Thin aggregation products lose differentiation when world-class feed architecture becomes easier to study and copy, and adaptation is hard without proprietary user loops at scale.
BuzzFeed: Editorial distribution weakens further when personalized ranking systems keep getting better at mixing familiarity, novelty, and session optimization.
Snap: Attention products with less transparent ranking logic face more pressure from users and regulators as inspectability starts looking like a product feature, not just a compliance burden.
tl;dr
X Algorithm turns the X For You feed into readable system design, not mystery. The clever bit is the split between retrieval, ranking, and independent visibility controls, which makes a giant attention machine easier to reason about. Product teams, trust and safety operators, and founders building discovery surfaces should look closely.
Stars: 32,764 | Language: Rust







