---
title: "X For You 推荐算法"
description: "X（Twitter）For You 推荐流的源码级文档：请求路径、排序模型、可见性过滤与标签链路。"
---

> Documentation Index
> Fetch the complete documentation index at: https://x-algorithm.vergego.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# X For You 推荐算法

本站解析 [xai-org/x-algorithm](https://github.com/xai-org/x-algorithm) 开源仓库，源码基线是 commit `2e2295b`（2026-11-06）。每条结论都附 `文件:行号` 源码锚点，读者可以自己核对。本站不是 xAI 官方文档。

不读代码的读者，从 [推荐系统工作原理](https://x-algorithm.vergego.ai/guide/how-it-works/) 开始。工程师从 [系统架构总览](https://x-algorithm.vergego.ai/concepts/system-architecture/) 开始。上游最近改了什么，见 [上游变化记录](https://x-algorithm.vergego.ai/changelog/)。

## 这套系统由两条路径组成

- **请求路径**：用户打开 For You 时实时运行。[home-mixer](https://x-algorithm.vergego.ai/concepts/home-mixer-orchestration/) 从多个来源取候选帖子并过滤，用 [Phoenix](https://x-algorithm.vergego.ai/concepts/phoenix-ranking/) 预测各种行为的概率，由 [vm-ranker](https://x-algorithm.vergego.ai/concepts/vm-ranker/) 加权求和排序，再经 [可见性过滤](https://x-algorithm.vergego.ai/concepts/visibility-filtering/) 检查后返回。
- **标签路径**：在后台持续运行。内容理解模型和规则给帖子、账号打标签。可见性过滤读取这些标签，决定一条帖子对某位用户是正常展示、加提示、加遮罩还是不展示。

## 白话导览（不含代码）

- [推荐系统工作原理](https://x-algorithm.vergego.ai/guide/how-it-works/)：一条帖子进入 For You 的七个步骤
- [核心组件速览](https://x-algorithm.vergego.ai/guide/the-five-components/)：每组组件做什么
- [术语速查表](https://x-algorithm.vergego.ai/guide/glossary/)：全站术语的统一定义
- [常见疑问 FAQ](https://x-algorithm.vergego.ai/guide/faq/)
- [选帖过程](https://x-algorithm.vergego.ai/guide/how-posts-are-picked/)：打分之后如何选出最终的帖子
- [运营迷思 vs 源码真相](https://x-algorithm.vergego.ai/guide/operating-myths/)
- [发帖指南](https://x-algorithm.vergego.ai/guide/posting-guide/)：从算法机制反推发帖做法
- [限流与 shadowban](https://x-algorithm.vergego.ai/guide/visibility-and-shadowban/)：哪些标签让帖子不推给非关注者
- [新号与冷启动](https://x-algorithm.vergego.ai/guide/new-account-cold-start/)
- [算法用了你的哪些数据](https://x-algorithm.vergego.ai/guide/your-data/)
- [开源版 vs 线上算法](https://x-algorithm.vergego.ai/guide/open-source-vs-production/)

## 技术文档

### 总览

- [系统架构总览](https://x-algorithm.vergego.ai/concepts/system-architecture/)：请求路径与标签路径
- [端到端数据流](https://x-algorithm.vergego.ai/concepts/end-to-end-dataflow/)：写入侧与读取侧

### 编排 · home-mixer

- [流水线框架](https://x-algorithm.vergego.ai/concepts/candidate-pipeline-framework/)
- [home-mixer 编排层](https://x-algorithm.vergego.ai/concepts/home-mixer-orchestration/)：gRPC 服务、流水线与全部候选源
- [过滤流水线](https://x-algorithm.vergego.ai/concepts/filtering-pipeline/)：21 个预打分过滤器与选后过滤器
- [选择与成型](https://x-algorithm.vergego.ai/concepts/candidate-selection/)
- [广告混排](https://x-algorithm.vergego.ai/concepts/ads-blending/)

### 候选源

- [Thunder 站内帖子库](https://x-algorithm.vergego.ai/concepts/thunder-in-network-store/)
- [Thunder Kafka 摄入](https://x-algorithm.vergego.ai/concepts/thunder-kafka-ingestion/)
- [SimClusters](https://x-algorithm.vergego.ai/concepts/simclusters/)

### 打分与重排

- [打分与排序](https://x-algorithm.vergego.ai/concepts/scoring-and-ranking/)：权重数值、作者多样性、站外降权、新作者扶持
- [vm-ranker 重排服务](https://x-algorithm.vergego.ai/concepts/vm-ranker/)

### ML · Phoenix

- [Phoenix 召回](https://x-algorithm.vergego.ai/concepts/phoenix-retrieval/)
- [Phoenix 排序](https://x-algorithm.vergego.ai/concepts/phoenix-ranking/)
- [Phoenix 训练](https://x-algorithm.vergego.ai/concepts/phoenix-training/)：损失函数、合成数据与本地训练
- [召回索引 rankall](https://x-algorithm.vergego.ai/concepts/phoenix-rankall/)
- [候选隔离注意力掩码](https://x-algorithm.vergego.ai/concepts/candidate-isolation-masking/)
- [Transformer 骨架](https://x-algorithm.vergego.ai/concepts/grok-transformer/)
- [哈希嵌入](https://x-algorithm.vergego.ai/concepts/hash-based-embeddings/)

### 内容理解

- [Grox 服务架构](https://x-algorithm.vergego.ai/concepts/grox-architecture/)
- [Grox 分类器](https://x-algorithm.vergego.ai/concepts/grox-classifiers/)
- [多模态嵌入](https://x-algorithm.vergego.ai/concepts/multimodal-embedders/)
- [媒体模型](https://x-algorithm.vergego.ai/concepts/media-models/)

### 标签与可见性

- [可见性过滤](https://x-algorithm.vergego.ai/concepts/visibility-filtering/)
- [打标签规则](https://x-algorithm.vergego.ai/concepts/labeling-rules/)：scarecrow 与 botmaker
- [账号信号](https://x-algorithm.vergego.ai/concepts/account-signals/)：agatha、bdsm、user-cred-v2
- [处置服务](https://x-algorithm.vergego.ai/concepts/enforcement/)
- [Under the Hood](https://x-algorithm.vergego.ai/concepts/under-the-hood/)：用户能看到自己的哪些标签

### 实体参考

- [CandidatePipeline 执行器](https://x-algorithm.vergego.ai/entities/candidate-pipeline/)
- [RecsysAggregatedModel（排序模型）](https://x-algorithm.vergego.ai/entities/recsys-model/)
- [RecsysTwoTowerModel（召回模型）](https://x-algorithm.vergego.ai/entities/recsys-retrieval-model/)
- [PostStore](https://x-algorithm.vergego.ai/entities/post-store/)
- [端到端推理与训练入口](https://x-algorithm.vergego.ai/entities/run-pipeline/)

## 内容来源

本站初版派生自 [cclank/x-algorithm-wiki](https://github.com/cclank/x-algorithm-wiki)，它基于 2026-05-15 的源码 `0bfc279`。2026-11-06 起，全部页面按 `2e2295b` 重新核对和改写。

Source: https://x-algorithm.vergego.ai/index.mdx
