The food recommender system plays a crucial role in providing solutions for the community, as there are many food choices available in society. However, the lack of attention to the nutritional value of the foods we consume can lead to obesity. The increasing prevalence of obesity worldwide is an urgent problem that needs to be addressed. Obesity is a serious issue as it can cause various dangerous diseases such as diabetes, atherosclerosis, cholesterol, and even cancer. This necessitates the need for a food recommender system that considers not only user preferences but also nutritional needs. This research aims to develop a food recommender system for various age groups that consider the nutritional needs, diseases, and allergies that the user is suffering from. Therefore, we propose a knowledge-based context-aware approach to building a food recommender system. The proposed recommender system utilizes a chatbot to facilitate user's interactions with the system. The system leverages information from the internal context about user characteristics such as age, gender, height, weight, activity level, and medical history. Additionally, the information on external context relates to food types and recent weather. There are 11 types of food that are recommended. Each recommended food is tailored to user preferences and nutritional needs. Testing results of our proposed system show high accuracy, with an F1-Score reaching 0.97.