A hybrid chat application built for the Agma.io community that combines instant local database lookups with generative AI fallback responses.
This project implements a two-tier response system to deliver fast, accurate, and context-aware answers for Agma.io players:
- Local JSON Database (Instant Lookup): - Pre-loaded with detailed information from Agma.io's FAQ and community resources.
- Bypasses the AI entirely when keyword matches are found (e.g., try searching
"secret room").
- Bypasses the AI entirely when keyword matches are found (e.g., try searching
- Gemini API Fallback (AI Layer): - Activates when a query isn't matched in the local JSON file.
- Utilizes custom system instructions designed to keep the chatbot strictly in character within the Agma.io universe.
- Backend / Runtime: Node.js
- Frontend: HTML5, JavaScript, CSS
- AI Integration: Google Gemini API (
gemini-2.5-flash)
For security reasons, the original API key has been removed from the repository. Follow these steps to set up and run the project locally:
- Clone or Extract Project Files:
- Download and extract the project files to your local directory.
- Obtain an API Key:
- Get a Gemini API key from Google AI Studio.
- Configure API Key:
- Open the configuration/environment file in your project.
- Insert your API key into the designated variable.
Pricing Note: The project is optimized for the Gemini 2.5 Flash model. Upgrading to a Pay-As-You-Go plan allows thousands of user queries for just a few cents.
- JSON Database Expansion: Vastly expand the local FAQ database with more game mechanics, strategies, and item details to reduce API calls further.
- Prompt Tuning: Continuously refine the custom system instructions to enhance the bot's witty persona and in-game accuracy.