Home
Softono
b

brightgir

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
1

Software by brightgir

dota-ai-coach
Open Source

dota-ai-coach

# Dota 2 AI Coach An intelligent AI assistant for Dota 2 that analyzes game situations in real-time and provides tactical advice through an overlay. The system uses RAG (Retrieval-Augmented Generation) for more relevant and well-grounded responses. ![Illustration](dota.jpg) ## Features - ๐ŸŽฎ **Dota 2 Integration** via GSI (Game State Integration) - ๐Ÿค– **AI Provider Support:** Google Gemini and OpenRouter - ๐Ÿ” **RAG System:** Searches relevant information from knowledge base before generating responses - ๐Ÿ’ฌ **Automatic Advice** every N seconds - โ“ **Interactive Questions** directly in-game - โŒจ๏ธ **Hotkey Management** - ๐Ÿ“š **Built-in Knowledge Base** with information about heroes, abilities, items ## Requirements - **Go** 1.24.0+ - **Windows** (uses WinAPI) - **Dota 2** - **API key** from Gemini or OpenRouter ## Installation ```bash # Clone the repository git clone https://github.com/BrightGir/game-ai-helper.git cd GameHelper # Download dependencies go mod tidy ``` ## Configuration ### 1. API Key Create a `.env` file in the project root directory: ```env API_KEY=your_api_key_here MODELS_DIR=storage (or folder where the BERT model will be located) ``` **Where to get an API key:** - **Gemini**: https://makersuite.google.com/app/apikey - **OpenRouter**: https://openrouter.ai/keys (paid models, some free options available) > ๐Ÿ’ก **Tip:** For best results, use advanced models. Free models work well for basic advice. ### 2. Dota 2 GSI Configuration Before using the application, you need to configure Dota 2 to send game data to GameHelper: 1. **Locate your Dota 2 GSI config folder:** ``` C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\game\dota\cfg\gamestate_integration\ ``` > ๐Ÿ’ก **Tip:** If the `gamestate_integration` folder doesn't exist, create it manually. 2. **Create a new file** in this folder named: ``` gamestate_integration_aicoach.cfg ``` 3. **Copy and paste** the following content into the file: ```cfg "Dota 2 Integration Configuration" { "uri" "http://localhost:6000" "timeout" "5.0" "buffer" "0.1" "throttle" "0.1" "heartbeat" "30.0" "data" { "provider" "1" "map" "1" "player" "1" "hero" "1" "abilities" "1" "items" "1" } } ``` 4. **Save the file** and restart Dota 2 if it's already running. ### 3. Application Settings Edit `config.json`: ```json { "local_gsi_port": 6000, "provider": "openrouter", "model": "openai/gpt-4o-mini", "request_interval_seconds": 60, "silence_duration_seconds": 60, "hotkey_turn_overlay": 120, "hotkey_focus_overlay": 121, "minSimilarity": 0.7 } ``` **Parameters:** - `local_gsi_port` โ€” port for GSI server (default 6000) - `provider` โ€” `"gemini"` or `"openrouter"` - `model` โ€” AI model: - **Gemini**: `gemini-2.5-flash`, `gemini-2.5-pro` - **OpenRouter**: `google/gemma-3-27b-it:free`, `meta-llama/llama-3.2-3b-instruct:free`, `openai/gpt-4o-mini` - `request_interval_seconds` โ€” automatic advice interval (seconds) - `silence_duration_seconds` โ€” pause after question before auto-advice (seconds) - `hotkey_turn_overlay` โ€” toggle overlay key (120=F9) - `hotkey_focus_overlay` โ€” focus key (121=F10) - `minSimilarity` โ€” minimum similarity threshold for RAG search (default 0.7) > โš ๏ธ **Important:** Advice quality depends on the model. Advanced models provide significantly better results. ## Usage ๐ŸŽฎ ### First Launch **Development mode:** ```bash go run ./cmd/game-helper ``` **Or build and run:** ```bash # Build go build -o GameHelper.exe ./cmd/game-helper # Run ./GameHelper.exe ``` **What happens on first run:** 1. BERT models for embedding are downloaded (may take a few minutes) 2. Knowledge base is indexed in Chroma DB. 3. You will see overlay 4. Subsequent runs will be faster (uses cache) **Keep the console window open** โ€” closing it will stop the application. ### Starting Dota 2 1. Launch Dota 2 in **Windowed Mode** (Settings โ†’ Video โ†’ Display Mode โ†’ Borderless Window) > โš ๏ธ **IMPORTANT:** Dota 2 **must be running in Windowed Mode** (not Fullscreen) for the overlay to work correctly. ### Using the Overlay The overlay consists of three main areas: 1. **AI Advice Panel** โ€” Shows automatic tactical advice and AI responses 2. **Question Input Field** โ€” Type your questions here 3. **Context Input Field** โ€” Add additional game context/notes ### Hotkeys Reference | Key | Action | Description | |-----|--------|-------------| | `F9` | Toggle Overlay | Show or hide the entire overlay | | `F10` | Focus Overlay | Enable/disable text input mode (allows typing) | | `Enter` | Submit | Send your question or save context | ### How to Ask Questions 1. **Press `F10`** to focus the overlay (you'll see the input fields become active) 2. **Click on the Question Input Field** 3. **Type your question**, for example: - "What items should I buy next?" - "How do I counter this hero?" - "What's the best strategy for this situation?" 4. **Press `Enter`** to send the question 5. The AI will process your question and display the answer in the **AI Advice Panel** ### Adding Game Context You can provide additional context to help the AI give better advice: 1. **Press `F10`** to focus the overlay 2. **Click on the Context Input Field** (bottom section) 3. **Type relevant information**, for example: - "Enemy team has strong magic damage" - "I'm playing as support" 4. This context will be included in all future AI requests ### Automatic Advice The application automatically provides tactical advice every **N seconds** (configured in `config.json` as `request_interval_seconds`, default: 60 seconds). - Advice appears automatically in the **AI Advice Panel** - The system analyzes your current game state (hero, items, abilities, gold, etc.) - Advice pauses for **N seconds** after you ask a manual question (configured as `silence_duration_seconds`) ## Architecture ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Dota 2 Game Client โ”‚ โ”‚ (Sends Game State) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ HTTP POST (JSON) โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ GSI Handler โ”‚ โ”‚ (transport/http_gsi.go) โ”‚ โ”‚ localhost:6000 โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Parser โ”‚ โ”‚ (dota/parser.go) โ”‚ โ”‚ JSON โ†’ GameState โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Store (Thread-safe) โ”‚ โ”‚ (state/store.go) โ”‚ โ”‚ RWMutex + GameState โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ Reads state โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Prompt Handler โ”‚ โ”‚ Overlay (UI) โ”‚ โ”‚ (prompt.go) โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚ (ui/*.go) โ”‚ โ”‚ โ”‚ userPromptChan โ”‚ โ”‚ โ€ข Timer (auto) โ”‚ โ”‚ โ€ข RayLib window โ”‚ โ”‚ โ€ข User questions โ”‚ โ”‚ โ€ข Hotkeys โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ€ข Text input โ”‚ โ”‚ โ”‚ โ€ข GetContextText()โ”‚ โ”‚ Calls Build() โ”‚ (user notes) โ”‚ โ–ผ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ Builder (prompt/builder.go) โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ ContextProvider โ”‚ 1. store.Get() โ†’ GameState โ”‚ (user notes) โ”‚ 2. ctxProvider.GetContextText() โ”‚ โ”‚ 3. Formats: hero, items, โ”‚ โ”‚ abilities, user notes โ”‚ โ”‚ 4. pipeline.Execute() โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ gameContext + question โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Pipeline (prompt/pipeline.go) [RAG SYSTEM] โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ 1. generateSearchQueries() โ”‚ โ”‚ โ”‚ โ”‚ AI request โ†’ JSON with search queries โ”‚โ”€โ”€โ”€โ”€โ–บโ”œโ”€โ”€โ–บ AI Client โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ (Gemini/OpenRouter) โ”‚ โ”‚ โ”‚ โ”‚ โ–ผ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ 2. retrieveKnowledge() โ”‚ โ”‚ โ”‚ โ”‚ Search in vector DB โ”‚โ”€โ”€โ”€โ”€โ–บโ”œโ”€โ”€โ–บ Retriever โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ (BERT + Chroma) โ”‚ โ”‚ โ”‚ โ”‚ โ–ผ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ 3. buildFinalPrompt() โ”‚ โ”‚ โ”‚ โ”‚ knowledge + gameState + question โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ finalPrompt (string) โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ promptChan โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AI Worker (ai_worker.go) โ”‚ โ”‚ โ”‚ โ”‚ fetchAdviceWithRetry(): โ”‚ โ”‚ โ€ข aiProvider.Ask(systemPrompt, finalPrompt) โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”œโ”€โ”€โ–บ AI Client โ”‚ โ€ข Retry logic (3 attempts) โ”‚ (Gemini/OpenRouter) โ”‚ โ€ข Error handling โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ advice (AI response) โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ adviceChan โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Advice Consumer (ai_worker.go) โ”‚ โ”‚ โ”‚ โ”‚ overlay.SetAiAdvice(advice) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Overlay displays โ”‚ โ”‚ advice to user โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ## Project Structure ``` GameHelper/ โ”œโ”€โ”€ cmd/ โ”‚ โ”œโ”€โ”€ game-helper/ # Main application โ”‚ โ”‚ โ”œโ”€โ”€ main.go # Entry point, initialization โ”‚ โ”‚ โ”œโ”€โ”€ app.go # App structure, coordinates all components โ”‚ โ”‚ โ”œโ”€โ”€ ai_worker.go # AI request handler with retry logic โ”‚ โ”‚ โ””โ”€โ”€ prompt.go # Prompt queue and timer management โ”‚ โ””โ”€โ”€ rag/ # RAG system tools โ”‚ โ”œโ”€โ”€ base-knowledge-loader/ # Loads JSON knowledge bases and create chunks with LLM โ”‚ โ”œโ”€โ”€ knowledge-vectorizer/ # Converts text to vectors and saves to assets/rag/knowledge.json โ”‚ โ””โ”€โ”€ prompt-debug/ # Debug tool for running prompt scenarios โ”œโ”€โ”€ internal/ โ”‚ โ”œโ”€โ”€ ai/ # AI provider integration โ”‚ โ”‚ โ”œโ”€โ”€ gemini/ # Google Gemini API client โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ client.go # Sends requests to Gemini API โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ types.go # Request/response structures โ”‚ โ”‚ โ”œโ”€โ”€ openrouter/ # OpenRouter API client โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ client.go # Sends requests to OpenRouter API โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ types.go # Request/response structures โ”‚ โ”‚ โ”œโ”€โ”€ factory/ # Factory for creating AI clients โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ factory.go # Selects client based on config โ”‚ โ”‚ โ”œโ”€โ”€ types.go # Common Client interface โ”‚ โ”‚ โ””โ”€โ”€ errors/ # API error handling โ”‚ โ”‚ โ””โ”€โ”€ errors.go # ShouldRetry, APIError structures โ”‚ โ”œโ”€โ”€ dota/ # Game State Integration (GSI) โ”‚ โ”‚ โ”œโ”€โ”€ parser.go # Parses JSON from Dota 2 โ”‚ โ”‚ โ””โ”€โ”€ types.go # GameState, Hero, Items, Abilities types โ”‚ โ”œโ”€โ”€ prompt/ # AI prompt generation using RAG โ”‚ โ”‚ โ”œโ”€โ”€ builder.go # Composes context from state + knowledge โ”‚ โ”‚ โ”œโ”€โ”€ pipeline.go # RAG pipeline: queries โ†’ search โ†’ prompt โ”‚ โ”‚ โ””โ”€โ”€ templates.go # Text templates for prompts โ”‚ โ”œโ”€โ”€ retriever/ # Knowledge search (RAG component) โ”‚ โ”‚ โ”œโ”€โ”€ retriever.go # Vector search + similarity filtering โ”‚ โ”‚ โ”œโ”€โ”€ bert.go # BERT model initialization โ”‚ โ”‚ โ””โ”€โ”€ types.go # Searcher interface, result types โ”‚ โ”œโ”€โ”€ state/ # Thread-safe game state storage โ”‚ โ”‚ โ””โ”€โ”€ store.go # RWMutex for concurrent access โ”‚ โ”œโ”€โ”€ config/ # Configuration management โ”‚ โ”‚ โ””โ”€โ”€ config.go # Config structure + LoadConfig โ”‚ โ”œโ”€โ”€ transport/ # HTTP handler for GSI data โ”‚ โ”‚ โ””โ”€โ”€ http_gsi.go # Receives POST from Dota 2 โ”‚ โ””โ”€โ”€ ui/ # Graphical overlay (RayLib) โ”‚ โ”œโ”€โ”€ types.go # Overlay structure, UI state โ”‚ โ”œโ”€โ”€ engine.go # Main rendering loop โ”‚ โ”œโ”€โ”€ draw.go # Text rendering โ”‚ โ”œโ”€โ”€ calculator.go # Layout calculations โ”‚ โ”œโ”€โ”€ click.go # Windows API for transparency โ”‚ โ”œโ”€โ”€ input.go # Input handling โ”‚ โ””โ”€โ”€ keyboard.go # Hotkey handling โ”œโ”€โ”€ assets/ # Embedded data and templates โ”‚ โ”œโ”€โ”€ data/ # Knowledge base in JSON โ”‚ โ”œโ”€โ”€ prompts/ # Text templates for prompts โ”‚ โ”‚ โ”œโ”€โ”€ base-coach-system-prompt.txt โ”‚ โ”‚ โ”œโ”€โ”€ bd-queries-generator.txt โ”‚ โ”‚ โ”œโ”€โ”€ final-prompt.txt โ”‚ โ”‚ โ””โ”€โ”€ *.txt โ”‚ โ”œโ”€โ”€ rag/ โ”‚ โ”‚ โ””โ”€โ”€ knowledge.json # Combined knowledge base โ”‚ โ””โ”€โ”€ embed.go # go:embed directives โ”œโ”€โ”€ storage/ # Batches cache and models โ”‚ โ””โ”€โ”€ cache/ # LLM response cache โ”‚ โ”œโ”€โ”€ aghs_desc/ โ”‚ โ”œโ”€โ”€ heroes/ โ”‚ โ””โ”€โ”€ items/ โ”œโ”€โ”€ config.json # Application configuration โ”œโ”€โ”€ .env # API key (create this) โ”œโ”€โ”€ gamestate_integration_aicoach.cfg # Dota 2 GSI config (example) โ”œโ”€โ”€ go.mod โ”œโ”€โ”€ go.sum โ”œโ”€โ”€ README.md โ””โ”€โ”€ LICENSE ``` ## Advanced ### RAG Tools These tools are for developers who want to rebuild or modify the knowledge base. #### Loading Knowledge ```bash go run ./cmd/rag/base-knowledge-loader ``` Loads base knowledge (heroes, items, abilities) from JSON files (dotaconstants, Stratz API) and creates text chunks using LLM. #### Vectorization ```bash go run ./cmd/rag/knowledge-vectorizer ``` Converts text knowledge to BERT vectors and stores them in assets/rag/knowledge.json #### Prompt Debugging ```bash go run ./cmd/rag/prompt-debug ``` Generation of final prompts based on data in internal/prompt/testdata ## License This project is distributed under the [MIT License](LICENSE).

AI Agents Game Analytics Multiplayer & Networking
22 Github Stars