To overcome obstacles like inadequate infrastructure and a lack of prepared teachers, data-driven optimization of AI-driven educational technologies is necessary to improve personalized learning under Kenya's Competency-Based Curriculum (CBC), which has been in place since 2017 to place an emphasis on skill-based and learner-centered education. Research has indicated that teachers have a moderate level of faith in AI and that there needs to be an ethical component to information and communication technology (ICT) education. New initiatives, like Kenya's National AI Strategy 2025–2030, aim to close the skills gap among the country's young population (median age: 19). This study examines survey responses from 30 stakeholders at Jogoo and Kiamabundu DOK Primary Schools (33.33% teachers, 20% children) in order to develop artificial intelligence tools that enhance results in neglected areas. Factors identified by multivariate statistical analysis, including Principal Component Analysis (PCA), include a moderate level of computer literacy (73.33%), a lack of experience with artificial intelligence (60%), and a strong endorsement of teacher training (50% deem it essential/significant). In line with initiatives such as digital literacy programs and AI-powered teacher support tools, such as chatbots for lesson preparation and grading, these findings point out the value of capacity building and the challenges to adoption. With 53.34% of respondents noting a significant or moderate impact on learning outcomes, optimization modeling prioritizes AI platform features such as interactive content (36.67%), personalized learning paths (33.33%), and real-time feedback (26.67%). This guarantees the optimization of CBC's learner-centric objectives. To promote inclusive education, these mathematical models provide a scalable framework for low-infrastructure solutions like virtual tutors and platforms based on short message service (SMS). Policymakers and EdTech developers in Kenya can use the findings as a guide to include AI in CBC that addresses the needs of everyone involved, reduces dependence on infrastructure, and supports fair, modern education.