"Professor Oak's dream, realized by AI"
An AI-powered agent that plays Pokรฉmon Red/Blue to complete the Pokรฉdex - all 151 Pokรฉmon, including trades and glitches.
Professor Oak spent his life trying to complete the Pokรฉdex. Now, with the power of AI and emulation, we can finally fulfill his dream - automatically.
AgentOak uses:
- PyBoy for Game Boy emulation with memory access
- LLM integration for intelligent decision-making
- Dual-instance architecture for trading between Red and Blue
- Glitch execution for Mew and item duplication
- ๐ฎ Dual Game Support - Runs Pokรฉmon Blue and Red simultaneously
- ๐ Automated Trading - Exchanges version-exclusive Pokรฉmon
- ๐ง Hybrid AI - Rule-based logic + LLM for complex decisions
- ๐ Live Dashboard - Watch both games side-by-side with action logs
- ๐ Glitch Support - Mew glitch, item duplication (MissingNo)
- ๐ Progress Tracking - Real-time Pokรฉdex completion status
- Python 3.11+
- ~500MB RAM per emulator instance
roms/pokemon-blue.gb- Pokรฉmon Blue ROM (SHA1:d7037c83e1ae5b39bde3c30787637ba1d4c48ce2)roms/pokemon-red.gb- Pokรฉmon Red ROM (SHA1:ea9bcae617fdf159b045185467ae58b2e4a48b9a)
pyboy>=2.0.0
numpy
pillow
pygame
# Clone the repository
git clone https://github.com/Zweer/AgentOak.git
cd AgentOak
# Install with uv (recommended)
uv sync
# Or with pip
pip install -e .
# Add your ROMs
mkdir -p roms
# Copy pokemon-blue.gb and pokemon-red.gb to roms/# Install dev dependencies
uv sync --extra dev
# Run tests
make test
# Run linter
make lint
# Format code
make formatTest fixtures are save states with corresponding JSON specifications for regression testing.
# 1. Play manually and create a save state
uv run python scripts/play_manual.py
# Press Ctrl+C when ready, choose 'y' for test mode
# This creates a .state file in tests/fixtures/
# 2. Extract test specification
uv run python scripts/extract_test_spec.py tests/fixtures/your_save.state "Description"
# This generates your_save.json with:
# - Player state (name, money, time, position, badges)
# - Party Pokรฉmon (stats, moves, IVs)
# - Collision data
# 3. Tests run automatically for all .state files in tests/fixtures/
make test# Start the agent (both games)
python -m agentoak
# Start with display (watch the AI play)
python -m agentoak --display
# Dry run (no saves, just watch)
python -m agentoak --display --dry-run
# Start from existing save
python -m agentoak --load-state saves/checkpoint.stateโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ORCHESTRATOR โ
โ - Tracks Pokรฉdex progress โ
โ - Decides next objective โ
โ - Coordinates both game instances โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Player โ โ Glitch โ โ Trade โ
โ Agent โ โ Runner โ โ Manager โ
โโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโดโโโโโโโโ
โผ โผ
โโโโโโโโโโโโ โโโโโโโโโโโโ
โ PyBoy โโโโบโ PyBoy โ
โ (Blue) โ โ (Red) โ
โโโโโโโโโโโโ โโโโโโโโโโโโ
- PyBoy integration (headless + display modes)
- Memory reader (party, Pokรฉdex, player state, money, time)
- Input controller (button press with frame control)
- Save/load state functionality
- Screenshot capture
- Collision detection (walkable matrix)
- Test infrastructure with fixtures
- 100% test coverage
- Map navigation (A* pathfinding)
- Battle system (attack, catch, run)
- Wild Pokรฉmon encounters
- Badge collection
- HM usage (Cut, Surf, Strength, Flash)
- Key item management
- Catch all available Pokรฉmon in one version
- Evolution handling (level, stones)
- Safari Zone strategy
- Mew glitch (Trainer-Fly)
- Item duplication (MissingNo) - optional
- Dual PyBoy instances
- Link cable emulation
- Trade protocol
- Version-exclusive exchanges
- Trade evolutions (Alakazam, Gengar, Machamp, Golem)
- Full 151 Pokรฉmon
- Dashboard with live view
- Progress persistence
| Glitch | Red | Blue | Yellow |
|---|---|---|---|
| Mew (Trainer-Fly) | โ | โ | โ |
| Item Duplication | โ | โ | โ |
Blue only: Sandshrew, Sandslash, Vulpix, Ninetales, Meowth, Persian, Bellsprout, Weepinbell, Victreebel, Magmar, Pinsir
Red only: Ekans, Arbok, Oddish, Gloom, Vileplume, Mankey, Primeape, Growlithe, Arcanine, Scyther, Electabuzz
- Kadabra โ Alakazam
- Machoke โ Machamp
- Graveler โ Golem
- Haunter โ Gengar
This is an experimental/educational project. Contributions welcome!
This project stands on the shoulders of giants:
- PyBoy - The Game Boy emulator that makes this possible
- PokemonRedExperiments - RL approach to playing Pokรฉmon Red
- llm_pokemon_scaffold - LLM-based Pokรฉmon player
- Bulbapedia - Pokรฉmon data and memory maps
- pret/pokered - Pokรฉmon Red/Blue disassembly
MIT
This project is for educational purposes. You must provide your own legally obtained ROM files. Pokรฉmon is a trademark of Nintendo/Game Freak/The Pokรฉmon Company.