Back to blog
Technical

How skdul scores 100+ time slots in under a second

Maya ChenMaya ChenUpdated 8 min read

TL;DR

How skdul's five-factor algorithm ranks 100+ time slots in under a second: soonness, time-of-day, edge-of-day, day quality, and duration awareness.

When an AI agent asks "what's the best time for a 30-minute call next week?", the naive answer is a flat list of available slots. Tuesday 9:00 AM, Tuesday 9:30 AM, Tuesday 10:00 AM... here are 47 options, good luck.

That's not helpful. Agents don't browse — they need a recommendation. So we built a scoring algorithm that evaluates every available slot against five factors and returns a short, ranked list with composite scores.

The five factors

1. Soonness (up to 30 points)

All else being equal, sooner is better. A meeting that happens tomorrow keeps momentum; one that happens in three weeks lets the conversation go cold.

Soonness uses exponential decay: 30 × e^(−days / 10). A slot today earns the full 30 points. A slot 7 days out earns about 15. Two weeks out, about 7. The curve is smooth, so a slight preference for "sooner" never completely overrides a much better time later in the week.

2. Time-of-day (up to 25 points)

Not every hour is equal. The time-of-day factor uses two Gaussian peaks: a morning peak centered on 10:00 AM (worth up to 25 points) and an afternoon peak centered on 2:30 PM (worth up to 20 points). Each slot takes whichever peak it is closer to.

There is also a lunch dip: slots starting between 12:00 and 1:30 PM lose 12 points. So 10:00 AM scores 25/25, 2:30 PM scores 20/25, and 12:30 PM scores close to zero. The curves are smooth — not hard cutoffs — so a 10:30 AM slot still scores well.

3. Edge-of-day penalty (−8 points)

The very first and very last available slot of each day lose 8 points. The first slot of the day tends to collide with the morning ramp-up; the last one tends to run into the end of the day. Neither is forbidden — they're just slightly less attractive than the slots in the middle.

4. Day quality (up to 15 points)

Meetings land better mid-week. Tuesday, Wednesday, and Thursday slots earn 15 points. Monday and Friday earn 10 — Mondays are for planning, Fridays for wrapping up. Weekends earn 5.

See this in action

skdul gives you beautiful booking pages with smart availability — plus full AI agent support.

Try it free

5. Duration awareness (late-end penalty)

A 30-minute call at 4:30 PM is fine. A 90-minute workshop at 4:30 PM is not. For meetings longer than 30 minutes, every hour the meeting would run past 5:00 PM costs 5 points. Short meetings are never penalized.

Composite scoring

The factors are summed into a single composite score. The base maximum is 70 points (30 soonness + 25 time-of-day + 15 day quality); in practice the best slots in a typical two-week window land in the 60s.

When an AI agent or API caller passes guest constraints, a second layer kicks in. Hard filters (earliest hour, latest hour, days to avoid) remove slots entirely. Soft boosts add points: +10 for a preferred morning or afternoon, +8 for a preferred day.

Picking the winners isn't just "sort by score." The top three recommendations are chosen for diversity: the overall best slot first, then the best slot on a different day and in the opposite half of the day (AM vs PM), then the best slot on a third day. That way an agent can offer genuinely different options instead of 10:00, 10:30, and 11:00 on the same Tuesday. The public best-slots API returns five slots by default, with any slots beyond the first three filled in score order.

Performance

The scoring step is a single pass over the available slots — O(n), with a constant amount of arithmetic per slot. In a local benchmark of the scoring module, ranking 160 slots (ten days of half-hour slots) took well under a millisecond. The slow part of the pipeline isn't the math — it's fetching availability. We cache busy times from connected calendars and compute availability in the database before scoring ever runs.

Why this matters for agents

A flat list of 47 slots forces the agent to either pick randomly or ask the user for guidance. A scored list lets the agent book confidently: "I found the best slot — Tuesday at 10:00 AM, score 67.1. Shall I book it?"

The user glances at the recommendation, says "yes," and the meeting exists. That's the experience we're optimizing for: humans approve, agents execute. This scoring engine is exposed through our MCP server so any AI agent can use it to book the best time automatically.

Maya Chen

Maya Chen

Engineering


Keep reading

Start scheduling for free.

Get started for free
Ask AI about skdul