I spent one month building an in-game chatbot that maps the active Windows game window to a game-specific vector KB and uses a two-stage flow (intent+rewrite → RAG or wiki) to give grounded answers while keeping it free with Google’s free tier. See the repo on GitHub for code and a demo. GameWiki-ingame chatbot
Why
LLMs often give confident but incorrect game tips, and watching YouTube walkthroughs takes time. A game-specific local knowledge base grounds answers and speeds up finding reliable guides.
What it does (very brief)
- Map active Windows window title → knowledge base name.
- Two-stage API flow:
- Intent classification + query rewrite (wiki vs guide).
- If guide → hybrid RAG (vector + BM25) over the mapped KB, then LLM with retrieved passages. If wiki → fetch/invoke the configured wiki page.
- Hotkey overlay to ask without alt-tabbing.
Pseudocode
# map active window to KB
game_kb = map_window_title(active_window_title)
# stage 1: intent + rewrite
intent, q = intent_and_rewrite(raw_user_query)
if intent == "wiki":
page = open_wiki_page(wiki_url)
else:
vec_hits = vector_search(game_kb, q, k=10)
bm25_hits = bm25_search(game_kb, q, k=10)
hits = fuse_rank(vec_hits, bm25_hits)[:5]
context = concat_passages(hits)
answer = llm_answer_with_context(context, q, instruct_grounded=True)
Repo & try it
Code, indexer scripts, and a demo overlay are on GitHub. The project uses Google Gemini (free-tier) for the AI features and supports quick wiki access + AI Q&A.
Top comments (0)