Development · GitHub repo

x-algorithm

The open-source code powering the For You recommendation feed on X.

Visit github.com

This repository contains the recommendation architecture, filtering pipelines, and transformer ranking models used to generate X's For You feed. It exposes how in-network and out-of-network posts are retrieved, evaluated, safety-filtered, and scored based on predicted user engagement probabilities. Developers and researchers can study the codebase or run proof-of-concept ranker models using provided training and synthetic data scripts.

What it's for

  • Inspect the exact scoring, ranking, and filtering logic behind X's For You feed
  • Train a local proof-of-concept ranking model on custom post and interaction data
  • Analyze algorithmic weights and safety filters to understand content distribution dynamics

Features

  • Phoenix transformer-based ranking model architecture and training code
  • Candidate generation pipelines for both in-network and out-of-network content via SimClusters and Thunder
  • Safety, spam, and visibility filtering rules including botmaker and scarecrow services
  • Scoring formulas that scale predicted probabilities for actions like likes, replies, and dwell time
  • Synthetic data generation utilities to run proof-of-concept model training locally

Pricing

Open source. Free and open source under the Apache-2.0 license

Details

Type
GitHub repo
Category
Development
Topic
Recommendation Systems
Open source
Yes
Platforms
Linux, Self-hosted
For
Machine learning engineers, data scientists, and creators analyzing recommendation systems.
Tags
recommendation algorithm, machine learning, transformers, open source, ranking system, x platform

Why it was saved

  • @retardmode, 20 January 2026: The primary source for the ranking rules summarized in the tweet.
  • @ruslanjabari, 20 January 2026: Lets you inspect or train on the actual feed ranking model; author notes a toy ranker on your own data gives a decent pre-post performance prediction, better with larger training sets.
  • @weswinder, 20 January 2026: The source material the posting strategy was derived from; readable reference for the actual ranking code.
  • @aidenybai, 20 January 2026: Announcement of the repo of the algorithm powering the For You feed on X — the repo the demo queries.

Related

  • Bytez

    Unified serverless API to discover and run open and closed AI models

  • awesome-llm-apps

    Open-source collection of runnable AI agent, skill, and RAG templates

  • Any Distance Goes Open Source

    Deep-dive writeup and open-source release of the Apple Design Award–winning fitness tracker.

  • coss ui

    Modern UI component library built on top of Base UI

  • Hyperbrowser App Examples

    Open-source web apps and AI browser tools built with Hyperbrowser

  • Mole

    Open-source macOS command-line toolkit for disk cleanup, uninstallation, and system monitoring

Updated