# linyiLYi/snake-ai

An AI agent that beats the classic game "Snake".

Repository: https://github.com/linyiLYi/snake-ai
Canonical: https://ross.abutalabs.com/products/snake-ai
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2024-04-30T20:17:29+00:00

## Health v2 (maintenance only)
Score: 30/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 87
- inputs: {"age_days": 1226, "days_push": 855, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1785, forks 401 (observed 2026-08-28T04:05:36.099643+00:00)

## What it is
A Python project implementing the classic Snake game with Pygame and an AI agent trained via deep reinforcement learning to play it. It provides MLP-based and CNN-based agents (using Stable-Baselines3 and OpenAI Gym) with pretrained model weights and training logs viewable in TensorBoard.

## Use cases
- learn deep reinforcement learning with a hands-on example
- train an AI to play the snake game
- compare MLP vs CNN agents in reinforcement learning
- demo of reinforcement learning for game playing
- study a simple RL project with pretrained models
- teach reinforcement learning concepts with a classic game

## When to choose
- you want a small, well-documented project to learn deep RL basics
- you want pretrained Snake-playing agents to test and explore
- you want a Pygame + Stable-Baselines3 reference implementation

## When to avoid
- you need a production game or general-purpose RL framework
- you need agents for games other than Snake
- you need maintained, actively developed RL tooling

## Facets
- artifact type: learning-resource
- maturity: stable
- function: reinforcement-learning, machine-learning, game, deep-learning
- domain: reinforcement-learning, machine-learning, gaming-tools, education
- platform: python, windows, cross-platform
- tags: snake-game, pygame, stable-baselines3, openai-gym, dqn, mlp, cnn, pytorch, tutorial, gpu

## Member repositories
- linyiLYi/snake-ai (main) score 30

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:36.099643+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:24:13.122044+00:00, confidence not recorded.
  - readme: https://github.com/linyiLYi/snake-ai (fetched 2026-08-28T04:05:36.099643+00:00, sha 63fe05367eef)
- Data as of 2026-08-30T08:39:29.467469+00:00.
