Automating Transaction Tracking in Interactive Fiction with LLMs

2025-03-31

An author automated transaction tracking logic in an Emacs-based interactive children's book using an LLM (via gptel). The book features a protagonist who earns, saves, and spends money. Each passage initially contained code tracking transaction amounts. To enhance educational value, the author wanted to show how the cash balance was calculated. Using gptel, a simple prompt allowed the LLM to automatically add a JSON object (cashOperations) to each passage's code, tracking changes in cash with operation type, amount, and description. This significantly improved efficiency, paving the way for adding an arithmetic explainer feature.

Development