PokemonGym: A Platform Where AI Agents Play Pokémon Red via Server-Client Architecture
What is PokemonGym?
PokemonGym is a platform for evaluating the performance of AI agents in the game Pokémon Red. Through a server-client architecture, it allows AI agents to interact with the game via an API, supporting both human players and AI agents playing the game autonomously. PokemonGym includes an evaluation system, auto-save functionality, and API endpoints, making it convenient for AI research and development, as well as for game testing.
PokemonGym Features
Server Control & API Exposure: Uses a FastAPI server to control the Pokémon Red emulation and exposes the game state through an API.
Human Player Interface: Provides a UI that allows human players to control the game via the keyboard.
AI Agent Support: Includes a demo AI agent powered by Claude that can play the game autonomously.
Evaluation System: Gives rewards based on in-game progress (such as catching Pokémon, earning badges, visiting locations, etc.).
Game State Management: Supports auto-save and manual save of game state, making it convenient to continue gameplay across sessions.
Data Logging: Records game state data, evaluation summaries, screenshots, etc.
API Endpoints: Provides API endpoints for initializing the environment, executing actions, retrieving state, stopping the environment, etc.
PokemonGym Applications
AI Research & Development: Provides researchers and developers with a platform to test and improve AI agents.
Game Testing: Can be used to test the performance of AI agents in game environments, helping to optimize AI algorithms.
Education & Learning: Provides a practical platform for students and enthusiasts learning reinforcement learning and AI development.

PokemonGym Usage Tutorial
Installation: Requires Python 3.8+, PyBoy and its dependencies, and a Pokémon Red ROM file.
Running the Server: Start the server via the command line; it runs on http://localhost:8080 by default.
Human Player Mode: Supports controlling the game via the keyboard, with multiple control options provided.
AI Agent Mode: After setting the Anthropic API key, the AI agent can make decisions based on the game screen.
Game State Management: Supports auto-save and manual save of state, making it convenient to continue previous sessions.
Github Project:https://github.com/benchflow-ai/pokemon-gym
Script Planner Assistant▸
AI Apps
AI News 