Files
QQbot/README.md
Mimikko-zeus a754e7843f Refactor configuration and enhance AI capabilities
Updated .env.example to improve clarity and added new configuration options for memory and reliability settings. Refactored main.py to streamline the bot's entry point and improved error handling. Enhanced README to reflect new features and command structure. Removed deprecated cmd_zip_skill and skills_creator modules to clean up the codebase. Updated AIClient and MemorySystem for better performance and flexibility in handling user interactions.
2026-03-03 21:56:33 +08:00

74 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# QQbot (Memory + Persona Core)
QQ 机器人项目,保留并强化两大核心能力:
- `Memory`:短期/长期记忆、检索、清理、会话作用域
- `Persona`角色配置、作用域优先级session > group > user > global
## 主要能力
- 多模型配置与运行时切换:`/models`
- 人设管理:`/personality`
- 记忆管理:`/memory``/clear`
- QQ 消息安全输出:自动清理 Markdown/URL
- 工程增强:消息去重、失败重试、权限边界、结构化日志
## 快速开始
1. 安装依赖
```bash
pip install -r requirements.txt
```
2. 配置环境变量
```bash
copy .env.example .env
```
3. 启动
```bash
python main.py
```
## 命令
- 基础
- `/help`
- `/clear` `/clear short` `/clear long` `/clear all`
- 人设
- `/personality`
- `/personality list`
- `/personality set <key> [global|user|group|session]`
- `/personality add <name> <Introduction>`
- `/personality remove <key>`
- 模型
- `/models`
- `/models current`
- `/models add <model_name>`
- `/models add <key> <provider> <model_name> [api_base]`
- `/models switch <key|index>`
- `/models remove <key|index>`
- 记忆
- `/memory`
- `/memory get <id>`
- `/memory add <content|json>`
- `/memory update <id> <content|json>`
- `/memory delete <id>`
- `/memory search <query> [limit]`
## 关键配置
- `AI_MEMORY_SCOPE=user|session`:记忆作用域
- `BOT_ADMIN_IDS`:管理员白名单(逗号分隔)
- `AI_CHAT_RETRIES` / `AI_CHAT_RETRY_BACKOFF_SECONDS`:聊天失败重试
- `MESSAGE_DEDUP_SECONDS` / `MESSAGE_DEDUP_MAX_SIZE`:消息去重窗口
- `LOG_FORMAT=text|json`:日志输出格式
## 测试
```bash
pytest -q
```