Skip to content

Commit 2d6c94f

Browse files
authored
Merge pull request #34 from alexankitty/ai
AI-powered game search
2 parents 3d2d8e0 + ad20b5b commit 2d6c94f

File tree

26 files changed

+2069
-35
lines changed

26 files changed

+2069
-35
lines changed

.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ EMULATOR_ENABLED=true
1818
# Set the hostname
1919
HOSTNAME=myrient.mahou.one
2020

21+
# OpenAI-compatible API settings
22+
AI_ENABLED=true
23+
AI_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
24+
AI_API_URL=https://api.groq.com/openai/v1/chat/completions
25+
AI_MODEL=openai/gpt-oss-120b
26+
2127
# Run docker-compose.dev.yml for running locally
2228
# Database Configuration
2329
POSTGRES_HOST=localhost

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ To ensure OpenGraph metadata embed for chat apps works correctly, please be sure
7878
# Metadata
7979
To enable metadata synchronize and matching, you will need to create a developer application in the [Twitch TV Developer Console](https://dev.twitch.tv/console) and then add your client id to `TWITCH_CLIENT_ID` in `.env` or `docker-compose.yml` along with adding your client secret to `TWITCH_CLIENT_SECRET`. Metadata takes about half an hour to synchronize from IGDB to your database, and about another half an hour to match via Postgres Full Text Search. Once all other database maintenance operations are done, the database will attempt to match anything that still isn't matched using a much slower fuzzy trigram search that can take up to a day to complete. These processes won't run again until a new crawl of myrient has been performed and the file count has increased.
8080

81+
# AI Chat Assistant
82+
The search engine includes an optional AI chat assistant that can help users find games and answer questions. The AI assistant appears as a floating button in the bottom-right corner of all pages. You will have to fill API configuration in `.env` or `docker-compose.yml` to enable the AI chat assistant.
83+
84+
The AI chat is OpenAI compatible, so you can use any compatible providers, like ChatGPT, Gemini, Ollama etc. We recommend using [Groq](https://groq.com) with `openai/gpt-oss-120b`, as it has excellent performance, great reasoning and generous limits for free usage.
85+
86+
8187
# Contributing
82-
You know the usual fluff.
83-
Is there a missing category or string association? `lib/categories.json` and any of the files under `lib/json/relatedkeywords` can both updated to include these. If you do update/improve these, please put in a pull request so that it can be added to the public hosted server, as well.
88+
You know the usual fluff.
89+
Is there a missing category or string association? `lib/categories.json` and any of the files under `lib/json/relatedkeywords` can both updated to include these. If you do update/improve these, please put in a pull request so that it can be added to the public hosted server, as well.
8490
Pull requests are always welcome. Make sure to make any changes clear in your pull request, and if possible, run any files you've modified through prettier.

config/locales/ar.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
"disabled": "تم تعطيل وظيفة المحاكي على الويب من قبل المسؤول.",
5656
"contact": "تواصل مع المسؤول أو قم بإنشاء نسختك الخاصة من Myrient Search."
5757
},
58+
"ai": {
59+
"title": "مساعد الذكاء الاصطناعي",
60+
"description": "يحتوي هذا الموقع على مساعد مدعوم بالذكاء الاصطناعي يمكنه مساعدتك في العثور على الألعاب وتقديم التوصيات والإجابة على الأسئلة حول الألعاب التقليدية.",
61+
"provider_info": "مدعوم بواسطة {{provider}} باستخدام نموذج {{model}}.",
62+
"privacy_note": "المساعد الذكي مدعوم بخدمة خارجية. يرجى الرجوع إلى سياسة الخصوصية للخدمة للحصول على مزيد من المعلومات.",
63+
"disabled": "تم تعطيل وظيفة المساعد الذكي من قبل المسؤول.",
64+
"contact": "تواصل مع المسؤول أو قم بإنشاء نسختك الخاصة من Myrient Search."
65+
},
5866
"credits": {
5967
"created_by": "تم إنشاء محرك البحث بواسطة",
6068
"view_github": "عرض المشروع على GitHub"
@@ -156,6 +164,25 @@
156164
"back_home": "العودة إلى الصفحة الرئيسية",
157165
"go_back": "رجوع"
158166
},
167+
"ai_chat": {
168+
"title": "مساعد الذكاء الاصطناعي",
169+
"button_tooltip": "مساعد الذكاء الاصطناعي",
170+
"welcome": {
171+
"title": "مساعد الذكاء الاصطناعي",
172+
"description": "يمكنني مساعدتك في العثور على ألعاب الريترو، وتقديم توصيات الألعاب، والإجابة على الأسئلة حول استخدام محرك البحث."
173+
},
174+
"suggestions": {
175+
"game_recommendations": "ما هي الألعاب التي توصي بها لجهاز Nintendo 64؟",
176+
"search_tips": "كيف أبحث عن مناطق معينة؟",
177+
"gaming_history": "أخبرني عن أجهزة الألعاب الريترو"
178+
},
179+
"input_placeholder": "اسألني عن أي شيء...",
180+
"typing_indicator": "الذكاء الاصطناعي يفكر",
181+
"error": {
182+
"network": "تعذر الاتصال بخدمة الذكاء الاصطناعي. يرجى التحقق من اتصال الإنترنت والمحاولة مرة أخرى.",
183+
"generic": "آسف، أواجه مشاكل في الاتصال الآن. يرجى المحاولة مرة أخرى لاحقاً."
184+
}
185+
},
159186
"languages": {
160187
"en": "English",
161188
"es": "Español",

config/locales/bn.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
"disabled": "ওয়েব এমুলেটর কার্যকারিতা অ্যাডমিনিস্ট্রেটর দ্বারা নিষ্ক্রিয় করা হয়েছে।",
5656
"contact": "অ্যাডমিনিস্ট্রেটরের সাথে যোগাযোগ করুন অথবা আপনার নিজের Myrient Search ইনস্ট্যান্স সেট আপ করুন।"
5757
},
58+
"ai": {
59+
"title": "AI সহায়ক",
60+
"description": "এই ওয়েবসাইটে একটি AI-চালিত সহায়ক রয়েছে যা আপনাকে গেম খুঁজতে, সুপারিশ প্রদান করতে এবং রেট্রো গেমিং সম্পর্কে প্রশ্নের উত্তর দিতে সাহায্য করতে পারে।",
61+
"provider_info": "{{provider}} দ্বারা চালিত {{model}} মডেল ব্যবহার করে।",
62+
"privacy_note": "AI সহায়ক একটি বাহ্যিক সেবা দ্বারা চালিত। আরো তথ্যের জন্য সেবার গোপনীয়তা নীতি দেখুন।",
63+
"disabled": "AI সহায়ক কার্যকারিতা প্রশাসক দ্বারা নিষ্ক্রিয় করা হয়েছে।",
64+
"contact": "প্রশাসকের সাথে যোগাযোগ করুন অথবা Myrient Search এর আপনার নিজস্ব ইনস্ট্যান্স চালু করুন।"
65+
},
5866
"credits": {
5967
"created_by": "সার্চ ইঞ্জিন তৈরি করেছেন",
6068
"view_github": "GitHub-এ প্রকল্প দেখুন"
@@ -156,6 +164,25 @@
156164
"back_home": "হোম পেজে ফিরে যান",
157165
"go_back": "পেছনে যান"
158166
},
167+
"ai_chat": {
168+
"title": "এআই সহায়ক",
169+
"button_tooltip": "এআই সহায়ক",
170+
"welcome": {
171+
"title": "এআই সহায়ক",
172+
"description": "আমি আপনাকে রেট্রো গেম খুঁজতে, গেমের সুপারিশ দিতে এবং সার্চ ইঞ্জিন ব্যবহার সম্পর্কে প্রশ্নের উত্তর দিতে সাহায্য করতে পারি।"
173+
},
174+
"suggestions": {
175+
"game_recommendations": "Nintendo 64-এর জন্য আপনি কোন গেমগুলি সুপারিশ করেন?",
176+
"search_tips": "আমি কীভাবে নির্দিষ্ট অঞ্চলের জন্য সার্চ করব?",
177+
"gaming_history": "রেট্রো গেমিং কনসোল সম্পর্কে আমাকে বলুন"
178+
},
179+
"input_placeholder": "আমাকে যেকোনো কিছু জিজ্ঞাসা করুন...",
180+
"typing_indicator": "এআই চিন্তা করছে",
181+
"error": {
182+
"network": "এআই সেবার সাথে সংযোগ করতে পারছি না। অনুগ্রহ করে আপনার ইন্টারনেট সংযোগ পরীক্ষা করুন এবং আবার চেষ্টা করুন।",
183+
"generic": "দুঃখিত, এখন আমার সংযোগে সমস্যা হচ্ছে। অনুগ্রহ করে পরে আবার চেষ্টা করুন।"
184+
}
185+
},
159186
"languages": {
160187
"en": "English",
161188
"es": "Español",
@@ -169,7 +196,7 @@
169196
"tr": "Türkçe",
170197
"it": "Italiano",
171198
"romaji": "Romaji",
172-
"hi": "हिन्दी",
199+
"hi": "हिন्दी",
173200
"ar": "العربية",
174201
"bn": "বাংলা",
175202
"ru": "Русский"

config/locales/de.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
"disabled": "Die Webemulator-Funktion wurde vom Administrator deaktiviert.",
5656
"contact": "Kontaktieren Sie den Administrator oder starten Sie Ihre eigene Instanz von Myrient Search."
5757
},
58+
"ai": {
59+
"title": "KI-Assistent",
60+
"description": "Diese Website verfügt über einen KI-gestützten Assistenten, der Ihnen beim Finden von Spielen, bei Empfehlungen und bei der Beantwortung von Fragen zum Retro-Gaming helfen kann.",
61+
"provider_info": "Bereitgestellt von {{provider}} mit dem {{model}}-Modell.",
62+
"privacy_note": "Der KI-Assistent wird von einem externen Dienst betrieben. Weitere Informationen finden Sie in der Datenschutzrichtlinie des Dienstes.",
63+
"disabled": "Die KI-Assistenten-Funktionalität wurde vom Administrator deaktiviert.",
64+
"contact": "Kontaktieren Sie den Administrator oder starten Sie Ihre eigene Instanz von Myrient Search."
65+
},
5866
"credits": {
5967
"created_by": "Suchmaschine entwickelt von",
6068
"view_github": "Projekt auf GitHub ansehen"
@@ -156,6 +164,25 @@
156164
"back_home": "Zurück zur Startseite",
157165
"go_back": "Zurück"
158166
},
167+
"ai_chat": {
168+
"title": "KI-Assistent",
169+
"button_tooltip": "KI-Assistent",
170+
"welcome": {
171+
"title": "KI-Assistent",
172+
"description": "Ich kann Ihnen helfen, Retro-Spiele zu finden, Spiel-Empfehlungen zu geben und Fragen zur Nutzung der Suchmaschine zu beantworten."
173+
},
174+
"suggestions": {
175+
"game_recommendations": "Welche Spiele empfehlen Sie für Nintendo 64?",
176+
"search_tips": "Wie suche ich nach bestimmten Regionen?",
177+
"gaming_history": "Erzählen Sie mir von Retro-Spielkonsolen"
178+
},
179+
"input_placeholder": "Fragen Sie mich etwas...",
180+
"typing_indicator": "KI denkt nach",
181+
"error": {
182+
"network": "Verbindung zum KI-Service nicht möglich. Überprüfen Sie Ihre Internetverbindung und versuchen Sie es erneut.",
183+
"generic": "Entschuldigung, ich habe gerade Verbindungsprobleme. Bitte versuchen Sie es später erneut."
184+
}
185+
},
159186
"languages": {
160187
"en": "English",
161188
"es": "Español",
@@ -174,4 +201,4 @@
174201
"bn": "বাংলা",
175202
"ru": "Русский"
176203
}
177-
}
204+
}

config/locales/en.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
"disabled": "Web Emulator functionality was disabled by the administrator.",
5656
"contact": "Contact the administrator or spin up your own instance of Myrient Search."
5757
},
58+
"ai": {
59+
"title": "AI Assistant",
60+
"description": "This website features an AI-powered assistant that can help you find games, provide recommendations, and answer questions about retro gaming.",
61+
"provider_info": "Powered by {{provider}} using the {{model}} model.",
62+
"privacy_note": "The AI assistant is powered by an external service. Please refer to the service's privacy policy for more information.",
63+
"disabled": "AI Assistant functionality was disabled by the administrator.",
64+
"contact": "Contact the administrator or spin up your own instance of Myrient Search."
65+
},
5866
"credits": {
5967
"created_by": "Search engine created by",
6068
"view_github": "View project on GitHub"
@@ -156,6 +164,25 @@
156164
"back_home": "Back to Home",
157165
"go_back": "Go Back"
158166
},
167+
"ai_chat": {
168+
"title": "AI Assistant",
169+
"button_tooltip": "AI Assistant",
170+
"welcome": {
171+
"title": "AI Assistant",
172+
"description": "I can help you find retro games, provide gaming recommendations, and answer questions about using the search engine."
173+
},
174+
"suggestions": {
175+
"game_recommendations": "What games do you recommend for Nintendo 64?",
176+
"search_tips": "How do I search for specific regions?",
177+
"gaming_history": "Tell me about retro gaming consoles"
178+
},
179+
"input_placeholder": "Ask me anything...",
180+
"typing_indicator": "AI is thinking",
181+
"error": {
182+
"network": "Unable to connect to the AI service. Please check your internet connection and try again.",
183+
"generic": "Sorry, I'm having trouble connecting right now. Please try again later."
184+
}
185+
},
159186
"languages": {
160187
"en": "English",
161188
"es": "Español",
@@ -174,4 +201,4 @@
174201
"bn": "বাংলা",
175202
"ru": "Русский"
176203
}
177-
}
204+
}

