Agentic RPG with MiniMax + Pi

I Built an Agentic RPG with MiniMax + Pi

🎬 ZazenCodes 📅 Aug 21, 2026 ⏱ 32:15
MiniMax M3 Pi agentic game GitHub issues Phaser

🎮 The Idea: An Agentic RPG

Two goals: (1) show how to integrate an agentic system into a game context, and (2) test how good MiniMax M3 is at complex programming. The meta layer: "I'll use Pi to drive MiniMax when building the system, and Pi under the hood inside the game to drive the agentic engine." 0:00

The core concept: a browser-based RPG where every GitHub issue is a monster. Attack a monster → it spawns a real Pi agent session on your machine → the agent solves the issue, opens a PR, merges it. "We're going to be picking up issues from GitHub, fixing them, submitting a PR — all done through the game." 1:01

🧠 MiniMax M3 Architecture

Three frontier capabilities: (1) autonomous task decomposition + tool invocation + multi-step reasoning for long-running agentic tasks, (2) up to 1M-token context and native multimodal, (3) speed. 1:35

The architecture: MiniMax sparse attention (lower latency, high throughput) + mixture of experts. "The full model is half a trillion parameters — relatively small for this capability — but only 23 billion are activated, ~5% of parameters at inference. That makes it really fast." Open weights on HuggingFace. 2:36

🔌 Connect MiniMax to Pi

The setup is three commands: install Pi, set the MiniMax API key, launch with pi --provider minimax --model minimax-m3. Then check the bottom-right shows "MiniMax M3." 4:31

His working style (no permissions): "Pi has no permissions built in by default — that's an extension you add on top. For a project like this, the last thing I want is approving things. I trust the model to work in this repo, and if I wanted limits I'd put them in the prompt. That's how I actually work with Pi — open permissions, locked down by prompt engineering." 7:50

🏗️ Building the Game

The prompt is deliberately simple: "Build a browser RPG that visualizes a coding agent solving GitHub issues. Use Phaser, React, TypeScript." Plus a pasted style-reference image. He leaves "all of this work up to MiniMax." 5:50

Autonomous decomposition in action: "MiniMax took my request and, without being asked, wrote a plan.md — it understood 'this is complicated, let me build a plan.'" It produced a client/server architecture: React + Phaser canvas client, WebSocket to a Node.js server that does "the agentic stuff." 7:03

It ran its own tests, found problems, and iterated — "the monster HP isn't being updated either." The token math was astonishing: "we're at 8% of our million-token context, and the equivalent cost is only 20 cents so far." 9:16

🐛 Multimodal Debugging

He has a skill called "agent browser" that opens the game and plays it, taking screenshots as it goes. "MiniMax is able to look at these images and reason about them — 'oh, victory again but the screen is stuck on victory' — it understands there's a problem from the screenshot and starts debugging." 9:45

The multimodal loop: play → screenshot → read the image → diagnose ("screen stuck on victory", "quest log in an awkward spot", "not filling the full screen") → fix. "This is why we get this extended agentic behavior — it keeps reading the images, and we have tons of context space to keep spinning." 10:25

🐙 Real GitHub Issues → Monsters

After the demo data works, he connects it to real GitHub issues via the gh CLI, against a demo project called "habit CLI" with four open issues. The instruction: "when we attack a monster, spin up Pi with MiniMax to fix that issue." 14:15

Watching the thinking matters: "It was getting confused, so I stopped the agent and clarified. It's really important to watch agent thinking and stop these things when they're doing the wrong thing." He also steered it away from a wrong approach: "you're not allowed to use kitty — go read the Pi source code instead." 16:40
The real result: engaging a monster spawns a Pi agent, which solves the issue and creates a real PR that gets merged. "Issue body: 'automatically merged from Pi agent session.' PR merged, issue closed, session end — all updated in real time." He demoed it solving issues #3 and #4 live. 22:30

⚙️ The In-Game Agent Engine

The architecture: Vite + React + Phaser client ↔ WebSocket (bidirectional) ↔ Node.js server ↔ the Pi agent. The server is "where the actual agentic work happens." 24:49

The Pi integration: the server uses the Pi npm library's createAgentSession to spawn a session in the working directory, then prompts it with a dynamically-built instruction: "Solve GitHub issue #{n}: {title}. Current working directory: {repo}. Explore the repo, find the relevant code, make changes, run the test suite, reply with the single word 'done' when tests pass. Be efficient." 27:00
Real PR creation, from raw terminal commands: after Pi exits cleanly, the server takes the uncommitted changes, commits them on a branch, and runs gh pr create --base main --head {branch} --title ... --body ... — all via node:child_process. "We're just running raw terminal commands from our script. That's wild." 28:20

⭐ MiniMax M3 Performance

"Building games like this is really hard for agents — a genuinely challenging task. But when it got to the Pi stuff and the agentic backend, it crushed through it." His honest notes: 29:40

ObservationTake
Speed"Super fast at the start of an empty context"
Agentic backend work"Crushed through it — no problem compared to game tweaking"
Game polish / UXNeeded steering (monster HP not draining, can't be injured, movement bugs)
No web search used"This is key — I handicapped the model. It built everything from training data + inspecting the Pi source, no reference project."
Honesty"I didn't cheat. Everything you saw is real."

✅ Key Takeaways

  1. The game is a shell for an agent. The real system is the client/server + Pi agent engine — the RPG is just a compelling interface on top of real agentic work.
  2. Multimodal = visual debugging. Screenshots let the model diagnose ("screen stuck on victory") and iterate without you describing the bug.
  3. Autonomous decomposition is the differentiator. MiniMax wrote plan.md and split client/server without being asked.
  4. Watch the thinking, steer early. He stopped the agent twice — once for confusion, once to ban a wrong approach ("read the Pi source instead of using kitty").
  5. The PR pipeline is just child_process + gh CLI. "Real PR creation" = commit on a branch, run gh pr create, merge — no magic.
  6. MiniMax M3 held up on a hard task with no web search — and its token economics were ~20 cents at 8% of a million-token context.

🔗 Resources & Links

📍 Timestamp Index

0:00 Goals + overview
1:35 MiniMax M3 architecture
4:31 Connect MiniMax to Pi
6:45 Prompt Pi to build the RPG
8:30 Architecture + plan.md
9:45 Multimodal debugging (agent browser)
14:15 Real GitHub issues → monsters
18:20 createAgentSession refactor
22:30 Live PRs merged
24:49 Full system architecture
27:00 In-game agent engine
29:40 MiniMax M3 performance eval
☰ View all