本文へスキップ
Skillpedia
機械学習41k · #6739

recsys-pipeline-architect

できること

このツールは、ニュースフィードや商品のおすすめなど、ユーザーに最適なアイテムを選ぶシステムを構築する手助けをします。この処理を分かりやすい手順に分けて整理します。

使う場面

  • ✓ユーザーごとにパーソナライズされたニュースフィードを作るとき。
  • ✓検索結果を整理するとき。
  • ✓どの通知を送るかを決めるとき。

スキルのリンク

https://github.com/wshobson/agents/blob/main/plugins/machine-learning-ops/skills/recsys-pipeline-architect/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/wshobson/agents/blob/main/plugins/machine-learning-ops/skills/recsys-pipeline-architect/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ユーザーが過去に見た動画をもとに、動画をおすすめするシステムを作りたいです。”

毎週5つの新しいスキル。1分で読めます。

仕組み

この作業を6つの部分に分けます。アイテムの取得、情報の追加、関係のないアイテムの除外、スコア付け、最適なものの選択、そして保存などの追加の処理です。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Recsys Pipeline Architect

A spec-and-scaffold skill for building composable recommendation, ranking, and feed pipelines. Encodes the six-stage pattern popularized by xAI's open-sourced For You algorithm (Apache 2.0) and applies it to any "top K for (user, context)" problem.

Overview

Most "recommendation systems" in production aren't exotic ML — they're pipelines: fetch candidates from one or more sources, enrich them with metadata, drop the ineligible, score the rest, sort and pick the top K, then fire async side effects. The pattern is universal. The scoring function and the items change; the pipeline shape doesn't.

This skill is an independent reimplementation of the pattern (MIT) — no code copied from the original.

When to Use This Skill

  • Building any system that returns "the top K items for a user/context"
  • Designing or refactoring a personalized feed (content, search results, notifications)
  • Wrapping an LLM/ML scorer in proper pipeline plumbing (sources, hydration, filters, side effects)
  • Adding multi-action prediction with tunable weights (instead of a single relevance score)
  • Building a RAG retrieval reranker (cheap retrieval → expensive rerank)
  • Designing a task prioritizer or alert triage system

The Six-Stage Framework

# Stage Job Parallel?
1 Source Fetch candidates from one or more origins Yes — multiple sources run in parallel
2 Hydrator Enrich candidates with metadata needed for filtering and scoring Yes — independent hydrators run in parallel
3 Filter Drop ineligible candidates (blocked, expired, duplicate, ineligible) Sequential — each filter sees fewer items
4 Scorer Assign each surviving candidate one or more scores Sequential — later scorers see earlier scores
5 Selector Sort by final score, return top K Single op
6 SideEffect Cache, log, emit events, update served-history Async — must never block the response

Why this exact order

  • Sources before hydration: know what candidates exist before paying to enrich
  • Hydration before filtering: many filters need metadata the source didn't provide
  • Filtering before scoring: scoring is the expensive stage — drop the ineligible first
  • Scorer chain (not single scorer): real systems compose ML scoring + diversity reranking + business rules
  • Selector after scoring: keeps scoring deterministic and cacheable
  • SideEffects last and async: side effects must never block the user response

Workflow When Invoked

Walk the user through eight steps:

  1. Clarify the use case (one round, three questions only if missing): items being ranked, input context, language/runtime
  2. Identify the candidate sources (usually in-network + out-of-network, but single-source also valid)
  3. List required hydrations — for each filter and scorer, what data does it need that the source didn't provide?
  4. List the filters — cheap before expensive, universal before user-specific (duplicate, self, age, block/mute, previously-served, eligibility)
  5. Design the scorer chain — primary ML/heuristic → combiner (multi-action with weights) → diversity → business rules
  6. Selector — sort descending by final score, take top K (or stratified mix)
  7. SideEffects — cache served IDs, emit impression events, update counters, log analytics; all fire-and-forget
  8. Generate the scaffold in the user's stack

Key Trade-offs to Surface

Never default silently on these — they are product decisions disguised as technical ones.

1. Single score vs multi-action prediction

  • Single score: train one model to predict relevance. To change behavior → retrain.
  • Multi-action: predict P(action) for many actions (P(read), P(like), P(share), P(skip), P(report)), combine with weights at serving time. To change behavior → change weights. No retraining.

The X For You algorithm uses multi-action with both positive and negative weights. Recommend multi-action when the user expects to tune frequently.

2. Candidate isolation vs joint scoring

  • Isolated: each candidate scored independently. Deterministic, cacheable.
  • Joint: candidates attend to each other during scoring (e.g., transformer over the whole batch). More expressive but non-deterministic across batches.

Default to isolation. Joint only when there's a specific reason (e.g., explicit batch-aware diversity).

…

よくある質問

なぜこの順番で手順を進めるのですか?

効率を考えた順番です。まず取得し、必要な場合のみ情報を追加します。スコア付けに時間をかける前に、適していないものを取り除きます。そして、応答を遅らせずに追加の処理を行います。

「マルチアクション」とはどういう意味ですか?

1つの「関連度」スコアだけでなく、「視聴」「いいね」「スキップ」など複数の行動を予測できます。各行動の重要度は重みで調整でき、再学習の必要はありません。

異なる種類のシステムを組み合わせることはできますか?

はい。手順はブロックのように組み合わせられるという考え方です。たとえば、簡単な検索システムで候補を取得し、より複雑なシステムで絞り込むといった使い方ができます。

詳細

作者による元の説明

Design composable recommendation, ranking, and feed pipelines using the six-stage Source→Hydrator→Filter→Scorer→Selector→SideEffect framework popularized by xAI's open-sourced X For You algorithm. Use when building any system that picks "the top K items for a (user, context)" — content feeds, search ranking, RAG rerankers, task prioritizers, notification triage, ad selection.

repo: wshobson/agents

人気

GitHubのスター
41k
ランキング
#6739
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル