Algo Rec Session logo

Algo Rec Session

Organization
asgard-ai-platform
algo-rec-session

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'.

Overview

Publisherasgard-ai-platform
Repositoryskills
Skill namealgo-rec-session
Stars
236
Forks
29
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by asgard-ai-platform on GitHub. Read the source before you install it.

Installation

Install the Algo Rec Session AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/asgard-ai-platform/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/algo-rec-session .claude/skills/algo-rec-session
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Algo Rec Session in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Algo Rec Session on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Algo Rec Session is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Algo Rec Session AI skill do?

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'.

Why use Algo Rec Session on TypingMind?

Because you install it once and use it with any model. Algo Rec Session is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Algo Rec Session in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/asgard-ai-platform/skills/tree/main/algo-rec-session. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Algo Rec Session?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Algo Rec Session?

As many as you like. As long as a model supports skills, you can use Algo Rec Session with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Algo Rec Session AI skill free?

Yes. It is published on GitHub by asgard-ai-platform under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