Graham Knapp

Playing "In my bag..." with LLM agent templates

written by Graham Knapp on 2025-08-10

There's a memory game "In my bag..." where you pretend you have a list of things in your bag "In my bag I have a comb and a cat". The next person in the circle has to list all the same things and add one more at the end "In my bag I have a comb, a cat and a clock". The game ends when someone makes a mistake or gives up.

It occurred to me that this is a great analogy for the templates used in LLM chatbots! Every time you chat with an LLM the LLM re-reads the whole history of the conversation before responding. This is why they get slower over time, particularly if they are making web searches, viewing images, using MCPs or other tools which add a lot of hidden tokens to the chat history.

The ollama docs describe a simple template here ... https://github.com/ollama/ollama/blob/main/docs/template.md

ai python