Agent skill

Algo Rec Session

by asgard-ai-platform in asgard-ai-platform/skills

Implement session-based recommendation from short-term user behavior sequences without long-term profiles.

MITAuto-check passed

Install Algo Rec Session

skills CLI
$ npx skills add asgard-ai-platform/skills --skill algo-rec-session -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install asgard-ai-platform/skills algo-rec-session --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/asgard-ai-platform/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/algo-rec-session .claude/skills/algo-rec-session && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
algo-rec-session
GitHub stars
242
Token cost
~1.1k tokens
SKILL.md length
390 words
Files
4 (incl. references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

Implement session-based recommendation from short-term user behavior sequences without long-term profiles.

  • Works in 4 steps: Input Validation → Core Algorithm → Verification → …
  • The user needs to recommend in anonymous sessions
  • SKILL.md covers Overview, When to Use, Algorithm and Output Format, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Algo Rec Session is an agent skill from asgard-ai-platform/skills. Implement session-based recommendation from short-term user behavior sequences without long-term profiles. Use this skill when the user needs to recommend in anonymous sessions, predict next click from browsing sequence, or build recommendations for non-logged-in users — even if they say 'what should they click next', 'anonymous user recommendations', or 'browsing sequence prediction'.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `examples/sample_scenario.md`, `references/gru4rec.md` and `references/session-splitting.md`).

The repository describes itself as: 301 open-source coding agent skills across 22 domains — methodology, judgment & gotchas packaged as Claude Agent Skills for the Asgard AI Platform. The licence is MIT.

When your agent uses it

  • The user needs to recommend in anonymous sessions
  • Predict next click from browsing sequence
  • Build recommendations for non-logged-in users — even if they say what should they click next
  • Anonymous user recommendations

Example prompts

  • “what should they click next”
  • “anonymous user recommendations”
  • “browsing sequence prediction”
  • “/algo-rec-session”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Input Validation
  2. Core Algorithm
  3. Verification
  4. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 4e7f4f8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Algo Rec Session loads about 1.1k tokens when it runs, and up to ~5.7k if it reads all its reference files. Until then it costs about 101 tokens; SKILL.md has 390 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from asgard-ai-platform/skills at commit 4e7f4f8, republished under its MIT licence (© asgard-ai-platform). 390 words, ~1,053 tokens.

Download SKILL.mdSave it as .claude/skills/algo-rec-session/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
algo-rec-session
description
Implement session-based recommendation from short-term user behavior sequences without long-term profiles. Use this skill when the user needs to recommend in anonymous sessions, predict next click from browsing sequence, or build recommendations for non-logged-in users — even if they say 'what should they click next', 'anonymous user recommendations', or 'browsing sequence prediction'.
metadata.category
WP-36 推薦系統
metadata.tags
recommendation, session-based, sequential, real-time

Session-Based Recommendation

Overview

Session-based recommendation predicts the next item a user will interact with based on their current session's click/view sequence, without relying on long-term user profiles. Uses Markov chains, association rules, or neural approaches (GRU4Rec). Operates in real-time with O(sequence_length) inference.

When to Use

Trigger conditions:

  • Anonymous users (no login, no long-term profile)
  • Short browsing sessions where recency matters most
  • Real-time "next item" prediction during active sessions

When NOT to use:

  • When rich user history is available (use CF or content-based for better personalization)
  • When sessions are extremely short (1-2 clicks) — insufficient signal

Algorithm

IRON LAW: First Few Clicks Are Disproportionately Important
Session-based methods operate WITHOUT long-term profiles. Intent must
be inferred from SHORT sequences. The first 2-3 clicks establish the
session's intent — misreading early signals derails the entire session.
Phase 1: Input Validation

Parse clickstream into sessions (by session ID or timeout-based splitting, typically 30min inactivity). Filter sessions below minimum length (3+ events). Gate: Sessions parsed, minimum length threshold applied.

Phase 2: Core Algorithm

Markov Chain approach:

  1. Build transition matrix from item-to-item sequences across all sessions
  2. For current session [A, B, C], predict next item from P(next | C) or higher-order P(next | B, C)

Association Rules approach:

  1. Mine frequent item sequences (sequential pattern mining)
  2. Match current session suffix against known patterns
  3. Recommend items that frequently follow the matched pattern
Phase 3: Verification

Evaluate with leave-one-out: hide last item in each session, predict, check hit rate and MRR (Mean Reciprocal Rank). Gate: Hit@20 significantly above random baseline.

Phase 4: Output

Return ranked next-item predictions with confidence scores.

Output Format

json
{
  "predictions": [{"item_id": "789", "score": 0.65, "based_on": "last_3_clicks"}],
  "session": {"length": 5, "items_viewed": ["a", "b", "c", "d", "e"]},
  "metadata": {"method": "markov_order2", "hit_rate_at_20": 0.35}
}

Examples

Show full SKILL.md (161 more words)Show less
Sample I/O

Input: Session: [shoes_page, running_shoes, nike_air_max] Expected: Recommend: nike_air_zoom (0.72), adidas_ultraboost (0.58), shoe_size_guide (0.41)

Edge Cases
InputExpectedWhy
Session length = 1Popularity fallbackSingle click insufficient for sequence pattern
Repeated item viewsWeight recency, not countUser may be comparing, not broadening
Session intent shiftAdapt to latest clicksUser changed their goal mid-session

Gotchas

  • Session definition matters: 30-minute timeout is conventional but arbitrary. E-commerce may need shorter (15min); research browsing may need longer (60min).
  • Position bias: Users click top results more. Session data reflects UI position, not just preference. Correct for position bias.
  • Repeat recommendations: Users often revisit items. Distinguish "recommend something new" from "remind of previously viewed."
  • Cold start for new items: Items with zero prior session appearances can't be predicted by transition matrices. Mix in feature-based candidates.
  • Computational efficiency: For real-time inference, pre-compute transition probabilities. Recomputing per-request at scale is too slow.

