aimacode/aima-python

Python implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"

What it solves

This project provides a comprehensive set of Python implementations for the algorithms described in the textbook Artificial Intelligence: A Modern Approach (AIMA). It transforms the book's pseudocode into executable code, allowing students and researchers to study, test, and experiment with fundamental AI concepts in practice.

How it works

The project is structured as an importable Python package (aima/) containing modules organized by topic (e.g., search, logic, probability). It includes a suite of Jupyter notebooks (notebooks/) that demonstrate the algorithms with examples and explanations, and a lightweight test suite (tests/) to ensure correctness. The current version is aligned with the 4th edition of the book and supports modern Python (3.9+).

Who it’s for

  • AI Students: Those using the AIMA textbook for a course or self-study.
  • Educators: Instructors teaching AI courses who need practical code examples to accompany the book's theory.
  • Developers: Anyone looking for a clean, reference implementation of classic AI algorithms.

Highlights

  • Broad Algorithm Coverage: Implements a wide range of AI topics including search (A*, Genetic Algorithms), game playing (Minimax, Monte Carlo Tree Search), logic (SAT solvers, FOL), and probability (Kalman Filters, MDPs).
  • Interactive Learning: Extensive use of Jupyter notebooks and a browser-based JupyterLite proof-of-concept for immediate experimentation.
  • Modern Python Standards: Utilizes Python 3.9+ features like f-strings, type hints, and dataclasses for readability and readability.
  • Integrated Testing: Includes a full test suite using pytest to verify algorithm implementations.

Related

  • Project
  • Project
  • Project
  • Project