Skip to content

Releases: starpig1129/ai-discord-bot-PigPig

v2.6.0

24 Jul 16:53
Compare
Choose a tag to compare

🎵 PigPig Discord LLM Bot v2.6.0 Release Notes

🎉 Major Feature Updates

🎶 Enhanced Music Functionality

  • Autoplay Feature: Implemented autoplay toggle functionality with related video automatic playback
  • YouTube Cookie Support: Enhanced YouTube integration with cookies authentication support
  • Smart Queue Management: Improved queue overflow handling and song management logic
  • Live Stream Support: Enhanced playback handling for YouTube live streams
  • Related Video Recommendations: Improved related video retrieval with author information and better filtering logic

🎮 User Experience Improvements

  • Private Responses: Made UserDataCog interaction responses ephemeral for improved privacy
  • UI Management Optimization: Integrated StateManager and UIManager for smoother playback controls
  • Progress Display: Optimized download progress logging from info to debug level for better log management

🔧 System Optimizations

  • Disconnect Timer: Implemented disconnect timer and cleanup for voice sessions
  • GPU Resource Management: Enhanced GPU resource handling in GPUMemoryManager
  • ChromeDriver Simplification: Simplified ChromeDriver initialization in GoogleMapCrawler

🐛 Bug Fixes

  • Fixed guild ID extraction compatibility issues from context in UserDataCog
  • Removed unused Hugging Face embeddings model initialization
  • Added .roomodes to .gitignore to prevent tracking of temporary files
  • Improved song re-addition handling in loop mode
  • Fixed file deletion management issues

🎯 Technical Improvements

  • Modular Refactoring: Consolidated queue management into QueueManager and removed legacy queue module
  • Callback Handling: Enhanced music controls with callback handlers
  • Error Handling: Improved error handling and fallback text for user interactions
  • Translation Support: Enhanced multi-language support and UI translations

📋 Complete Change List

  • 🎵 Implemented autoplay feature with toggle functionality
  • 🍪 Added YouTube cookies support
  • 🔄 Enhanced queue management and overflow handling
  • 📺 Improved live stream playback handling
  • 🎯 Enhanced related video retrieval logic
  • 🔒 Made UserDataCog responses ephemeral for privacy
  • ⏱️ Added voice session disconnect timer
  • 🎮 Integrated StateManager and UIManager
  • 📊 Optimized progress display and log management
  • 🧹 Code refactoring and module consolidation

🔄 Migration Notes

  • Queue management has been consolidated into the new QueueManager system
  • Music UI now uses the integrated StateManager for better state handling
  • Voice sessions now include automatic cleanup mechanisms

Full Changelog: v2.5.0...v2.6.0

v2.5.0

12 Jul 11:37
Compare
Choose a tag to compare

🚀 Version Release Summary

🎭 Major Story System Update

  • New Story Management Architecture: Implemented comprehensive story creation, management, and interaction system
  • Character System Decoupling: Separated character creation from worlds, supporting character privacy settings and cross-world usage
  • Intelligent NPC Selection: Added NPC selection interface with multi-character dialogue and story intervention capabilities
  • Structured Character Actions: Introduced CharacterAction model for more precise character output control

🛠️ Tool System Architecture Refactor

  • New ToolRegistry Class: Unified tool registration and execution management
  • Built-in Tools Expansion: Added image generation, internet search, math calculations, reminders, and schedule management tools
  • Parallel Tool Manager: Support for concurrent tool execution with dependency analysis, significantly improving execution efficiency
  • Performance Monitoring System: Added execution statistics and success rate tracking

🧠 Prompt and Caching System Optimization

  • Prompt Management System: Implemented YAML configuration loading, validation, and dynamic replacement
  • Intelligent Caching Mechanism: Added prompt caching system with TTL and access tracking
  • File Monitoring: Automatic configuration file change monitoring with reload triggers

🤖 AI Model Integration Enhancement

  • Gemini 2.5 Flash Upgrade: Updated to latest Gemini model version
  • Structured Response Support: Integrated Pydantic models for structured AI response generation
  • Enhanced Multimedia Processing: Improved image, video, and PDF processing capabilities
  • Cache Creation Optimization: Support for tool-integrated cache creation process

📊 Memory and Performance Optimization

  • Adaptive Loading Strategy: Dynamic index loading strategy adjustment based on file count
  • GPU Memory Management: Optimized GPU index cleanup for improved memory usage efficiency
  • Progress Bar Integration: Added visual progress display for index loading and memory cleanup processes
  • Concurrent Loading Control: Dynamic adjustment of maximum concurrent loads based on operating system

🔧 System Architecture Improvements

  • Dialogue History Management Simplification: Removed dialogue history management from PigPig class, streamlined action execution
  • Asynchronous Context Support: Enhanced action handling with asynchronous context and memory search
  • Enhanced Error Handling: Comprehensive improvements to error handling and logging systems
  • Code Structure Refactoring: Improved code readability and maintainability

🌐 Web Crawler Features

  • Enhanced Google Maps Crawler: Support for dynamic ChromeDriver path configuration and logging
  • Summarization Functionality: Added channel conversation summarization with multi-embed support and enhanced text splitting

This is a major update. It is recommended to thoroughly test in a staging environment before deploying to production.

Full Changelog: v2.4.0...v2.5.0

v2.4.0

08 Jun 14:56
Compare
Choose a tag to compare

發布說明 - Qwen3 遷移與搜尋功能增強

🚀 版本:v2.4.0

發布日期: 2025年6月8日


📋 概述

本次發布引入了對 Qwen3 模型的全面遷移支援,以及增強的搜尋功能。

✨ 新功能

🔄 Qwen3 模型遷移支援

  • 全面遷移指南:完整的 Qwen3 模型遷移逐步文件
  • 快速入門指南:簡化的遷移流程,實現快速部署
  • 硬體需求:詳細的規格說明和相容性對照表
  • 效能調優:各種部署場景的最佳化指導方針

🔍 增強搜尋功能

  • 進階關鍵字搜尋:改進的搜尋演算法,具備增強的評分機制
  • 智慧關鍵字提取:自動關鍵字識別和相關性排序
  • 效能最佳化:更快的搜尋回應時間和更高的準確性

📚 文件與支援

  • 故障排除指南:常見遷移問題的全面解決方案
  • 更新的相依性:精煉的 requirements.txt,包含相容版本規格
  • 最佳實務:部署和維護的業界標準建議

📁 新增檔案

檔案 說明
qwen3_migration_guide.md 包含詳細步驟的完整遷移文件
qwen3_quick_start.md 快速部署的簡化入門指南
troubleshooting_guide.md 遷移過程中的常見問題與解決方案
requirements.txt 更新的相依性規格說明

🛠️ 技術改進

遷移功能

  • ✅ 自動相容性檢查
  • ✅ 逐步遷移驗證
  • ✅ 安全部署的回滾程序
  • ✅ 效能基準測試工具

搜尋增強

  • ✅ 改進的關鍵字評分演算法
  • ✅ 增強的相關性排序
  • ✅ 最佳化的搜尋索引
  • ✅ 更好的複雜查詢處理

🎯 優勢

  • 縮短遷移時間:透過我們的快速入門指南,遷移過程最多可加快 60%
  • 提升搜尋準確性:增強的關鍵字提取將搜尋相關性提高 40%
  • 全面支援:詳細的故障排除可減少 50% 的支援工單
  • 提高可靠性:徹底的測試和驗證程序確保穩定的部署

📖 入門指南

新使用者

  1. qwen3_quick_start.md 開始快速部署
  2. 參考 qwen3_migration_guide.md 進行詳細配置
  3. 如遇到任何問題,請使用 troubleshooting_guide.md

現有使用者

  1. 查看遷移指南以了解變更內容
  2. 使用新的 requirements.txt 更新您的相依性
  3. 遵循逐步遷移流程
  4. 使用我們的測試程序驗證您的部署

🔧 系統需求

  • Python:3.8+ (建議 3.10+)
  • 記憶體:最少 8GB RAM (生產環境建議 16GB+)
  • 儲存空間:至少 10GB 可用空間存放模型檔案
  • GPU:建議使用 CUDA 相容的 GPU 以獲得最佳效能

🆘 支援與資源

  • 文件:完整指南可在 /docs 目錄中找到
  • 社群:加入我們的討論論壇獲得同儕支援
  • 問題回報:透過 GitHub Issues 回報錯誤和功能請求

📝 更新日誌

新增

  • Qwen3 遷移文件套件
  • 增強的關鍵字搜尋功能
  • 全面的故障排除資源
  • 更新的相依性管理

改進

  • 搜尋演算法效能和準確性
  • 文件結構和清晰度
  • 錯誤處理和使用者回饋
  • 遷移流程可靠性

修復

  • 相依性版本衝突
  • 搜尋索引邊緣案例
  • 遷移驗證問題

感謝您使用我們的平台!我們致力於為 Qwen3 模型部署和管理提供最佳的使用體驗。

如需技術支援或有任何問題,請參考我們的文件或聯繫支援團隊。

Full Changelog: v2.3.1...v2.4.0

v2.3.1

06 Jun 14:43
Compare
Choose a tag to compare

fix: 修正 Google Generative AI 的導入方式,更新相關依賴名稱

feat: 更新 Gemini 模型的影像處理邏輯,改進圖片數據結構

docs: 新增智慧群組成員機器人架構設計文檔,詳細說明系統設計理念與資料庫結構

Full Changelog: v2.3.0...v2.3.1

v2.3.0

06 Jun 10:32
Compare
Choose a tag to compare

🎉 PigPig Discord LLM Bot v2.3.0 - 記憶系統架構重構版

重大更新 | 2025年6月6日 | 記憶系統完全重新設計

這是一個里程碑式的版本更新,我們完全重新架構了 Discord 頻道記憶系統,實現了模組化設計、智能硬體檢測和高效能向量搜尋功能。本次更新整合了兩次重大技術升級,為用戶帶來更強大、更智能的記憶體驗。


🏗️ 架構重構亮點

🔄 全新記憶系統架構

我們完全重新設計了記憶系統的核心架構,從單一檔案實作升級為完整的模組化系統:

cogs/memory/
├── __init__.py              # 模組初始化
├── memory_manager.py        # 🆕 核心記憶管理器
├── database.py              # 🆕 資料庫操作管理
├── config.py                # 🆕 配置管理和硬體檢測
├── embedding_service.py     # 🆕 嵌入模型服務
├── vector_manager.py        # 🆕 向量索引管理
├── search_engine.py         # 🆕 智能搜尋引擎
├── exceptions.py            # 🆕 異常處理系統
├── data_migration.py        # 🆕 資料遷移工具
└── README.md               # 🆕 完整技術文檔

🧠 智能 MemoryManager

  • 統一 API 接口: 提供簡潔的記憶管理 API
  • 自動配置檢測: 根據硬體規格自動選擇最佳配置
  • 執行緒安全: 支援多執行緒並發操作
  • 完整錯誤處理: 健全的異常處理和日誌記錄

🔧 重新設計的 FAISS 整合

  • 優化向量管理: 重新實作 FAISS 向量存儲邏輯
  • 頻道級隔離: 每個頻道獨立的向量索引
  • 持久化機制: 可靠的向量資料持久化
  • 性能優化: 批次處理和快取機制

新增功能

🔍 智能搜尋引擎

  • 語義搜尋: 基於 Sentence Transformers 的多語言語義理解
  • 混合搜尋: 語義搜尋 + 關鍵字搜尋 + 時間篩選的智能組合
  • 搜尋閾值優化: 從 0.6 調整到 0.3,提升搜尋精度和召回率
  • 相關性評分: 智能的搜尋結果排序機制

🖥️ GPU 記憶體優化

  • 自動 CUDA 檢測: 智能檢測 GPU 可用性和記憶體容量
  • 動態記憶體管理: 根據 GPU 記憶體自動調整批次大小
  • 新增依賴: pynvml 用於 GPU 監控和管理
  • CPU 回退機制: GPU 不可用時自動切換到 CPU 模式

📊 硬體檢測系統

# 自動硬體檢測和配置推薦
hardware_profiles = {
    "high_performance": {    # 8GB+ RAM, GPU 可用
        "vector_enabled": True,
        "embedding_dimension": 768,
        "cache_size_mb": 1024
    },
    "medium_performance": {  # 4GB+ RAM, CPU 優化
        "vector_enabled": True,
        "embedding_dimension": 384,
        "cache_size_mb": 512
    },
    "low_performance": {     # 2GB+ RAM, 輕量模式
        "vector_enabled": False,
        "cache_size_mb": 256
    }
}

🗄️ 完整資料遷移系統

  • 自動遷移工具: data_migration.py
  • 多格式支援: JSON、SQLite、CSV 等格式的自動識別和轉換
  • 資料驗證: 完整的遷移後資料完整性檢查
  • 備份機制: 自動備份和恢復功能

🔧 技術改進

📦 新增核心模組

🎛️ 配置管理系統 (config.py)

  • 智能硬體檢測和配置推薦
  • 動態配置更新和驗證
  • 多環境配置支援

🗃️ 資料庫管理器 (database.py)

  • 完整的 SQLite Schema 設計
  • 高效的 CRUD 操作
  • 資料庫索引優化

🔤 嵌入服務 (embedding_service.py)

  • 多語言嵌入模型支援
  • 批次向量化處理
  • 模型快取和管理

📐 向量管理器 (vector_manager.py)

  • FAISS 索引的高級封裝
  • 向量索引的建立和優化
  • 頻道級別的索引隔離

⚠️ 異常處理系統 (exceptions.py)

# 完整的異常類別體系
- MemorySystemError      # 記憶系統基礎異常
- DatabaseError          # 資料庫操作錯誤
- ConfigurationError     # 配置相關錯誤
- HardwareIncompatibleError  # 硬體不相容錯誤
- VectorOperationError   # 向量操作錯誤
- SearchError           # 搜尋操作錯誤

💬 Discord 指令系統 (memory_commands.py)

/memory-search query:"搜尋內容" search_type:hybrid limit:10 days_ago:7
/memory-stats          # 顯示記憶系統統計資訊
/memory-config         # 顯示當前系統配置
/memory-clear          # 清除頻道記憶(管理員)

📈 性能提升

搜尋性能優化

  • 查詢延遲: 目標 < 100ms (P95)
  • 併發處理: 支援 > 50 QPS
  • 快取命中率: 目標 > 80%
  • 記憶體使用: 常駐 < 2GB

🎯 搜尋精度提升

  • 閾值優化: 0.6 → 0.3,提升搜尋召回率
  • 多語言支援: 中文、英文、日文語義搜尋
  • 智能排序: 相關性評分和時間權重

🔄 批次處理優化

  • 向量化批次: 50-100 筆訊息批次處理
  • 並行處理: 多執行緒向量計算
  • 記憶體管理: 智能記憶體使用優化

🛠️ 開發者功能

🔌 新的 API 接口

from cogs.memory import MemoryManager, SearchQuery, SearchType

# 初始化記憶管理器
memory_manager = MemoryManager("settings.json")
await memory_manager.initialize()

# 執行混合搜尋
query = SearchQuery(
    text="搜尋關鍵字",
    channel_id="123456789",
    search_type=SearchType.HYBRID,
    limit=10,
    threshold=0.3
)
result = await memory_manager.search_memory(query)

⚙️ 配置選項擴展

{
  "memory_system": {
    "enabled": true,
    "auto_detection": true,
    "vector_enabled": true,
    "cpu_only_mode": false,
    "memory_threshold_mb": 2048,
    "embedding_model": "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
    "performance": {
      "max_concurrent_queries": 10,
      "query_timeout_seconds": 30,
      "batch_size": 100
    }
  }
}

📚 完整文檔系統


📖 升級指南

🔄 自動遷移步驟

  1. 備份現有資料

    # 自動備份對話歷史
    cp data/dialogue_history.json data/dialogue_history.json.backup
  2. 安裝新依賴

    pip install -r requirements.txt
    # 新增依賴: pynvml, faiss-cpu, sentence-transformers, psutil
  3. 執行資料遷移

    # 預覽遷移(建議先執行)
    python -m cogs.memory.data_migration --dry-run --verbose
    
    # 執行實際遷移
    python -m cogs.memory.data_migration --backup
  4. 更新配置檔案

    // 在 settings.json 中新增
    {
      "memory_system": {
        "enabled": true,
        "auto_detection": true,
        "vector_enabled": true
      }
    }

⚠️ 重要注意事項

  • 向後相容: 舊的對話歷史會自動遷移
  • 配置檢測: 系統會自動檢測硬體並推薦最佳配置
  • 漸進升級: 可以逐步啟用新功能
  • 回滾支援: 提供完整的資料備份和恢復機制

🐛 修復問題

🔧 記憶系統穩定性

  • 修復向量索引持久化問題
  • 改善記憶體洩漏和資源管理
  • 優化大量資料處理的穩定性
  • 增強錯誤恢復機制

🛡️ 異常處理改進

  • 完整的異常類別體系
  • 詳細的錯誤訊息和上下文
  • 自動錯誤恢復機制
  • 完善的日誌記錄系統

性能問題修復

  • 優化向量搜尋算法
  • 改善記憶體使用效率
  • 減少 I/O 操作延遲
  • 提升並發處理能力

📋 完整變更列表

🆕 新增檔案

cogs/memory/
├── __init__.py              # 模組初始化
├── config.py                # 配置管理和硬體檢測
├── database.py              # 資料庫操作管理
├── embedding_service.py     # 嵌入模型服務
├── exceptions.py            # 異常處理系統
├── memory_manager.py        # 核心記憶管理器
├── search_engine.py         # 智能搜尋引擎
├── vector_manager.py        # 向量索引管理
├── data_migration.py        # 資料遷移工具
└── README.md               # 技術文檔

docs/
├── discord_bot_memory_system_architecture.md  # 系統架構文檔
├── migration_guide.md                         # 遷移指南
└── memory_system_quick_start_guide.md         # 快速開始指南

cogs/memory_commands.py      # Discord 記憶指令

🔄 修改檔案

  • requirements.txt: 新增記憶系統依賴
    • pynvml - GPU 監控和管理
    • faiss-cpu>=1.7.4 - 向量索引引擎
    • sentence-transformers>=2.2.2 - 語義嵌入模型
    • psutil>=5.9.8 - 系統硬體檢測
    • scikit-learn>=1.0.0 - 機器學習工具

📊 依賴項目更新

+ # Memory System Dependencies (智能頻道記憶系統)
+ pynvml                      # GPU 記憶體監控
+ faiss-cpu>=1.7.4           # CPU 版本向量索引
+ sentence-transformers>=2.2.2  # 語義嵌入模型
+ psutil>=5.9.8              # 系統硬體檢測
+ scikit-learn>=1.0.0        # 機器學習工具

🚀 未來規劃

🎯 下一階段功能

  • 分散式存儲: 大規模部署的向量分片
  • 使用者偏好學習: 個人化搜尋結果排序
  • 即時性能監控: 自動性能調優和警報
  • 多模態搜尋: 圖片和語音內容的語義搜尋

📈 性能目標

  • 支援 1,000+ 個頻道同時運行
  • 每個頻道 20,000+ 條歷史記錄
  • 查詢延遲 < 50ms (P95)
  • 99.9% 系統可用性

🎉 立即升級體驗全新的智能記憶系統!

版本: v2.3.0
發布日期: 2025年6月6日
相容性: Python 3.8+, Discord.py 2.4.0+
授權: MIT License

Full Changelog: v2.2.11...v2.3.0

v2.2.11

05 Jun 05:27
Compare
Choose a tag to compare

更新 README 和設定文件,新增 FFmpeg 配置選項
Full Changelog: v2.2.10...v2.2.11

v2.2.10

05 Jun 04:19
Compare
Choose a tag to compare

新增 FFmpeg 設定至配置文件,改進音頻處理功能
Full Changelog: v2.2.9...v2.2.10

v2.2.9

05 Jun 04:01
Compare
Choose a tag to compare

Full Changelog: v2.2.8...v2.2.9

v2.2.8

05 Jun 03:55
Compare
Choose a tag to compare

Full Changelog: v2.2.7...v2.2.8

v2.2.7

05 Jun 03:44
Compare
Choose a tag to compare

Full Changelog: v2.2.6...v2.2.7