← all repositories
shinkuan/Akagi

A single Rust binary that second-guesses your mahjong discards

Watches Mahjong Soul and Tenhou in real time to overlay shanten, deal-in risk, and AI-suggested discards while you play.

1k stars Rust Domain Apps
Akagi
Collecting fresh signals — velocity needs a few days of history.
star history

What it does Akagi is a single-binary desktop app (Rust + Tauri) that sits between you and your online riichi mahjong client. It intercepts game state either via a MITM proxy or a controlled Chromium browser using the Chrome DevTools Protocol, then mirrors the board to a draggable HUD showing shanten counts, wait probabilities, agari rates, per-opponent deal-in risk, and a recommended discard. A built-in neural net runs locally by default, while an optional cloud-inference layer can call a stronger hosted model with automatic fallback to the offline weights if the server lags or drops.

The interesting bit The project treats browser-game traffic as just another telemetry stream: it decodes WebSocket frames to reconstruct the mjai game state, runs inference against an embedded Rust neural network, and paints the results back over your screen with no Python runtime or external model downloads. The modest built-in bot is intentionally small—behavior-cloned weights baked into the binary—so it works out of the box, while the cloud backend offers a stronger engine for users who buy or redeem keys.

Key highlights

  • Intercepts Mahjong Soul, Tenhou, and Riichi City traffic via MITM proxy or Chromium CDP; 3-player (sanma) and 4-player tables are both supported.
  • HUD displays shanten, waits, agari/tenpai rates, per-opponent deal-in risk, and attack/defence discard suggestions in a draggable overlay.
  • Built-in pure-Rust bot runs offline with embedded weights; optional cloud inference falls back automatically to the local model on timeout or network failure.
  • Records every completed match to local history with rank charts, cumulative PT curves, and detailed stats like riichi rate and average winning turn.
  • Single-folder portable release with in-app updates; supports English, Japanese, Traditional and Simplified Chinese.

Caveats

  • The author explicitly warns this is for educational use only and that publishers may suspend accounts for violating terms of service.
  • The built-in AI is modest by design; top-tier play requires paid or redeemed cloud-inference keys.
  • Amatsuki support is listed as planned but not yet implemented.

Verdict Worth a look if you want to analyze your riichi mahjong decisions without setting up a Python environment or external engines. Skip it if you expect a grandmaster-level free bot out of the box, or if you are unwilling to risk ToS enforcement on your game account.

Frequently asked

What is shinkuan/Akagi?
Watches Mahjong Soul and Tenhou in real time to overlay shanten, deal-in risk, and AI-suggested discards while you play.
Is Akagi open source?
Yes — shinkuan/Akagi is open source, released under the Apache-2.0 license.
What language is Akagi written in?
shinkuan/Akagi is primarily written in Rust.
How popular is Akagi?
shinkuan/Akagi has 1k stars on GitHub.
Where can I find Akagi?
shinkuan/Akagi is on GitHub at https://github.com/shinkuan/Akagi.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.