X Algorithm

For You
Following
๐Ÿค–

The For You Feed Algorithm

Explore the open-source recommendation system that powers personalized content ranking on X. Built with Rust, Python/JAX, and Grok.

15K+
Lines of Code
4
Core Components
8
Interactive Tools
Grok
Powered By
โœจ
Deep Dive Digital Twin ANTIGRAVITY EDITION

The ultimate educational visualization. Explore the Phoenix Transformer layers, attention masks, and the full pipeline flow.

โšก Interactive Architecture ๐Ÿง  Neural Attention
๐Ÿš€
Viral Score Analyzer POPULAR

Analyze posts before publishing. Get your viral score, optimize content, and track history.

๐Ÿ’ฌ Analyze โš”๏ธ Compare โœจ Optimize
๐Ÿ“Š
Feed Simulator NEW

Simulate how the algorithm ranks posts. See how engagement drives position in the feed.

๐Ÿ  Feed View โž• Add Posts โš–๏ธ Weights
๐Ÿงฎ
Score Calculator

Calculate how engagement probabilities translate to ranking scores using actual weights.

๐Ÿ“Š Probability โš–๏ธ Weights ๐Ÿ“ˆ Score
๐Ÿ”„
Pipeline Visualization

Interactive exploration of every stage in the recommendation pipeline.

๐Ÿ” Retrieval ๐ŸŽฏ Ranking ๐Ÿšซ Filtering
๐ŸŽฏ
SimClusters Explorer

Understand how topic clustering affects your content distribution across niches.

๐ŸŒ Clusters ๐Ÿ‘ค User Affinity ๐Ÿ“ˆ Distribution
โฐ
Posting Time Optimizer NEW

Find the best time to post based on freshness decay and audience activity patterns.

๐Ÿ“… Schedule ๐ŸŒ Timezone ๐Ÿ“ˆ Peak Hours
๐Ÿ”ฅ
Engagement Heatmap NEW

Visualize how different engagement types affect your ranking score with interactive heatmaps.

๐Ÿ“Š Heatmap โš–๏ธ Weights ๐Ÿงฎ Calculator
โš–๏ธ
The actual scoring weights from the open-source algorithm code. These determine how each engagement type affects your ranking.
๐Ÿ’ฌ Reply ร—27.0
๐Ÿ‘ค Profile Click ร—12.0
๐Ÿ”– Bookmark ร—4.0
๐Ÿ‘ฅ Follow ร—4.0
๐Ÿ’ฌ Quote ร—2.0
๐Ÿ“ค DM Share ร—2.0
โค๏ธ Like ร—1.0
๐Ÿ” Repost ร—1.0
๐ŸŽฌ Video View ร—0.3
๐Ÿ–ผ๏ธ Image Expand ร—0.5
๐Ÿ˜ด Not Interested ร—-74.0
๐Ÿ”‡ Mute ร—-50.0
๐Ÿšซ Block ร—-150.0
โš ๏ธ Report ร—-369.0
๐Ÿ—๏ธ
The complete system architecture of X's For You feed algorithm.
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     FOR YOU FEED REQUEST                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        HOME MIXER                            โ”‚
โ”‚                   (Orchestration Layer)                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                              โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚
โ”‚   โ”‚    THUNDER    โ”‚            โ”‚    PHOENIX    โ”‚            โ”‚
โ”‚   โ”‚  In-Network   โ”‚            โ”‚ Out-of-Network โ”‚            โ”‚
โ”‚   โ”‚ Posts you     โ”‚            โ”‚  ML-based      โ”‚            โ”‚
โ”‚   โ”‚   follow      โ”‚            โ”‚   discovery    โ”‚            โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚
โ”‚          โ”‚                            โ”‚                      โ”‚
โ”‚          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                      โ”‚
โ”‚                       โ–ผ                                      โ”‚
โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚
โ”‚              โ”‚  FILTERING  โ”‚ โ†’ Spam, duplicates, blocks      โ”‚
โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                 โ”‚
โ”‚                       โ”‚                                      โ”‚
โ”‚                       โ–ผ                                      โ”‚
โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚
โ”‚              โ”‚   SCORING   โ”‚ โ†’ Grok engagement prediction    โ”‚
โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                 โ”‚
โ”‚                       โ”‚                                      โ”‚
โ”‚                       โ–ผ                                      โ”‚
โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚
โ”‚              โ”‚  SELECTION  โ”‚ โ†’ Top K by weighted score       โ”‚
โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                 โ”‚
โ”‚                                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    RANKED FEED RESPONSE                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