登录 注册

the-algorithm

去点 Star
内容创作与媒体工具AI 模型与开发框架开发者工具
74,059
Stars
13,258
Forks
411
Watchers
525
Open Issues
AGPL-3.0
许可证
Scala
语言
2023-03-27
创建时间
2025-09-08
最近更新

项目能做什么

X(原 Twitter)官方推荐算法的开源代码库。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# X's Recommendation Algorithm

X's Recommendation Algorithm is a set of services and jobs that are responsible for serving feeds of posts and other content across all X product surfaces (e.g. For You Timeline, Search, Explore, Notifications). For an introduction to how the algorithm works, please refer to our [engineering blog](https://blog.x.com/engineering/en_us/topics/open-source/2023/twitter-recommendation-algorithm).

## Architecture

Product surfaces at X are built on a shared set of data, models, and software frameworks. The shared components included in this repository are listed below:

| Type | Component | Description |
|------------|------------|------------|
| Data | [tweetypie](tweetypie/server/README.md) | Core service that handles the reading and writing of post data. |
|      | [unified-user-actions](unified_user_actions/README.md) | Real-time stream of user actions on X. |
|      | [user-signal-service](user-signal-service/README.md) | Centralized platform to retrieve explicit (e.g. likes, replies) and implicit (e.g. profile visits, tweet clicks) user signals. |
| Model | [SimClusters](src/scala/com/twitter/simclusters_v2/README.md) | Community detection and sparse embeddings into those communities. |
|       | [TwHIN](https://github.com/twitter/the-algorithm-ml/blob/main/projects/twhin/README.md) | Dense knowledge graph embeddings for Users and Posts. |
|       | [trust-and-safety-models](trust_and_safety_models/README.md) | Models for detecting NSFW or abusive content. |
|       | [real-graph](src/scala/com/twitter/interaction_graph/README.md) | Model to predict the likelihood of an X User interacting with another User. |
|       | [tweepcred](src/scala/com/twitter/graph/batch/job/tweepcred/README) | Page-Rank algorithm for calculating X User reputation. |
|       | [recos-injector](recos-injector/README.md) | Streaming event processor for building input streams for [GraphJet](https://github.com/twitter/GraphJet) based services. |
|       | [graph-feature-service](graph-feature-service/README.md) | Serves graph features for a directed pair of users (e.g. how many of User A's following liked posts from User B). |
|       | [topic-social-proof](topic-social-proof/README.md) | Identifies topics related to individual posts. |
|       | [representation-scorer](representation-scorer/README.md) | Compute scores between pairs of entities (Users, Posts, etc.) using embedding similarity. |
| Software framework | [navi](navi/README.md) | High performance, machine learning model serving written in Rust. |
|                    | [product-mixer](product-mixer/README.md) | Software framework for building feeds of content. |
|                    | [timelines-aggregation-framework](timelines/data_processing/ml_util/aggregation_framework/README.md) | Framework for generating aggregate features in batch or real time. |
|                    | [representation-manager](representation-manager/README.md) | Service to retrieve embeddings (i.e. SimClus
阅读完整原文

商业机会分析 AI 生成

X (Twitter) 算法规则推文优化与预检 SaaS

产品构想基于该项目开源的特征打分、互动权重(如点赞/转推/评论权重系数)、降权惩罚规则(如过度链接、拉黑率等),开发一款面向运营者的推文草稿诊断工具。
核心功能推文内容与结构特征静态评分(链接比例、多媒体加权等)、发布时间与受众交互预估、防降权预警清单、提升For You推荐概率的修改建议。
目标用户海外营销机构、个人创作者、跨境电商品牌社媒运营人员。
难度/周期中等 · 3 - 6 周 · 成本:< 3000 元(轻量 Web 服务 + 静态规则引擎开发)
收费模式免费额度 + 月度订阅制(SaaS 模式),企业团队批量账号分析方案。
竞争风险X 官方推荐算法后续在线更新导致开源代码中的规则过时;X 官方 API 成本上涨与限制风险。
依据 已验证事实(算法源码中公开了交互加权和惩罚打分逻辑)

中小型社交/社区推荐系统轻量级脚手架与咨询

产品构想提取项目中的推荐流水线架构思想(候选集生成 Candidate Generation、图打分、Heavy Ranker、重排序与去重机制),抽象出一套适用于中小社区(基于开源生态如 Go/Python 或通用组件)的开箱即用推荐框架脚手架并提供交付咨询。
核心功能候选召回流程模板、用户互动图打分算法轻量实现、多样性去重与防疲劳重排序模块、基础设施部署文档与配置脚本。
目标用户垂直社区产品负责人、独立开发者社区创建者、中小内容平台 CTO。
难度/周期高 · 2 - 3 个月 · 成本:< 10000 元(云端原型验证环境与基准测试开销)
收费模式技术咨询按工时收费、定制化交付解决方案付费、私有化部署脚手架企业授权。
竞争风险原项目代码基于 Scala 且依赖大量推特内部专有闭源基础服务,抽取和解耦难度极大;AGPL-3.0 协议限制需谨慎避免代码污染,建议纯粹重新实现架构思想。
依据 已验证事实(原项目为 Scala 编写,架构分为召回、打分和重排三层)

社交算法透明度与反垄断合规分析服务

产品构想针对欧洲数字服务法案(DSA)等算法透明度合规要求,以该算法为参考基准,为海外中小平台提供算法偏见、内容过滤与审计咨询工具箱。
核心功能开源算法特征提取机制对照表、潜在偏见及降权逻辑清单、算法透明度评估报告模板。
目标用户出海社交产品法务合规团队、数据隐私审计机构。
难度/周期中等 · 1 - 2 个月 · 成本:< 5000 元
收费模式按次出具专业审计咨询报告或企业合规顾问年费。
竞争风险目标受众较狭窄,获客周期长且对专业资质要求较高。
依据 AI推测
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
huihut/interview 中文介绍暂未生成
📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内
38,302 C++
xai-org/x-algorithm 中文介绍暂未生成
Algorithm powering the For You feed on X
34,169 Rust
kunal-kushwaha/DSA-Bootcamp-Java 中文介绍暂未生成
This repository consists of the code samples, assignments, a
24,132 Java
InterviewMap/CS-Interview-Knowledge-Map 中文介绍暂未生成
Build the best interview map. The current content includes J
18,218 -
greyireland/algorithm-pattern 中文介绍暂未生成
Algorithm Patterns — the most scientific way to practice, th
15,464 Go
egonSchiele/grokking_algorithms 中文介绍暂未生成
Code for the book Grokking Algorithms (https://www.amazon.co
13,739 JavaScript
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2023-03-27,最近推送 2025-09-08
社区活跃Star 74,059 / Fork 13,258 / Issue 525(数据支持,可自行核实)
许可证AGPL-3.0 商用需注意传染性条款
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/twitter/the-algorithm.git
cd the-algorithm
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。