{"id":29823836,"url":"https://github.com/luuisotorres/chess_ai_agents","last_synced_at":"2026-04-10T20:42:10.385Z","repository":{"id":306668669,"uuid":"1026825283","full_name":"luuisotorres/chess_ai_agents","owner":"luuisotorres","description":"A chess face-off between AI Agents using AutoGen. Visualize every move and watch AI vs AI, turn by turn.","archived":false,"fork":false,"pushed_at":"2025-07-27T00:40:18.000Z","size":1410,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T01:19:56.462Z","etag":null,"topics":["ai-agents","artificial-intelligence","autogen","multiagent-systems","openai","streamlit","uv"],"latest_commit_sha":null,"homepage":"https://chess-ai-agents.onrender.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luuisotorres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-26T17:33:34.000Z","updated_at":"2025-07-27T00:40:22.000Z","dependencies_parsed_at":"2025-07-27T01:20:07.931Z","dependency_job_id":"0ff5e134-fb00-4176-945f-701a949dab51","html_url":"https://github.com/luuisotorres/chess_ai_agents","commit_stats":null,"previous_names":["luuisotorres/chess_ai_agents"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/luuisotorres/chess_ai_agents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luuisotorres%2Fchess_ai_agents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luuisotorres%2Fchess_ai_agents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luuisotorres%2Fchess_ai_agents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luuisotorres%2Fchess_ai_agents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luuisotorres","download_url":"https://codeload.github.com/luuisotorres/chess_ai_agents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luuisotorres%2Fchess_ai_agents/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267617643,"owners_count":24116208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","artificial-intelligence","autogen","multiagent-systems","openai","streamlit","uv"],"created_at":"2025-07-29T02:08:59.903Z","updated_at":"2026-04-10T20:42:05.364Z","avatar_url":"https://github.com/luuisotorres.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ♟️ Chess AI Agents\n\n[![Run on Render](https://img.shields.io/badge/Run%20on-Render-2f3241?logo=render\u0026logoColor=green\u0026style=for-the-badge)](https://chess-ai-agents.onrender.com)\n\n\u003cdiv align = \"center\"\u003e\n\n![Python](https://img.shields.io/badge/Python-3.11+-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n![AutoGen](https://img.shields.io/badge/AutoGen-0.9.7+-00A86B?style=for-the-badge\u0026logoColor=white)\n![Streamlit](https://img.shields.io/badge/Streamlit-1.47+-FF4B4B?style=for-the-badge\u0026logo=streamlit\u0026logoColor=white)\n![OpenAI](https://img.shields.io/badge/OpenAI-GPT--4o-412991?style=for-the-badge\u0026logo=openai\u0026logoColor=white)\n![uv](https://img.shields.io/badge/uv-DE5FE9?style=for-the-badge\u0026logoColor=white)\n\n\n\u003c/div\u003e\n\nPresenting a chess face-off between **AI Agents** using Microsoft's AutoGen. Watch AI agents debate moves, plan strategies, and play chess in real-time with full visualization of every move and their decision-making process.\n\n![Chess AI Agents Demo](assets/user_interface.png)\n\n## Table of Contents\n\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n  - [Prerequisites](#prerequisites)\n  - [Install uv](#install-uv)\n  - [Setup Project](#setup-project)\n- [What is AutoGen?](#what-is-autogen)\n- [Usage](#usage)\n  - [Running the Application](#running-the-application)\n  - [What to Expect](#what-to-expect)\n- [How It Works](#how-it-works)\n  - [Agent Architecture](#agent-architecture)\n  - [Game Flow](#game-flow)\n- [Author](#author)\n- [License](#license)\n\n## Project Structure\n\n```\nchess_ai_agents/\n├── agents/                # AI agent definitions and setup\n│   ├── __init__.py\n│   ├── functions.py       # Chess move functions for agents\n│   └── setup_agents.py    # Agent initialization and game logic\n├── config/                # Configuration settings\n│   ├── __init__.py\n│   └── settings.py        # Default model, turns, board size\n├── core/                  # Core game state management\n│   ├── __init__.py\n│   └── game_state.py      # Chess board state and session management\n├── assets/                # Screenshots and demo images\n├── app.py                 # Main Streamlit application\n├── pyproject.toml         # Project dependencies and metadata\n└── README.md\n```\n\n## Installation\n\nThis project uses [uv](https://github.com/astral-sh/uv) for fast Python package management.\n\n### Prerequisites\n\n- Python 3.11 or higher\n- An OpenAI API key\n- uv package manager\n\n### Install uv\n\n```bash\n# macOS/Linux\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n\n# Windows\npowershell -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n\n# Or via pip\npip install uv\n```\n\n### Setup Project\n\n**Clone the repository**\n```bash\ngit clone https://github.com/luuisotorres/chess_ai_agents.git\ncd chess_ai_agents\n```\n\n**Install dependencies**\n```bash\nuv sync\n```\n\n**Activate the virtual environment**\n```bash\nsource .venv/bin/activate  # On macOS/Linux\n# or\n.venv\\Scripts\\activate     # On Windows\n```\n\n### Settings Customization\nEdit `config/settings.py` to modify:\n\n```python\nDEFAULT_MODEL: str = \"gpt-4o\"          # OpenAI model to use\nDEFAULT_MAX_TURNS: int = 5             # Default game length\nSVG_SIZE: int = 512                    # Chess board display size\n```\n\n## What is AutoGen?\n\n[Microsoft AutoGen](https://github.com/microsoft/autogen) is a framework for building **multi-agent AI systems** where AI agents **collaborate, debate, and solve complex problems together**.\n\n\n## Usage\n\n### Running the Application\n\n**Start the Streamlit app**\n```bash\nuv run streamlit run app.py\n```\n\n**Open your browser** to `http://localhost:8501`\n\n**Enter your OpenAI API key** in the sidebar\n\n**Configure game settings** (optional):\n- Adjust max half-moves (default: 5 for demos)\n- Higher values = longer games = more API costs\n\n**Click \"▶️ Start Game\"** and watch the AI play against each other!\n\n### What to Expect\n\n**During the Game:**\n- The Streamlit interface shows a spinner: \"*Agents are playing...*\"\n- **Check your terminal/console** for live agent conversations\n- Agents will debate moves, analyze positions, and make decisions\n- Each move is validated and executed in real-time\n\n**After the Game:**\n- View the complete move history in the web interface\n- Each move shows the board state after execution\n- Game summary with final results\n\n![Game Running](assets/running_game.png)\n\n![Move History](assets/move_history.png)\n\n![Move History 2](assets/move_history_2.png)\n\n## How It Works\n\n### Agent Architecture\n\n1. **White Agent**: Plays as white pieces, analyzes positions from white's perspective\n2. **Black Agent**: Plays as black pieces, considers black's strategic goals  \n3. **Game Master**: Orchestrates turns, validates moves, manages game state\n\n### Game Flow\n\n1. **Initialization**: Agents are created with chess-specific instructions\n2. **Turn Management**: Game Master alternates between white and black agents\n3. **Move Discussion**: Agents analyze current position and propose moves\n4. **Move Validation**: Proposed moves are checked for legality\n5. **Move Execution**: Valid moves are applied to the board\n6. **State Update**: Board state is updated and visualized\n7. **Termination**: Game ends after max turns or checkmate/stalemate\n\n## Author\n\n[Luis Fernando Torres](https://github.com/luuisotorres)\n\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/luuisotorres/)\n[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge\u0026logo=medium\u0026logoColor=white)](https://medium.com/@luuisotorres)\n[![Kaggle](https://img.shields.io/badge/Kaggle-20BEFF?style=for-the-badge\u0026logo=kaggle\u0026logoColor=white)](https://www.kaggle.com/lusfernandotorres)\n[![Hugging Face](https://img.shields.io/badge/_Hugging_Face-FFD21E?style=for-the-badge\u0026logo=huggingface\u0026logoColor=black)](https://huggingface.co/luisotorres)\n\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluuisotorres%2Fchess_ai_agents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluuisotorres%2Fchess_ai_agents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluuisotorres%2Fchess_ai_agents/lists"}