Foundations of Generative AI Application Engineering and RAG Systems