Skip to content

Repository files navigation

Hybrid AI & FAQ Chatbot

A hybrid chat application built for the Agma.io community that combines instant local database lookups with generative AI fallback responses.


Overview

This project implements a two-tier response system to deliver fast, accurate, and context-aware answers for Agma.io players:

  1. 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").
  2. 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.

Tech Stack

  • Backend / Runtime: Node.js
  • Frontend: HTML5, JavaScript, CSS
  • AI Integration: Google Gemini API (gemini-2.5-flash)

Setup & Configuration

For security reasons, the original API key has been removed from the repository. Follow these steps to set up and run the project locally:

  1. Clone or Extract Project Files:
    • Download and extract the project files to your local directory.
  2. Obtain an API Key:
  3. 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.


Future Improvements

  • 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.

About

It utilizes a local JSON database for instant keyword responses (e.g., FAQ and game tips) and seamlessly falls back to the Google Gemini API (in-character persona) for unanswered queries.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages