"I can read your mind... Try me!"
- Mind-reading AI that guesses characters/animals/objects
- Multi-language support (Arabic, English, French, Spanish)
- Knowledge base with 50+ entities and 200+ attributes
- Inferences and Self-improving through Prolog logical inference
- Beautiful UI with TailwindCSS
- Session tracking for personalized guessing
# Sample Prolog knowledge base
entity(crocodile, [animal, reptile, carnivore, cold_blooded,..., swims, sharp_teeth, armored_skin]).
entity(darth_vader, [character,..., villain, uses_force, has_lightsaber, star_wars_universe]).| 🎨 Styling | 🧩 Components |
|---|---|
| django-tailwind | Django Templates |
| 🐍 Language | 🏗️ Framework | 🔮 Logic Engine |
|---|---|---|
| Python | Django 4.x (with i18n) | SWI-Prolog via PySwip |
- Python 3.8+
- SWI-Prolog 9.0+
- PySwip 0.2.10+
- Django 4.0+
- django-tailwind (v3.3+)
# Clone and enter repository
git clone https://github.com/johanLib/Akinator.git
cd Akinator
# Create virtual environment (Unix/MacOS)
python3 -m venv venv
source venv/bin/activate
# Windows users use:
# venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt ( Check the Prerequisites section )
# Migrate database
python manage.py migrate
# Run development server
python manage.py runserver% Entity facts database
entity(crocodile, [animal, reptile, carnivore, cold_blooded, lives_in_water, four_legs, swims, sharp_teeth, armored_skin]).
entity(darth_vader, [character, fictional, from_movie, villain, uses_force, has_lightsaber, star_wars_universe]).
% Dynamic rules
ask_attributes(ConfirmedAttrs, EntityList) :-
EntityList = [_|_],
select_best_question(EntityList, Question),
has_attribute(Question),
filter_entities(EntityList, [Question | ConfirmedAttrs], NewEntityList),
ask_attributes(ConfirmedAttrs, NewEntityList).| Language | Code | Example Question | Example Answer |
|---|---|---|---|
| العربية | ar |
"هل يعتمد على المهارات بدلاً من القدرات الخارقة؟" | "نعم/لا" |
| English | en |
"Does it rely on skills rather than supernatural abilities?" | "Yes/No" |
| Français | fr |
"Compte-t-il sur des compétences plutôt que des capacités surnaturelles ?" | "Oui/Non" |
| Español | es |
"¿Depende de habilidades en lugar de poderes sobrenaturales?" | "Sí/No" |
# In views.py
class SetLanguageView(View):
def post(self, request):
language = request.POST.get('language')
activate(language)
request.session['django_language'] = language
redirect_url = request.POST.get('next') or request.META.get('HTTP_REFERER') or '/'
return HttpResponseRedirect(redirect_url)-
Fork the repository
-
Clone your fork:
git clone https://github.com/your-username/Akinator.git
