X/Twitter just Open-sourced their new Algorithm that powers your feed.
GitHub RepoImpressions906

X/Twitter just Open-sourced their new Algorithm that powers your feed.

@githubprojectsPost Author

Project Description

View on GitHub

X Just Open-Sourced Its Feed Algorithm. Let's Look Under the Hood.

So, X (formerly Twitter) just did something pretty rare for a major social platform: they open-sourced the core algorithm that decides what you see on your "For You" timeline. It's not every day you get to peek at the code running one of the world's most influential content feeds. Whether you're curious about recommendation systems, work in machine learning, or just want to understand why your feed looks the way it does, this is a fascinating repo to explore.

The project, called x-algorithm, is now sitting on GitHub for anyone to view, fork, or audit. It's a significant move towards transparency (or at least, a step in that direction) and a great learning resource for developers.

What It Does

In simple terms, this repository contains the code that ranks and selects tweets for your main X feed. It takes a massive pool of potential tweets and runs them through a series of models and filters to surface the ~1500 posts it thinks you'll engage with most. Then, it further ranks those to populate the final "For You" timeline you actually scroll through.

It's not the entire backend service, but the core logic for scoring, filtering, and blending content from your follow graph, your interests, and popular topics.

Why It's Cool

The cool part here isn't about a shiny new API—it's about access and understanding.

  • Transparency (or a Step Towards It): You can now read the code that has been the subject of endless speculation and debate. How does it handle different content types? What signals are prioritized? The answers are now in Python, not just in blog posts.
  • A Real-World ML Case Study: This is a production-grade, large-scale recommendation system. Looking through it, you can see how they handle things like feature extraction, real-time scoring, and balancing different candidate sources (like "In-Network" vs. "Out-of-Network" tweets).
  • Auditable and Forkable: Researchers, journalists, and other developers can audit the logic for potential biases or issues. You could also theoretically fork it and adapt its concepts for your own recommendation needs (though running it at X's scale is a whole other challenge).

How to Try It

You're not going to "install" this and run your own mini-Twitter. The repository is primarily for exploration and research.

  1. Head over to the GitHub repo: https://github.com/xai-org/x-algorithm
  2. Clone it or just browse the source directly on GitHub.
  3. The main logic is in the src directory. The README.md provides a high-level overview of the pipeline stages (Candidate Sourcing, Ranking, Filtering, etc.).
  4. To really dive in, check out the model_weights README to understand how to fetch the trained models, and look at the scripts to see how the different ranking phases are structured.

Think of it less as a tool to run and more as a massive codebase to study.

Final Thoughts

This open-sourcing is a big deal, mainly for transparency and education. As a developer, it's a unique chance to learn from a system that impacts millions of users daily. The code is complex and tied to X's specific infrastructure, so don't expect to plug and play. But do expect to gain insights into how large-scale social media ranking works—the trade-offs, the complexity, and the engineering challenges.

It's a resource worth bookmarking if you're into ML, recommendations, or just the future of how our digital spaces are shaped by code.


Follow us for more open-source projects and deep dives: @githubprojects

Back to Projects
Project ID: 2566d4f1-3638-4553-8cc5-508e3c9ca236Last updated: January 20, 2026 at 06:50 AM