团队协作型AI助手 - Team Collaboration AI Assistant
Project description
TeamBot - 团队协作型AI助手
🤖 一个面向团队协作的执行力强、记忆力极强、运行稳定的本地桌面端AI助手。 支持 Windows / macOS / Linux,系统托盘后台运行。 Open Interpreter 风格执行引擎 + 三层记忆系统 + 多Agent架构 + 多平台接入。
🌟 核心特性
🚀 执行引擎
- 多语言执行: Python / Shell (Bash) / PowerShell / CMD
- 安全控制: 危险命令拦截、超时控制、输出截断
- 结构化结果: 执行结果标准化,LLM 稳定理解
🧠 三层记忆系统
- 短期记忆: 对话上下文,自动淘汰旧消息
- 工作记忆: 任务进度、执行步骤、中间结果
- 长期记忆: 用户偏好、技能经验、错误模式
- SQLite 持久化: 本地存储,支持跨会话检索
🤝 多Agent架构
- 主Agent: 任务规划、Agent调度、结果汇总
- 工具Agent: 代码执行、技能调用、文件操作
- 记忆Agent: 记忆读写、经验总结、错误记录
- 计划-执行-反思循环: 自动迭代直到完成
👥 团队协作
- 多角色协同: 支持团队成员间的Agent任务分配与协作
- 知识共享: 团队记忆库,共享技能与经验
- AICQ加密通信: 端到端加密的团队消息通道
- 部门管理: 按部门组织Agent,权限隔离
💬 多聊天平台接入
- Telegram: 官方 Bot API
- Discord: discord.py
- 飞书: Webhook 长连接
- QQ: OneBot v11 协议
- 微信: WxPusher / HTTP 桥接
- 纯 Python 实现,无需 Node.js
🛠️ 技能系统 (OpenClaw 兼容)
- 文件操作: 读写、搜索、移动、删除
- 网络搜索: DuckDuckGo 免API搜索
- 系统操作: 信息查询、进程管理、环境变量
- 浏览器自动化: Playwright 驱动
- JSON Schema 定义,支持 LLM Function Calling
🛡️ 稳定性保障
- 任务队列机制 (优先级调度)
- 执行超时控制
- 异常捕获与自动恢复
- LLM 输出 JSON 格式强校验
- 无 HTTP 网关、单机原生运行
📱 系统托盘
- 后台静默运行
- 开机自启支持
- 日志目录快捷访问
- 可打包为 exe / dmg
🚀 一键安装
💡 无需手动安装 Python、Node.js 等依赖,脚本会自动检测并安装所有前置条件。仅复制一行命令即可完成安装。
pip 安装 (推荐)
pip install teambot-ai
Windows(PowerShell)
powershell -c "irm https://raw.githubusercontent.com/ctz168/teambot/main/install/install.ps1 | iex"
首次运行时如果 PowerShell 提示执行策略限制,先执行:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/ctz168/teambot/main/install/install.sh | bash
快速升级
已安装过 TeamBot 的环境下,一行命令更新到最新版:
teambot-ai update
该命令会自动完成:npm 升级全局包 → 检查新增依赖 → 自动启动。
📋 系统要求
| 项目 | 最低要求 | 推荐配置 |
|---|---|---|
| 操作系统 | Windows 10 / macOS 12 / Ubuntu 20.04 | Windows 11 / macOS 14 / Ubuntu 24.04 |
| Python | 3.13+ | 3.13+ |
| Node.js | 18+ (LTS) | 20+ (LTS) |
| 内存 | 512 MB | 2 GB+ |
| 磁盘空间 | 200 MB | 500 MB+ |
安装脚本会自动检测并安装 Python 3.13 和 Node.js 20 LTS,你不需要提前准备任何环境。
⚙️ 安装后配置
安装完成后,运行 teambot-ai 即可启动。首次运行会自动创建配置文件 ~/.teambot/config.json。
1. 配置 LLM
方式一: 环境变量 (推荐)
export TEAMBOT_LLM_API_KEY="sk-your-openai-key"
export TEAMBOT_LLM_MODEL="gpt-4"
方式二: 配置文件
# 首次运行会自动创建 ~/.teambot/config.json
teambot-ai
方式三: 使用 Ollama 本地模型 (免费)
# 安装 Ollama
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull llama3
# 配置
export TEAMBOT_LLM_PROVIDER="ollama"
export TEAMBOT_OLLAMA_MODEL="llama3"
方式四: 使用 Anthropic Claude
export TEAMBOT_LLM_PROVIDER="anthropic"
export TEAMBOT_ANTHROPIC_API_KEY="sk-ant-..."
2. 运行
# 更新到最新版(推荐)
teambot-ai update
# Web 管理后台(推荐)
teambot-ai web
# CLI 交互模式
teambot-ai cli
# 系统托盘后台运行
teambot-ai tray
# API 服务模式
teambot-ai server
# 安装/更新依赖
teambot-ai install
# 重装依赖(删除 venv 重建)
teambot-ai reinstall
# 卸载(清除所有数据)
teambot-ai uninstall
# 卸载但保留数据(配置、记忆等)
teambot-ai uninstall --keep-data
首次运行会自动安装所有依赖,后续启动秒开。
3. 配置聊天平台 (可选)
编辑 ~/.teambot/config.json:
{
"llm": {
"provider": "openai",
"api_key": "sk-...",
"model": "gpt-4"
},
"chat_platforms": [
{
"platform": "telegram",
"enabled": true,
"token": "YOUR_BOT_TOKEN"
},
{
"platform": "discord",
"enabled": true,
"token": "YOUR_DISCORD_BOT_TOKEN"
}
]
}
或使用环境变量:
export TEAMBOT_TELEGRAM_TOKEN="your-telegram-bot-token"
export TEAMBOT_DISCORD_TOKEN="your-discord-bot-token"
💡 使用示例
CLI 交互
👤 你: 帮我在桌面创建一个 hello.py 文件
🤖 助手: ✅ 已在桌面创建 hello.py
👤 你: 搜索最新的Python 3.12新特性
🤖 助手: [搜索结果...]
👤 你: 查看系统信息
🤖 助手: 系统: macOS 14.0 | CPU: 8核 | 内存: 12.3GB可用
CLI 内置命令
| 命令 | 说明 |
|---|---|
help |
显示帮助 |
status |
查看系统状态 |
skills |
列出所有技能 |
memory |
查看记忆统计 |
sessions |
查看会话列表 |
session <id> |
切换会话 |
clear |
清除当前对话历史 |
quit |
退出 |
技能调用
# 直接调用技能
👤 你: !system_info
👤 你: !file_read path=/tmp/test.txt
👤 你: !web_search query=AI news
🏗️ 扩展开发
添加自定义技能
# aiskills/my_skill.py
from aiskills.base import Skill, SkillResult, SkillParameter
class MyCustomSkill(Skill):
name = "my_skill"
description = "我的自定义技能"
category = "custom"
parameters = [
SkillParameter("input", "string", "输入参数", required=True),
]
async def execute(self, input: str = "", **kwargs) -> SkillResult:
# 你的逻辑
return SkillResult(
success=True,
data={"result": input.upper()},
message=f"处理完成: {input}",
)
技能会自动被发现和注册 (命名规则: *_skill.py)。
添加自定义聊天平台
# chatbot/my_platform_bot.py
from chatbot.base import BaseChatBot, ChatMessage, ChatResponse
class MyPlatformBot(BaseChatBot):
platform_name = "my_platform"
async def start(self):
# 实现启动逻辑
pass
async def stop(self):
pass
async def send_message(self, response: ChatResponse) -> bool:
pass
然后在 chatbot/manager.py 中注册即可。
📦 打包
Windows (exe)
pip install pyinstaller
pyinstaller --onefile --windowed --icon=icon.ico \
--add-data "aiskills:aiskills" \
--add-data "chatbot:chatbot" \
--name TeamBot main.py
macOS (dmg)
pyinstaller --onefile --windowed --icon=icon.icns \
--add-data "aiskills:aiskills" \
--name TeamBot main.py
# 然后使用 hdiutil 创建 dmg
⚙️ 环境变量参考
| 变量 | 说明 | 默认值 |
|---|---|---|
TEAMBOT_LLM_PROVIDER |
LLM 提供商 | openai |
TEAMBOT_LLM_API_KEY |
API Key | - |
TEAMBOT_LLM_BASE_URL |
API 地址 | OpenAI 官方 |
TEAMBOT_LLM_MODEL |
模型名称 | gpt-4 |
TEAMBOT_LLM_TEMPERATURE |
温度 | 0.1 |
TEAMBOT_TELEGRAM_TOKEN |
Telegram Bot Token | - |
TEAMBOT_DISCORD_TOKEN |
Discord Bot Token | - |
TEAMBOT_FEISHU_APP_ID |
飞书 App ID | - |
TEAMBOT_FEISHU_APP_SECRET |
飞书 App Secret | - |
TEAMBOT_LOG_LEVEL |
日志级别 | INFO |
🔗 相关链接
- 官方网站: https://teambot.samai.cc
- GitHub: https://github.com/ctz168/teambot
- PyPI: https://pypi.org/project/teambot-ai
📄 License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file teambot_ai-1.49.0.tar.gz.
File metadata
- Download URL: teambot_ai-1.49.0.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abddb4803186fa5ae95d6536a00a59b87140bcd645eb85124a06ff55c7d27106
|
|
| MD5 |
f7e9e5e33fb8cb443eb776e0167d6e4a
|
|
| BLAKE2b-256 |
b66bece92b5d99b2cd0540ec302f6d1509f9cf643d6009bf20aff81d1058ad2c
|
File details
Details for the file teambot_ai-1.49.0-py3-none-any.whl.
File metadata
- Download URL: teambot_ai-1.49.0-py3-none-any.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
004b33860393974ae2edce9cecd4c1dc63704a9bfb41471526acedf44a809698
|
|
| MD5 |
f30bec209e8ce24576b7d26e10511c18
|
|
| BLAKE2b-256 |
f500707875856fa0088ec8b8744e0f09e167e73486b558b5e25fa23ae6e38fc3
|