References

  • For GRU4Rec neural session model, see references/gru4rec.md
  • For session splitting heuristics, see references/session-splitting.md

© asgard-ai-platform, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in algo-rec-session of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_scenario.md
  • references/gru4rec.md
  • references/session-splitting.md

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Algo Rec Session next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Algo Rec Session compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Algo Rec Session this skillasgard-ai-platform/skills242—~1.1kAutomated safety check: PassMIT
Implementsickn33/agentic-awesome-skills47k5 repos~306Automated safety check: PassMIT
Shortsickn33/agentic-awesome-skills47k1 repos~281Automated safety check: PassMIT
Implementcodewhale-hq/Codewhale41k—~190Automated safety check: PassMIT
Hybrid Search Implementationwshobson/agents40k9 repos~497Automated safety check: PassMIT
Incremental Implementationaddyosmani/agent-skills105k1 repos~2.3kAutomated safety check: PassMIT

Similar skills

  • Implement

    sickn33/agentic-awesome-skills

    Implement a piece of work based on a PRD or set of issues. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 5 repos~306 tokens
    Product & Project ManagementAuto-check passed
  • Short

    sickn33/agentic-awesome-skills

    Rewrite the previous response more briefly while preserving the substance.

    47k GitHub starsUsed in 1 repo~281 tokens
    Auto-check passed
  • Implement

    codewhale-hq/Codewhale

    Carry an authorized, defined request or approved plan through scoped edits and proportionate verification.

    41k GitHub stars~190 tokensUpdated today
    Auto-check passed
  • Shows how to run vector and keyword search side by side and merge their results, so retrieval catches both meaning and exact terms in RAG and search systems.

    40k GitHub starsUsed in 9 repos~497 tokens
    AI & LLM EngineeringAuto-check passed
  • Incremental Implementation

    addyosmani/agent-skills

    Delivers a change in thin vertical slices, each implemented, tested, verified and committed before the next, using vertical, contract-first or risk-first slicing.

    105k GitHub starsUsed in 1 repo~2.3k tokens
    Agent WorkflowsAuto-check passed
  • Implement

    bestofjs/bestofjs

    Implement a piece of work based on a spec or set of tickets.

    3.1k GitHub starsUsed in 18 repos~109 tokens
    Auto-check passed

More from asgard-ai-platform/skills

All 207 skills in this repo
  • Algo Ecom Bm25

    asgard-ai-platform/skills

    Implement BM25 ranking function for e-commerce product search relevance scoring.

    242 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Mfg Cpk

    asgard-ai-platform/skills

    Calculate Cpk process capability index to assess whether a process meets specification requirements.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Price Elasticity

    asgard-ai-platform/skills

    Calculate price elasticity of demand to quantify how price changes affect sales volume.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Bayesian

    asgard-ai-platform/skills

    Apply Bayesian averaging to rank items by combining observed ratings with prior expectations.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Elo

    asgard-ai-platform/skills

    Implement Elo rating system to rank items or players from pairwise comparison outcomes.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Wilson

    asgard-ai-platform/skills

    Calculate Wilson Score confidence intervals for ranking items by positive proportion with sample size correction.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed

Questions about Algo Rec Session

What does Algo Rec Session do?

Implement session-based recommendation from short-term user behavior sequences without long-term profiles. Algo Rec Session is an agent skill from asgard-ai-platform/skills. Implement session-based recommendation from short-term user behavior sequences without long-term profiles.

When should I use Algo Rec Session?

Algo Rec Session fits situations like: the user needs to recommend in anonymous sessions; predict next click from browsing sequence; build recommendations for non-logged-in users — even if they say what should they click next; anonymous user recommendations.

How do I install Algo Rec Session in Claude Code?

Run `npx skills add asgard-ai-platform/skills --skill algo-rec-session -a claude-code`. Or copy the skill folder (algo-rec-session in asgard-ai-platform/skills) into .claude/skills/algo-rec-session in your project. Claude Code loads it when a task matches its description.

How do I install Algo Rec Session in Codex?

Run `npx skills add asgard-ai-platform/skills --skill algo-rec-session -a codex`. Or copy the skill folder (algo-rec-session in asgard-ai-platform/skills) into .agents/skills/algo-rec-session in your project. Codex loads it when a task matches its description.

Can I use Algo Rec Session in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add asgard-ai-platform/skills --skill algo-rec-session -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/algo-rec-session, .gemini/skills/algo-rec-session, .github/skills/algo-rec-session and .opencode/skills/algo-rec-session in your project.

What does Algo Rec Session need to run?

SKILL.md names no scripts, command-line tools or credentials: Algo Rec Session is instructions for the agent only.

Does Algo Rec Session access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Algo Rec Session safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Algo Rec Session use?

Algo Rec Session is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Algo Rec Session use?

About 1.1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.6k tokens, read only when the agent opens those files.

What are the alternatives to Algo Rec Session?

Skills that share tags, products or a category with Algo Rec Session: Implement (sickn33/agentic-awesome-skills, 47k stars), Short (sickn33/agentic-awesome-skills, 47k stars), Implement (codewhale-hq/Codewhale, 41k stars) and Hybrid Search Implementation (wshobson/agents, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Algo Rec Session?

asgard-ai-platform (a GitHub organization) maintains it in asgard-ai-platform/skills, which has 242 GitHub stars. The repository holds 207 skills in this directory. The repository was last updated on June 6, 2026.

Source: asgard-ai-platform/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.