轻量级个人 AI 助手框架 | Go 版本
QuickBot-Python 是一个功能完整的 AI 助手框架,让你轻松构建自己的智能助手。
- 🤖 多 AI 提供商 - 支持 OpenAI、Anthropic、Ollama(本地模型)
- 📱 多平台支持 - Telegram、Discord、Slack
- 💾 智能内存管理 - 会话记忆 + 长期记忆(SQLite)
- ⏰ 任务调度系统 - 支持一次性任务和周期性任务(Cron 表达式)
- 🔧 可扩展工具系统 - 内置文件、Shell、计算工具,支持自定义扩展
- 🛡️ 安全特性 - API 密钥加密、用户验证、日志审计
QuickBot 生态系统
│
├─ 核心层
│ ├─ Agent (AI 代理)
│ ├─ Memory (内存管理)
│ ├─ Scheduler (任务调度)
│ └─ Tools (工具系统)
│
├─ AI 层
│ ├─ OpenAI Provider
│ ├─ Anthropic Provider
│ └─ Ollama Provider
│
└─ 平台层
├─ Telegram
├─ Discord
└─ Slack
- Python 3.8 或更高版本
- pip 包管理器
- SQLite 3
# 1. 克隆仓库
git clone https://github.com/Chang-Augenweide/QuickBot-Python.git
cd QuickBot-Python
# 2. 安装依赖
pip install -r requirements.txt
# 3. 初始化配置
cp config.example.yaml config.yaml
nano config.yaml
# 4. 运行 QuickBot
python cmd/quickbot/main.py# Bot 基本信息
bot:
name: QuickBot
debug: false
timezone: Asia/Shanghai
# AI 提供商配置
ai:
provider: openai # openai, anthropic, ollama
api_key: your_api_key_here
model: gpt-4o
temperature: 0.7
# 平台配置
platforms:
telegram:
enabled: true
token: your_telegram_bot_token
allowed_users: [] # 空数组允许所有用户
# 内存管理
memory:
enabled: true
max_messages: 1000
storage: memory.db
# 任务调度
scheduler:
enabled: true
storage: scheduler.db| 命令 | 说明 | 示例 |
|---|---|---|
/help |
显示帮助信息 | /help |
/status |
查看系统状态 | /status |
/remind |
设置提醒 | /remind 14:30 下午开会 |
/memory |
存储或检索信息 | /memory set name 张三 |
/tasks |
查看任务列表 | /tasks |
创建自定义工具非常简单:
from internal.tools.tools import ToolBase
class MyCustomTool(ToolBase):
"""自定义工具示例"""
def get_schema(self):
return {
'name': 'my_tool',
'description': '我的自定义工具',
'parameters': {
'type': 'object',
'properties': {
'text': {'type': 'string', 'description': '输入文本'}
},
'required': ['text']
}
}
async def execute(self, text: str) -> str:
# 实现你的逻辑
result = f"处理结果: {text}"
return result将工具文件保存到 tools/ 目录,QuickBot 会自动加载。
QuickBot-Python 提供以下内置工具:
| 工具名 | 功能 | 权限 |
|---|---|---|
file_read |
读取文件内容 | owner |
file_write |
写入文件 | owner |
shell_exec |
执行 shell 命令 | owner |
calculator |
数学计算 | allow_all |
weather |
查询天气 | allow_all |
translator |
文本翻译 | allow_all |
QuickBot-Python 经过优化,可支持:
- 100+ 同时在线用户
- 1000+ 每分钟消息处理
- <500ms 平均响应时间
- 使用本地 AI 模型(Ollama)降低延迟
- 配置合理的内存过期时间
- 定期清理 SQLite 数据库
# 检查 Python 版本
python --version
# 如果版本低于 3.8,使用 pyenv 安装
pyenv install 3.11.0
pyenv global 3.11.0# 使用虚拟环境
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt# 删除损坏的数据库文件
rm memory.db scheduler.db
# 重启 QuickBot,会自动创建新数据库
python cmd/quickbot/main.py欢迎贡献代码!
- Fork 本仓库
- 创建功能分支 (
git checkout -b feature/amazing-feature) - 提交更改 (
git commit -m 'Add amazing feature') - 推送到分支 (
git push origin feature/amazing-feature) - 创建 Pull Request
查看 CHANGELOG.md 了解详细的版本更新。
- QuickBot-Go - Go 语言版本实现
- QuickBot 原版](https://github.com/Chang-Augenweide/QuickBot) - 已归档,请使用新仓库
本项目采用 MIT License 开源。
感谢以下开源项目: