
NSR-AI 1.1
Gemini + ChatGPT Powered AI Chat for Minecraft: Fast, Smart & Server-Friendly.
Page 1
1.1
3 days ago
1.1
NSR-AI v1.1 - Comprehensive Update
This update introduces significant improvements to configuration management, and a powerful, multi-layered system for handling conversation history, designed for optimal performance and user control.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Configuration Split
For better organization and easier management, the plugin's configuration has been split into two distinct files:
- `config.yml`: This file now contains the core settings for the plugin, such as:
- Admin activation code
- Default AI models (Gemini, Claude, OpenAI)
- Default API provider
- API keys
- `features.yml`: This new file contains all feature-related settings, including:
- Chat colors for the AI and users
- Customizable messages for various events (e.g., API errors, permission denied)
- The system prompt for the AI
- Conversation history length
- Chat prefixes for AI and users
- Code blocker settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Advanced Memory & Caching System
This system provides granular control over conversation history, balancing AI context with server performance.
1. Simple Session Caching (`/ai cache`)
These commands offer quick control over a player's active chat session without involving AI processing. They are ideal for fast resets.
- `/ai cache clear`
- Action: Instantly clears the AI's short-term memory for the specified target.
- Result: The next message will start a completely fresh conversation.
- Usage:
- Player: `/ai cache clear` (Clears your own session)
- Admin: `/ai cache clear <playername>` (Clears a specific player's session)
- Admin: `/ai cache clear all` (Clears all online players' sessions)
- `/ai cache refresh`
- Action: Reloads the most recent conversation from the long-term log files back into the AI's short-term memory for the specified target.
- Result: Allows continuation of a conversation that was previously cleared.
- Usage:
- Player: `/ai cache refresh` (Reloads your own session)
- Admin: `/ai cache refresh <playername>` (Reloads a specific player's session)
- Admin: `/ai cache refresh all` (Reloads all online players' sessions)
2. AI-Powered Memory (`/ai memory`)
This advanced feature uses AI to summarize and compress long conversations, enabling a nearly infinite memory while optimizing resource usage.
- `/ai memory clear` (Summarize and End Session)
- Action: The AI summarizes the current conversation history, and then the session is ended.
- Process: The generated summary is saved to `summarieschat/`. If an old summary existed, it's archived into the main chat log. The AI's short-term memory is then cleared.
- Use Case: To "bank" important information from a conversation as a summary before starting a new topic.
- Usage:
- Player: `/ai memory clear` (Summarizes and ends your own session)
- Admin: `/ai memory clear <playername>` (Summarizes and ends a specific player's session)
- Admin: `/ai memory clear all` (Summarizes and ends all online players' sessions)
- `/ai memory refresh` (Summarize and Continue Session)
- Action: The AI summarizes the current conversation history, and then replaces the detailed history with the summary, allowing the conversation to continue.
- Process: The AI's short-term memory is replaced with a single system message containing the new summary.
- Result: This frees up memory while allowing the AI to "remember" the context of the prior conversation in a compressed form, enabling very long and detailed interactions.
- Use Case: To optimize memory during long, complex conversations without losing context.
- Usage:
- Player: `/ai memory refresh` (Summarizes and continues your own session)
- Admin: `/ai memory refresh <playername>` (Summarizes and continues a specific player's session)
- Admin: `/ai memory refresh all` (Summarizes and continues all online players' sessions)
Important Notes on AI-Powered Memory:
- API Usage: These commands will make calls to the AI API for summarization, incurring usage costs.
- Time: Summarization is a complex task and may take a few moments to complete. These operations are asynchronous to prevent server lag.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Persistent Chat Logging
All conversations and generated summaries are automatically saved to disk, ensuring no chat history is lost. This process is asynchronous to maintain high server performance.
- Log Locations:
- Regular chats: `plugins/NSR-AI/playerchatshistory/`
- Admin-mode chats: `plugins/NSR-AI/adminchatshistory/`
- Latest summaries: `plugins/NSR-AI/summarychat/`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Permissions
- Player Commands: Any player can use `/ai cache clear/refresh` and `/ai memory clear/refresh` for themselves.
- Admin Commands: Commands targeting other players or `all` require the user to be in admin mode.
New Features Added to NSR-AI Plugin
This update introduces several enhancements to the NSR-AI plugin, focusing on improved user experience and maintainability:
- Automatic Update Checker: The plugin now includes an integrated update checker that automatically verifies if you are running the latest version upon startup. This helps ensure you always have access to the newest features and bug fixes.
- New In-Game Version Command: A new command, `/ai version` (or `/ai v`), has been added. Players can use this command to:
- View the current version of the plugin.
- See if their plugin is up-to-date or if a newer version is available.
- Access a list of features included in the latest available version.
- Outdated Version Notifications: If your plugin is outdated, the server console will display a clear notification. Additionally, administrators will receive in-game messages with direct links to download the latest version from official platforms like Modrinth, SpigotMC, and Polymart.
- Cloudflare Worker Integration: The update checking mechanism is powered by a Cloudflare Worker, ensuring efficient and reliable version verification.
- Enhanced Plugin Startup Message: The plugin now features a more visually engaging startup message in the server console, presenting the plugin's name, version, and developer information in a clear and formatted manner.
Recent Feature Enhancements
This section outlines the latest additions and improvements to the NSR-AI plugin:
- Enhanced Command Set:
- `/ai admin <activation_code>`: A fully functional command to toggle administrator mode, allowing access to privileged commands.
- `/ai data <query>`: This command now specifically queries the local knowledge base for answers, reducing reliance on external AI APIs for known information.
- `/ai add <keyword> <heading> <response>`: Allows administrators to add new entries to the plugin's knowledge base directly in-game.
- `/ai remove <keyword>`: Allows administrators to remove entries from the knowledge base directly in-game.
- `/ai reload`: Enables administrators to reload the plugin's configuration without restarting the server.
- API Load Reduction: Implemented a strategy to prioritize responses from the local knowledge base for `/ai data` commands, significantly reducing calls to external AI APIs and minimizing the "model overloaded" issues.
- Improved Plugin Lifecycle Messages: The `onDisable()` message in the server console now provides more informative feedback, indicating whether the plugin disabled gracefully or due to errors.
- Enhanced `/ai add` command:
- New command structure: `/ai add <keyword>, <message_content>`
- AI-generated headings for knowledge base entries based on `message_content`.
- Preview of the knowledge entry (AI-generated heading and message to be saved) displayed to the admin before confirmation.
- Robust `/ai data` command:
- If the AI API call fails for `/ai data` queries, the plugin will now fall back to manually searching the local knowledge base and displaying relevant headings or content.
- Configurable Knowledge Base Output Color:
- New setting `chat-colors.knowledge-base` in `features.yml` to customize the color of knowledge base output.
New Features (from latest update)
This section details the very latest features and improvements:
- Symmetric `add` and `remove` commands: When an admin removes data using `/ai remove <keyword>`, the plugin now displays the content of the removed entry, providing clear confirmation of the action.
- Improved Knowledge Base Search (`/ai data <query>`): The `/ai data <query>` command has been significantly enhanced. It now searches not only the headings but also the *answers* (content) within the knowledge base. If a single, clear match is found, the answer is displayed directly. If multiple matches are found, the user is prompted to refine their query for more specific results.
- Direct Search Results Display: When a clear match is found using `/ai data <query>`, the plugin now directly displays the answer from the knowledge base, rather than just the heading.
- Cleaned-up Heading Display: When adding new knowledge entries, the "Heading (AI-generated):" prefix in the preview message has been removed for a cleaner and more concise output.
- New `/ai data all` Command: A new command, `/ai data all`, has been introduced. This command allows administrators to view all entries currently stored in the knowledge base, including both their headings and content.
- Configurable Knowledge Confirmation: A new setting, `simple-knowledge-yml-approve`, has been added to `features.yml`. This setting controls the confirmation method for adding new knowledge entries:
- If `simple-knowledge-yml-approve` is set to `false` (default), the plugin will continue to provide a unique confirmation code that the admin must use with `/ai confirm <code>`.
- If `simple-knowledge-yml-approve` is set to `true`, the plugin will simplify the confirmation process, requiring the admin to type `/ai confirm yes` to approve the addition.
Granular Command Toggles
This update introduces a highly granular command toggling system, allowing server administrators precise control over individual AI commands directly from the `features.yml` configuration file. Each command or command-related function can now be independently enabled or disabled.
- `command-toggles.data`: Controls the `/ai data` and `/ai data all` commands. When set to `false`, players will be unable to use these commands to query the knowledge base. (Default: `true`)
- `command-toggles.admin`: Controls the `/ai admin` command, which is used to toggle administrator mode. When set to `false`, administrators cannot use this command. (Default: `true`)
- `command-toggles.disable`: Controls the `/ai disable` command, used to disable admin mode. When set to `false`, this command cannot be used. (Default: `true`)
- `command-toggles.version`: Controls the `/ai version` (and `/ai v`) command, which displays plugin version information. When set to `false`, players cannot check the plugin's version. (Default: `true`)
- `command-toggles.add`: Controls the `/ai add` command, used by administrators to add new entries to the knowledge base. When set to `false`, this command is unusable. (Default: `true`)
- `command-toggles.add-confirm`: Controls the confirmation step for the `/ai add` command.
- If `true` (default), administrators will be prompted to confirm the addition of a knowledge entry (either with a code or `/ai confirm yes`).
- If `false`, knowledge entries added via `/ai add` will be instantly saved without requiring a separate confirmation step.
- `command-toggles.remove`: Controls the `/ai remove` command, used by administrators to remove entries from the knowledge base. When set to `false`, this command is unusable. (Default: `true`)
- `command-toggles.remove-confirm`: Controls the confirmation step for the `/ai remove` command.
- If `true` (default), administrators will be prompted to confirm the removal of a knowledge entry (either with a code or `/ai confirm yes`).
- If `false`, knowledge entries removed via `/ai remove` will be instantly deleted without requiring a separate confirmation step.
- `command-toggles.memory-clear`: Controls the `/ai memory clear` command. When set to `false`, this command is unusable. (Default: `true`)
- `command-toggles.memory-refresh`: Controls the `/ai memory refresh` command. When set to `false`, this command is unusable. (Default: `true`)
- `command-toggles.cache-clear`: Controls the `/ai cache clear` command. When set to `false`, this command is unusable. (Default: `true`)
- `command-toggles.cache-refresh`: Controls the `/ai cache refresh` command. When set to `false`, this command is unusable. (Default: `true`)
Enhanced `/ai reload` Command
This update significantly expands the functionality of the `/ai reload` command, providing more granular control over plugin reloads:
- `/ai reload` (default): Reloads the main `config.yml`.
- `/ai reload c` or `/ai reload config`: Reloads only the main `config.yml`.
- `/ai reload f` or `/ai reload features`: Reloads only the `features.yml`.
- `/ai reload k` or `/ai reload knowledge`: Reloads only the knowledge base.
- `/ai reload nsr-ai`: Reloads the entire plugin (configs and knowledge base).
New `/ai help` Command
- `/ai help`: Displays a concise help message with descriptions for all available commands. This message dynamically adjusts to show only commands that are enabled in `features.yml` and accessible to the player (admin commands are only shown to administrators).
- Typing `/ai` without any arguments now defaults to displaying this help message, making it easier for users to discover available commands.
- Tab Completion: The plugin now supports intelligent tab completion for `/ai` commands, suggesting sub-commands and arguments based on context and enabled features.
Addon Enhancements
- Backward Compatibility:
- The addon now supports both NSR-AI plugin version 1.1 and lower versions. This is achieved through a robust compatibility layer that uses reflection to adapt to different API versions at runtime.
- Enhanced Privacy Command (`/ai privacy`):
- Non-Admins: Can now use `/ai privacy <feature> [on|off]` to manage their *own* privacy settings without being prompted for a player name.
- Admins: Can use `/ai privacy <player> <feature> [on|off]` to manage other players' privacy, or `/ai privacy <feature> [on|off]` to manage their own.
- Improved Tab Completion: Basic tab completion for privacy features (`health`, `hunger`, etc.) and `on`/`off` options is now available.
- Player Data Initialization:
- The addon now ensures that player data is correctly initialized and saved when a player joins the server for the first time, preventing "no data" issues for new players.
- Detailed AFK Time Display:
- The `/ai stats` command now provides more detailed information for AFK status, displaying the duration a player has been AFK in minutes, seconds, hours, or days (e.g., "Yes (1h 30m)").
- Version Update:
- The addon's internal version has been updated to `1.0.2`.
Advanced Knowledge Base Search
The knowledge base search has been significantly improved to provide more accurate and relevant results.
- Relevance-Based Scoring: The search now uses a relevance scoring system to rank search results. This ensures that the most relevant entries are prioritized.
- Content and Heading Search: The search now looks for matches in both the heading and the content of the knowledge base entries, providing more comprehensive results.
- Weighted Headings: Matches found in the heading are given a higher weight, as they are more likely to be relevant.
- Fuzzy Search: The search is now more tolerant of "irregular syntax" by splitting the query into individual words and searching for each word.
- Top 5 Results: The search returns the top 5 most relevant results, making it easier for users to find the information they need.
1.1-pre2
13 days ago
Gemini + ChatGPT Powered AI Chat for Minecraft: Fast, Smart & Server-Friendly.
# NSR-AI Plugin - Features (Version 1.1-pre2)
This document provides a detailed description of the features available in the NSR-AI Plugin.
## Core Features
- **AI-Powered Chat:** Engage in intelligent conversations with an AI directly in your Minecraft server.
- **Knowledge Base:** A powerful system to store and retrieve server-specific information, such as rules, event details, and FAQs.
- **Admin Mode:** A dedicated mode for server administrators with access to advanced commands and features.
## Command Structure
- **`/ai <message>`:** For general AI conversations.
- **`/ai data <question>`:** To query the knowledge base for specific information.
- **`/ai admin <your_activation_code>`:** To activate admin mode.
- **`/ai disable`:** To deactivate admin mode.
## Knowledge Base Management (Admin-Only)
- **`/ai add <content>`:** Add new information to the knowledge base. The AI will automatically correct grammar and spelling.
- **`/ai remove <question>`:** Remove entries from the knowledge base.
- **`/ai confirm <code> [keyword]`:** Confirm the addition or removal of knowledge base entries.
## Advanced Features
- **AI-Generated Headings:** When adding to the knowledge base, the AI generates descriptive headings for better organization.
- **Enhanced Fuzzy Matching:** The knowledge base search uses a smart matching algorithm to find relevant information even with varied phrasing.
- **Confirmation System:** A secure, 6-digit code confirmation system for all knowledge base modifications.
- **Automatic Reload:** The knowledge base is automatically reloaded after any changes, ensuring information is always up-to-date.
- **Robust and Stable:** Asynchronous API calls prevent server lag, and a retry mechanism for API calls improves reliability.
- **Clean Chat History:** Chat history is saved in a clean, easy-to-read format.
## How to Use the Knowledge Base
1. **Activate Admin Mode:** `/ai admin <your_activation_code>`
2. **Add Information:**
- `/ai add <content>` (e.g., `/ai add The server rules are available on our website at example.com/rules.`)
- The AI will provide a corrected version of your text and a 6-digit confirmation code.
3. **Confirm Addition:**
- `/ai confirm <code> <keyword>` (e.g., `/ai confirm 123456 rules`)
- The information is now permanently stored in the knowledge base.
4. **Query the Knowledge Base:**
- `/ai data <question>` (e.g., `/ai data what are the server rules?`)
- The AI will retrieve and display the relevant information.
1.1
18 days ago
Page 1