How the engine works

Last updated 2026-09-06

The Black Grimoire is a deck-ranking engine that combines a collaborative-filtering model trained on nearly 4 million real decklists with a rule-based synergy graph that reads each commander's oracle text, a WotC Commander Bracket classifier, and Frank Karsten's land-count formula. Every suggestion the engine makes carries a stated reason rather than a bare number, and every limitation of the underlying data is documented below rather than hidden.

The corpus

3,996,039 public decklists scraped from Moxfield, Archidekt, EDHREC as of 2026-09-06. The signal is likes and views only — no tournament win/loss data exists in the corpus. That is a real limitation, not a footnote: a card can be popular without being strong in a given meta.

Collaborative filtering

Card recommendations come from matrix factorization (SVD) over the deck corpus, the same family of technique streaming services use to recommend shows. It retrains automatically after every 50,000 new decks added to the corpus.

A contextual bandit (Vowpal Wabbit) sits on top and reranks suggestions based on which cards players actually pick when offered a choice. It retrains every 6 hours.

Commander synergy graph

Each commander's oracle text is parsed into a producer/consumer graph over 16 resource types — tokens, +1/+1 counters, treasure, graveyard, and more. A card that produces a resource your commander consumes (or vice versa) scores higher, and the reason is stated in plain language rather than left as a number.

EDHREC-style lift

lift = ln(rate of a card in decks running this commander ÷ rate of that card in decks sharing the same color identity)

A lift above zero means a card shows up more often with this commander than base rate for its colors would predict — the standard way EDHREC-style synergy is measured.

WotC Commander Bracket classifier

Every build is checked against Wizards of the Coast's official Commander Bracket criteria: Game Changers (Scryfall's own flag), mass land denial, chained extra turns, and two-card infinite combos. The builder targets bracket 2 through 5 depending on the power level you ask for, and a build is rejected and rebuilt if it drifts outside the requested bracket's rules.

The table below is the exact rule set the classifier checks. Bracket 2 is the strictest: it excludes every Game Changer and any card that performs mass land denial, chains extra turns, or completes a two-card infinite combo. Bracket 3 relaxes the Game Changer limit to three cards but keeps the other three restrictions in place. Brackets 4 and 5 (cEDH) place no restriction on any of the four criteria, since both are explicitly high-power brackets under the official rules.

Bracket rules at a glance
BracketGame Changers allowedMass land denialChained extra turnsTwo-card infinite combos
20Not allowedNot allowedNot allowed
3Up to 3Not allowedNot allowedNot allowed (no early combos)
4UnlimitedAllowedAllowedAllowed
5 (cEDH)UnlimitedAllowedAllowedAllowed

Land count — Karsten's formula

lands = 31.42 + 3.13 × average mana value − 0.28 × cheap ramp/draw spells (99-card deck), MDFC land-backs credited 0.38 each

From Frank Karsten's 2022 land-count research, applied per 99-card deck. Modal double-faced land-backs count as 0.38 of a land each rather than a full one, since only one side of the card is actually a land.

A worked example: a 99-card deck with an average mana value of 2.7 and 8 cheap ramp or draw spells computes as 31.42 + 3.13 × 2.7 − 0.28 × 8 = 37.63, which rounds up to 38 lands. If that same deck runs 2 modal double-faced land-backs, they are credited at 0.38 each, for a combined credit of 0.76 — bringing the physical land count down to 37.

How suggestions are ranked, step by step

  1. Build the candidate pool: every card legal for the chosen format and commander's color identity.
  2. Score each candidate with the collaborative-filtering model, based on its similarity pattern across the deck corpus.
  3. Adjust that score with the synergy-graph pass, rewarding cards that produce or consume a resource the commander cares about.
  4. Rerank with the contextual bandit, which nudges scores toward cards players have actually picked in similar situations.
  5. Apply the bracket budget, dropping or capping any card that would push the deck past the requested Commander Bracket.
  6. Set the land count using Karsten's formula, crediting any modal double-faced lands in the final list.

Limitations, stated plainly

  • No win-rate data exists in the corpus — rankings reflect popularity (likes/views), not proven results.
  • Popularity is biased toward decks that get built and shared, which skews toward casual and semi-competitive lists.
  • A full build evaluates the entire eligible card pool against the corpus each time, so builds take 30 to 90 seconds.