Rust Windows Real-time LLM + Agent

HearthCoach

Real-Time AI Decision Support for Hearthstone Battlegrounds

一个从本地游戏日志实时重建局面,并融合 LLM 长程规划与 Rust 高频战术决策的酒馆战棋辅助系统。

HearthCoach running as an in-game decision overlay during a Battlegrounds match
Overview

让 AI 真正参与一局实时战棋,而不只是赛后分析

HearthCoach 持续读取 Hearthstone 的本地日志,恢复回合、金币、酒馆等级、手牌、棋盘、商店、对手与 Choice 等状态; 再将低频的战略规划与高频的局面评分拆开,使复杂推理与实时响应能够同时存在。

2-speed LLM slow planner + Rust fast agent
Local-first Power.log / HDT facts / local runtime
v0.5.0.7 Current Windows release in this repository
No injection No auto-clicking or game-process control
System Architecture

From raw game logs to grounded real-time decisions

事实、战略与执行建议分层:HDT/HearthDb 提供卡牌事实,LLM 负责长程战略,Rust 负责校验与实时评分。

HearthCoach system architecture: log parsing, snapshots, LLM planning and a real-time decision engine
01

Grounded facts

通过 Power.log、HearthDb、HearthMirror 与 CardDefs 获取实时状态和当前卡池信息,不让语言模型自行“猜卡牌事实”。

02

Slow strategy

LLM 低频生成可玩阵容、阶段 Watchlist、RoundPlan、饰品规划,并负责可解释的 AI 教练对话。

03

Fast tactics

商店变化时由 Rust 直接结合 Snapshot + RoundPlan + Watchlist 评分 Buy、Play、Upgrade、Refresh、Freeze 等动作。

Two-Speed Agent

把“想得深”和“反应快”拆成两个时间尺度

如果每次刷新商店都调用一次大模型,延迟和成本会让实时辅助失去意义。HearthCoach 因此只让 LLM 在关键节点做慢规划, 把当前回合的目标和关注卡表交给 Rust 快速代理持续执行。

Snapshot+RoundPlan+Watchlist→TacticalPlan
SLOW · LLM

Strategic Planner

  • 可玩阵容与转型方向
  • 前 / 中 / 后期 Watchlist
  • RoundPlan 与饰品需求
  • 用户对话与目标修正
FAST · RUST

Tactical Agent

  • Buy / Play / Sell → Buy
  • Upgrade / Refresh / Freeze
  • 实时候选动作评分
  • 低延迟 Overlay 推荐
Live Experience

一个系统,两种交互界面

游戏内 Overlay 负责即时提示,Control Center 负责配置、诊断、历史、Agent 轨迹和 AI 对话。

What is implemented

不是概念 Demo,而是一套完整的 Windows 工具链

◌

Live state reconstruction

增量解析 Power.log / Choice logs,维护实体状态并投影为可供 Agent 使用的 Snapshot。

◇

HDT grounded knowledge

利用 HearthDb、HearthMirror 与 CardDefs 获取卡牌属性、当前卡池和本局可用种族。

↯

Rust tactical scoring

在商店 revision 变化时快速生成动作候选,无需为每个小决策等待一次模型调用。

◎

Native Win32 overlay

游戏外独立绘制 Overlay,可展示卡牌图片、推荐框、行动摘要与当前小目标。

⌘

Desktop control center

模型配置、环境自检、Power.log 切换、对局记录、Agent 轨迹、API 调用与预算管理集中在一个界面。

✓

One-click bootstrap

Windows Launcher 可检查 Rust、MSVC、HDT 与日志配置,并完成 release 构建与启动。

Implementation

Rust 2021 · Native Windows · Static Web UI

核心代码按状态恢复、模型编排、战术 Agent、Overlay 与桌面控制中心拆分,并带有 parser/runtime/agent/card catalog 等测试。

Rust 2021windows-sysserdetokioreqwesttiny_httpimage
src/
├── harness/      # log → entities → snapshot
├── demo/
│   ├── deepseek.rs
│   ├── agent.rs
│   ├── overlay.rs
│   └── control_center.rs
└── bin/

tests/            # parser / runtime / agent / ...
tools/            # bootstrap & HDT helpers
Safety & Boundaries

Decision support, not game automation

HearthCoach 只读取本地日志和卡牌数据,并在游戏进程之外创建辅助界面。它不会注入 Hearthstone 进程, 不会自动点击,也不会替玩家执行买牌、刷新或升级操作。发送给模型 API 的内容仅用于策略分析,API Key 保存在本地配置中。

Course Project · Open Source

Explore the code, architecture, and full setup guide.