Example code and book manuscript for Mark Watson's book "Practical Artificial Intelligence Development With Racket"
Racket implementations of many short AI examples: LLM clients and agents, embeddings and RAG, deep learning, reinforcement learning, NLP, the semantic web, and rule-based systems.
Dear readers, I hope you enjoy these examples!
Link to book on LeanPub:
Read this book in the manuscript subdirectory:
The code is contained in the same repository as the manuscript, but in the subdirectory source-code:
Copyright 2022-2026 Mark Watson. All rights reserved.
This book may be shared using the Creative Commons "share and share alike, no modifications, no commercial reuse" license.
Copyright 2022-2026 Mark Watson. All rights reserved.
Find the text of the Apache 2 license here: https://www.apache.org/licenses/LICENSE-2.0.txt
One example is licensed differently: source-code/coding-agent-harness is released under AGPL-3.0 (see the LICENSE file in that directory).
- Install Racket.
- Install the two packages most examples use:
raco pkg install --auto http-easy html-parsing - From the
source-codedirectory, runmake compileand thenmake test. Neither needs an API key or a network connection.
source-code/README.md lists every example with its chapter, extra packages, and the environment variables (API keys) it needs.
manuscript/holds the book text;manuscript/Book.txtis the chapter order.source-code/holds the examples.SOURCE_CODE_MAP.mdmaps each chapter to its example directories. It andmanuscript/TOC.mdare generated byracket tools/make-index.rkt.TODO.mdis a list of suggested improvements to the book and the examples.
Pull requests with corrections to either the code or the manuscript are welcome.
