View on GitHub

Introduction to Artificial Intelligence

Examples for an AI course following the textbook Artificial Intelligence: A Modern Approach by Russell and Norvig.

Chapter 7-9: Knowledge-based Agents

Logical Agents

Knowledge-based agents typically store facts using logic. First-order logic can be expressed using the logic programming language Prolog. Here are two online examples using SWI-Prolog:

Python provides several modules for logic and symbolic mathematics. Here is a short primer on logic programming with Python.

Large Language Models

Large language models (LLMs) can be used as knowledge-based agents that work with natural language rather than logic. They can be used via an API or run locally. Important tasks include prompt engineering and context engineering.

Example:

Libraries and Prompting:

Agentic AI

An agentic AI solution uses a set of specially prompted LLM calls. It may involve any of the following:

Video:

Articles:

Tools:

License

© 2025 Michael Hahsler. All code and documents in this repository are provided under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License.

CC BY-SA 4.0