config/locales/es.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
"disabled": "La función del emulador web ha sido desactivada por el administrador.",
5656
"contact": "Contacta con el administrador o lanza tu propia instancia de Myrient Search."
5757
},
58+
"ai": {
59+
"title": "Asistente de IA",
60+
"description": "Esta web incluye un asistente potenciado por IA que puede ayudarte a encontrar juegos, proporcionar recomendaciones y responder preguntas sobre juegos retro.",
61+
"provider_info": "Potenciado por {{provider}} usando el modelo {{model}}.",
62+
"privacy_note": "El asistente de IA está potenciado por un servicio externo. Por favor, consulta la política de privacidad del servicio para más información.",
63+
"disabled": "La funcionalidad del Asistente de IA ha sido desactivada por el administrador.",
64+
"contact": "Contacta con el administrador o lanza tu propia instancia de Myrient Search."
65+
},
5866
"credits": {
5967
"created_by": "Buscador creado por",
6068
"view_github": "Ver proyecto en GitHub"
@@ -156,6 +164,25 @@
156164
"back_home": "Volver al Inicio",
157165
"go_back": "Volver atrás"
158166
},
167+
"ai_chat": {
168+
"title": "Asistente de IA",
169+
"button_tooltip": "Asistente de IA",
170+
"welcome": {
171+
"title": "Asistente de IA",
172+
"description": "Puedo ayudarte a encontrar juegos retro, proporcionar recomendaciones de juegos y responder preguntas sobre el uso del motor de búsqueda."
173+
},
174+
"suggestions": {
175+
"game_recommendations": "¿Qué juegos recomiendas para Nintendo 64?",
176+
"search_tips": "¿Cómo busco regiones específicas?",
177+
"gaming_history": "Cuéntame sobre consolas de videojuegos retro"
178+
},
179+
"input_placeholder": "Pregúntame cualquier cosa...",
180+
"typing_indicator": "La IA está pensando",
181+
"error": {
182+
"network": "No se puede conectar con el servicio de IA. Revisa tu conexión a internet e inténtalo de nuevo.",
183+
"generic": "Lo siento, tengo problemas para conectarme ahora mismo. Inténtalo más tarde."
184+
}
185+
},
159186
"languages": {
160187
"en": "English",
161188
"es": "Español",

config/locales/fr.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
"disabled": "La fonctionnalité d'émulation web a été désactivée par l'administrateur.",
5656
"contact": "Contactez l'administrateur ou lancez votre propre instance de Myrient Search."
5757
},
58+
"ai": {
59+
"title": "Assistant IA",
60+
"description": "Ce site web dispose d'un assistant alimenté par l'IA qui peut vous aider à trouver des jeux, fournir des recommandations et répondre aux questions sur le gaming rétro.",
61+
"provider_info": "Alimenté par {{provider}} utilisant le modèle {{model}}.",
62+
"privacy_note": "L'assistant IA est alimenté par un service externe. Veuillez vous référer à la politique de confidentialité du service pour plus d'informations.",
63+
"disabled": "La fonctionnalité Assistant IA a été désactivée par l'administrateur.",
64+
"contact": "Contactez l'administrateur ou lancez votre propre instance de Myrient Search."
65+
},
5866
"credits": {
5967
"created_by": "Moteur de recherche créé par",
6068
"view_github": "Voir le projet sur GitHub"
@@ -156,6 +164,25 @@
156164
"back_home": "Retour à l'accueil",
157165
"go_back": "Retour"
158166
},
167+
"ai_chat": {
168+
"title": "Assistant IA",
169+
"button_tooltip": "Assistant IA",
170+
"welcome": {
171+
"title": "Assistant IA",
172+
"description": "Je peux vous aider à trouver des jeux rétro, fournir des recommandations de jeux et répondre aux questions sur l'utilisation du moteur de recherche."
173+
},
174+
"suggestions": {
175+
"game_recommendations": "Quels jeux recommandez-vous pour Nintendo 64 ?",
176+
"search_tips": "Comment rechercher des régions spécifiques ?",
177+
"gaming_history": "Parlez-moi des consoles de jeux rétro"
178+
},
179+
"input_placeholder": "Demandez-moi n'importe quoi...",
180+
"typing_indicator": "L'IA réfléchit",
181+
"error": {
182+
"network": "Impossible de se connecter au service IA. Vérifiez votre connexion internet et réessayez.",
183+
"generic": "Désolé, j'ai du mal à me connecter en ce moment. Veuillez réessayer plus tard."
184+
}
185+
},
159186
"languages": {
160187
"en": "English",
161188
"es": "Español",
@@ -169,7 +196,7 @@
169196
"tr": "Türkçe",
170197
"it": "Italiano",
171198
"romaji": "Romaji",
172-
"hi": "हिन्दी",
199+
"hi": "हiन्दी",
173200
"ar": "العربية",
174201
"bn": "বাংলা",
175202
"ru": "Русский"

0 commit comments

Comments
 (0)