Skip to content

Tutorial: When ants ask a decision model

Deutsche Fassung · The tutorial was written in German; all chapters and both appendices are translated.

An ant colony in the browser, built in eight steps with Python and Streamlit. Every ant asks a decision model what to do next – in this tutorial TypeSafe Jev. You are the queen, and your only control is a sentence.

After every step there is a program that runs, and from step 2 on every step an ant takes comes from the model.

Getting started

git clone https://github.com/gkvoelkl/python-streamlit-jev-ant
cd python-streamlit-jev-ant
uv run streamlit run app.py

From step 2 on you need a key from console.typesafe.ai/keys – or Ollama on your own machine, see appendix B.

The app and the code are in English, so the listings in the German chapters read the same as here.

Contents

Introduction

  1. The board
  2. One ant asks the decision model
  3. The ant colony
  4. Carrying and delivering
  5. Seeing
  6. The queen
  7. Insights
  8. What is the decision model worth?

Appendix


This tutorial was created by Gerhard Völkl using Claude Code (Anthropic). It is meant to help you learn more about what happens when ants ask a decision model. Suggestions for improvement are welcome at gkvoelkl@nelson-games.de.