New advancements in AI have influenced the development of different fields. Corpus linguistics, a field supported by computer-assisted analysis and contributing to ESP, can utilize AI-based solutions to systematically process and analyze large corpora to help ESP practitioners serve the needs and purposes of different disciplines. A knowledgebase is the central part of a knowledge management system (KMS), which stores knowledge and information in a systematized manner. We suggest using a KMS as a solution helping learners in ESP contexts for goals like mastering specialized vocabulary and terminology, and this study aimed to develop a knowledgebase for this purpose tailored for medical students. To do so, 11000 medical terms from a collection of 10 textbooks and sourcebooks were assigned to 22 medical students at Ilam University of Medical Sciences (IUMS) to submit to the AI chatbots ChatGTP and Google Gemini in order to categorize and classify the terms in groups, gather definitions, collect illustrations, example photos and images when applicable, and find synonyms or antonyms when possible. The findings were systematically organized by a team of two faculty members of medical specialties and two ESP instructors from IUMS and two instructors from Ilam University, along with the authors. The organized data were entered to a Microsoft Access database. Two homogeneous classes of 7 sophomores were formed for a medical ESP course and one used the database as a learning aid, holding other characteristics of the two classes identical. After the course completed, the students took an achievement test. The results were analyzed and showed that the students who used the database outperformed the students of the others class. Further studies in different contexts and with higher numbers of medical students, with different methodologies and structures can shed more light on effectiveness and implications of similar solutions, tools and learning aids.