asgard-ai-platform/algo-rec-hybrid
Design hybrid recommendation systems combining multiple strategies for improved accuracy. Use this skill when the user needs to overcome single-method limitations, combine collaborative and content-based filtering, or build a production recommendation pipeline — even if they say 'combine recommendation approaches', 'best recommendation architecture', or 'cold start plus personalization'.
npx skills add https://github.com/asgard-ai-platform/skills --skill algo-rec-hybrid
Hybrid recommendation combines multiple strategies (CF, content-based, knowledge-based) to overcome individual method limitations. Common architectures: weighted, switching, cascade, feature augmentation, and meta-level. Complexity varies by architecture.
Trigger conditions:
When NOT to use:
IRON LAW: Hybrid Adds Value ONLY With Complementary Strengths
Combining two systems with the SAME weakness amplifies the weakness.
CF fails on cold start + content-based fails on cold start = hybrid
STILL fails on cold start. Choose components that cover each other's gaps.
Identify available data: interaction history (for CF), item features (for content-based), contextual signals (time, device, location). Map data to method capabilities.
Gate: At least two complementary data sources available.
Weighted hybrid: Score = α × CF_score + β × CB_score. Tune weights via cross-validation.
Switching hybrid: Use CF when sufficient data exists; switch to content-based for cold start items/users.
Cascade hybrid: First stage filters (e.g., content-based), second stage ranks (e.g., CF) within filtered set.
Feature augmentation: Use one method's output as input features for another (e.g., CF embeddings as content features).
A/B test hybrid vs individual components. Measure: accuracy (NDCG, precision@K), coverage (% of catalog recommended), diversity (intra-list diversity).
Gate: Hybrid outperforms best individual component on primary metric.
Return recommendations with source attribution for explainability.
{
"recommendations": [{"item_id": "789", "score": 0.91, "sources": {"cf": 0.85, "content": 0.95}, "method": "weighted"}],
"metadata": {"architecture": "weighted", "weights": {"cf": 0.6, "content": 0.4}, "coverage": 0.78}
}
Input: New user with 2 interactions + rich item feature catalog
Expected: Switching hybrid: content-based recommendations (insufficient CF data), transitioning to CF as interactions accumulate
| Input | Expected | Why |
|-------|----------|-----|
| Completely new user + new item | Fall back to popularity | No data for either method |
| Methods disagree strongly | Depends on architecture | Weighted averages; cascade defers to second stage |
| One component returns empty | Other component takes over | Graceful degradation |
references/architecture-selection.mdreferences/ab-testing-recs.mdTake asgard-ai-platform/algo-rec-hybrid from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.