The integration of AI into education could transform teaching, but it is vital to learn from the mistakes of the past