recsys-pipeline-architect
Lets your agent design systems that recommend items, like in news feeds or ads. It's useful for building any system that needs to pick the best items for a user.
What it does
This tool helps build systems that pick the best items for a user, like news feeds or product recommendations. It organizes this process into clear steps.
When to use it
- ✓When building a personalized news feed.
- ✓When organizing search results.
- ✓When deciding which notifications to send.
Example of what to ask your AI
“I want to build a system that recommends videos to my users based on what they've watched before.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It breaks the task into six parts: fetching items, adding information, removing irrelevant ones, scoring them, selecting the best, and finally performing extra actions like saving.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add wshobson/agents --skill recsys-pipeline-architectOr download just the file:
curl -L https://raw.githubusercontent.com/wshobson/agents/main/plugins/machine-learning-ops/skills/recsys-pipeline-architect/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from 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:
- Clarify the use case (one round, three questions only if missing): items being ranked, input context, language/runtime
- Identify the candidate sources (usually in-network + out-of-network, but single-source also valid)
- List required hydrations — for each filter and scorer, what data does it need that the source didn't provide?
- List the filters — cheap before expensive, universal before user-specific (duplicate, self, age, block/mute, previously-served, eligibility)
- Design the scorer chain — primary ML/heuristic → combiner (multi-action with weights) → diversity → business rules
- Selector — sort descending by final score, take top K (or stratified mix)
- SideEffects — cache served IDs, emit impression events, update counters, log analytics; all fire-and-forget
- 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).
…
FAQ
Why this order of steps?
The order is designed for efficiency: fetch first, add data only if needed, remove what's not suitable before spending time scoring, and perform extra actions without delaying the response.
What does 'multi-action' mean?
Instead of a single 'relevance' score, the system can predict multiple actions (like 'watch', 'like', 'skip') and you adjust the importance of each with weights, without retraining.
Can I mix different types of systems?
Yes, the idea is that the steps are like building blocks you can combine. For example, using a simple search system to fetch candidates and then a more complex one to refine the selection.
Details
Original description by the author
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
Popularity
- GitHub stars
- 41k
- Ranking position
- #4906
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
screen-reader-testing
Has your agent test websites using screen readers to ensure they are accessible.
wshobson/agents
wcag-audit-patterns
Helps your agent audit websites for accessibility and fix issues according to WCAG guidelines.
wshobson/agents
multi-reviewer-patterns
Enables your agent to coordinate parallel code reviews, deduplicating findings and consolidating reports.
wshobson/agents
parallel-debugging
Allows the agent to debug complex issues with parallel investigations and root cause analysis.
wshobson/agents
Similar skills
pytorch-patterns
Helps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
affaan-m/ECC
evm-token-decimals
Helps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
affaan-m/ECC
knowledge-agent
Creates and queries knowledge bases using AI. It allows asking questions about past work or compiling expertise on a topic.
thedotmack/claude-mem