MathTales: Designing and Studying an AI Agent-Based Story Generation System for Teaching Mathematical Problem Solving to Children
Kejia Zhang, Yuqi Niu, Mona Y. Alqassim, Andrina Louise Inglis, Charaka Palansuriya, Aurora Constantin · 2026
Mathematical stories, particularly those that incorporate problem-solving, are widely recognised as an effective approach to learning mathematics. By grounding problems in concrete examples, children can gradually develop problem-solving skills as the story unfolds. However, creating such stories typically relies on teachers or professional writers, making it challenging to produce stories for every problem at scale. In this paper, we present MathTales, a multi-agent system that leverages a locally deployed open-source large language model to automatically generate stories to teach children mathematical problems. Through human evaluation, we found MathTales produces reliable mathematical stories in terms of accuracy, relevance, coherence, integration and readability. A study with children and teachers revealed that MathTales-generated stories had a positive impact on engagement, enjoyment, and understanding. Additionally, we analyse teachers’ feedback to identify the pedagogical value of these stories and derive design implications for future mathematical story generation systems that support mathematics teaching and learning.