An Open-Source GuanDan AI That Remembers What You Played
DanKS is Kingsoft’s attempt to master a four-player Chinese card game using structured retrieval and PPO self-play, shipped as a complete research lineage.

What it does
DanKS is a reinforcement-learning agent for GuanDan, a partnership-based card game played with 108 cards. The repository contains a shared rules engine and the complete code for three iterative versions of the bot, culminating in a memory-aware policy trained with PPO. It also includes V3Pro, an optional inference-time layer that adds the Asset Safe Gate, equivalent-play rules, and a verified endgame search for small remaining decks.
The interesting bit Instead of treating the massive action space as a flat list, the system uses budgeted decomposition search to retrieve structured candidate plays, then scores a bounded Top-K set with an actor-critic network. V3Pro refines decisions without retraining the neural net, using exact minimax and hidden-card enumeration to tighten play when at most 16 cards remain.
Key highlights
- The repo exposes the full technical arc from V1’s NumPy selector to V3’s neural policy, making the progression readable and runnable.
- A shared pipeline covers everything from legal-action generation and structured retrieval to PPO training and checkpoint handling.
- V3 introduces card memory, candidate coverage, and team belief to the policy network.
- An online browser demo lets humans challenge the bot directly, with no local setup required.
- The underlying rules engine and all three generations are packaged as separate, installable Python modules.
Caveats
- Trained main and expert weights, private datasets, and internal evaluation reports are not distributed; the included smoke tests use randomly initialized models.
- V3Pro’s verified endgame search is limited to at most 16 remaining cards and explicitly abstains if verification is incomplete.
- The authors note this source release is not a low-latency serving package.
Verdict Worth a look if you study imperfect-information games, action-space pruning, or open-ended RL lineage. Skip it if you just want a pre-trained, turn-key card-game engine to drop into your app.
Frequently asked
- What is Calix-L/DanKS?
- DanKS is Kingsoft’s attempt to master a four-player Chinese card game using structured retrieval and PPO self-play, shipped as a complete research lineage.
- Is DanKS open source?
- Yes — Calix-L/DanKS is open source, released under the Apache-2.0 license.
- What language is DanKS written in?
- Calix-L/DanKS is primarily written in Python.
- How popular is DanKS?
- Calix-L/DanKS has 511 stars on GitHub.
- Where can I find DanKS?
- Calix-L/DanKS is on GitHub at https://github.com/Calix-L/DanKS.