AI² is an autonomous, multi-agent development assistant that lives in Telegram. It writes code, manages state, and persistent context across projects. AI² 是一个运行在 Telegram 中的全自动多智能体开发助手。它可以为您编写代码、管理进度,并支持多项目上下文切换。
- No commands needed: Just say "Write a snake game" or "Switch to calculator".
- Intent Recognition: AI automatically detects if you want to create, switch, or list projects.
- 无需指令:直接说 "写个贪吃蛇" 或 "切换到计算器"。
- 意图识别:AI 自动判断您是想创建项目、切换项目还是查询历史。
- Auto-Save: Project state is saved to
.ai2_context.jsonautomatically. - Switch Anytime: Switch between projects seamlessly (
/switchor "Switch to..."). - Summaries: Get AI-generated recaps of where you left off.
- 自动存档:进度自动保存,重启不丢失。
- 随时切换:不同项目间无缝切换,记忆秒恢复。
- 智能总结:AI 为你生成当前进度的前情提要。
- Roaming Support: Run the bot on your Mac at home, control it from your phone anywhere.
- Conflict Resolution: If you start a new instance, the old one gracefully exits.
- 漫游支持:电脑在家跑,手机随时控。
- 冲突避让:多端启动时自动管理,只有最新实例会运行。
- Supervisor: Plans the roadmap. (项目经理:规划图)
- Worker: Writes the code. (程序员:写代码)
- Tester: Writes aggressive tests to ensure quality. (测试员:写测试找茬)
You must provide your own API keys. 您需要提供自己的 API Key。
- Telegram Bot Token: From @BotFather
- LLM API Key: Anthropic (Claude) or Google (Gemini)
-
Clone the repo / 克隆仓库
git clone https://github.com/your-username/ai2-bot.git cd ai2-bot -
Setup Environment / 配置环境
# Create virtual environment python3 -m venv venv source venv/bin/activate # Install dependencies pip install -r requirements.txt
-
Configure / 配置文件 Copy
.env.exampleto.envand fill in your keys: 复制.env.example为.env并填入密钥:cp .env.example .env nano .env
TELEGRAM_BOT_TOKEN=your_token_here ANTHROPIC_API_KEY=your_key_here # Optional GEMINI_API_KEY=...
-
Run / 运行
python run.py
- Start / 启动: Send
/startor say "Hi". - Create / 创建: Say "Write a web scraper" (写的爬虫).
- Approve / 确认: Bot generates a plan -> Click "Approve" (批准).
- Develop / 开发: Bot writes code -> Runs tests -> Asking for next milestone.
- Finish / 完成: Get the code in
./projectsfolder.
Although you can use natural language, commands are always available for precision. 尽管支持自然语言,您仍可使用指令进行精确控制。
| Command 指令 | Description 描述 | Example 示例 |
|---|---|---|
/new |
Start new project | /new Snake Game |
/list |
List history | /list |
/switch |
Switch project | /switch folder_name |
/open |
Open folder (Local) | /open |
/status |
Check progress | /status |
/stop |
Emergency wait | /stop |
/summary |
Generate recap | /summary |
See DEPLOY.md for Docker deployment instructions. 查看 DEPLOY.md 获取 Docker 部署教程。
License: MIT Author: You