A Tic-Tac-Toe bot that uses minimax to play the best moves every time, not really an AI but AI sounds cooler.
Minimax is a kind of backtracking algorithm that is used in decision making and game theory to find the optimal move for a player, assuming that your opponent also plays optimally. It is widely used in two player turn-based games such as Tic-Tac-Toe, Backgammon, Mancala, Chess, etc. Read more here : https://www.geeksforgeeks.org/minimax-algorithm-in-game-theory-set-1-introduction/