In the context of ophthalmic care, where early diagnosis of eye disorders plays a crucial role in patients' quality of life, this study focused on the development and evaluation of an expert system based on SWI Prolog. The main objective of this research was to provide an effective method for the preliminary diagnosis of ocular disorders, including cataract, trachoma, uveitis, glaucoma, and presbyopia. For the evaluation of the system, a confusion matrix was implemented and accuracy, sensitivity and specificity were calculated using a sample of 30 cases, of which 20 were positive and 10 negatives. The findings revealed an outstanding accuracy of 95%, with a sensitivity and specificity of 90%. This highlights the potential of the tool as an effective means of early detection of visual problems. In conclusion, this expert system represents a significant advance in ophthalmologic diagnosis, with important implications for clinical care and patients' quality of life, although expansion and validation of the tool in further clinical studies is suggested for its wider and more successful implementation in the field of ophthalmology.