Development · Web app

the-algorithm

Open-source codebase powering X's recommendation engine and timelines.

Visit github.com ↗

This repository contains the source code for the services and recommendation models powering X (formerly Twitter), including the For You timeline, Search, and notifications. It reveals how candidate tweets are sourced, scored, filtered, and ranked using graph algorithms and machine learning models. Developers and marketers use it to study social media ranking mechanics and optimize content reach.

What it's for

  • Understand the scoring mechanisms behind X's For You timeline
  • Identify algorithmic penalties and engagement boosts for content strategy
  • Study large-scale recommendation system architecture and graph processing

Features

  • Candidate sourcing pipelines for in-network and out-of-network posts
  • Light and heavy ranking machine learning models for tweet scoring
  • Visibility filtering logic for trust, safety, and spam downranking
  • PageRank-based user reputation scoring (Tweepcred)
  • GraphJet-based real-time graph traversal and candidate selection

Pricing

Open source. Free and open source under AGPL-3.0

Details

Type
Web app
Category
Development
Topic
Recommendation Systems
Open source
Yes
Platforms
Self-hosted
For
Machine learning engineers, data scientists, and social media strategists
Tags
algorithms, recommendation engine, scala, machine learning, social media, ranking

Why it was saved

  • @aidenybai, 20 January 2026: Replace github.com with repogrep.com in any repo URL to instantly ask questions of that codebase; demo shows Fast/Smart modes, semantic code search with per-query timings, cached repo detection, and cited answers with code snippets, file references and practical takeaways.

Related

  • x-algorithm

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

  • Bytez

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

  • Social SDK

    Typed TypeScript SDK for publishing, analytics, and interactions across social platforms

Updated