Skip to main content

Agent Team Work - A git-style multi-agent coordination system

Project description

agtw - Agent Team Work

一個類似 Git/Docker CLI 的多智能體協調系統。

PyPI version GitHub

功能特色

  • Session 管理 - 建立、加入、刪除工作階段
  • 多元代理 - Planner(規劃)、Executor(執行)、Evaluator(評估)
  • 安全審查 - Shell 命令由 Guard 代理審查後才執行
  • WebSocket 伺服器 - 持久化連線,支援推播
  • 雙模式 CLI - 支援 One-shot 指令和 REPL 互動模式
  • Session 持久化 - 用戶端自動記憶當前 session

安裝

pip install agtw

或開發模式:

git clone https://github.com/ccc-py/agtw.git
cd agtw
pip install -e ".[dev]"

快速開始

One-shot 模式

# 啟動伺服器
agtw server

# 在另一終端:
agtw session new myproject          # 建立 session
agtw session join myproject         # 加入 session
agtw agent exec "寫一個 hello.py"  # 建立 executor
agtw agent list                     # 列出 agents

REPL 互動模式

agtw shell

[ session] agtw> session new myproject
[myproject] agtw> agent exec "寫 hello"
[myproject] agtw> agent list
[myproject] agtw> exit

指令列表

伺服器

指令 說明
agtw server 啟動 agtw 伺服器

Session 管理

指令 說明
agtw session new [name] 建立新 session
agtw session list 列出所有 sessions
agtw session join <id> 加入 session
agtw session leave 離開目前 session
agtw session delete <id> 刪除 session

Agent 操作

指令 說明
agtw agent list 列出目前 session 的 agents
agtw agent exec <task> 建立 executor
agtw agent eval <desc> 建立 evaluator

其他

指令 說明
agtw planner <prompt> 執行 planner
agtw status 顯示狀態
agtw shell 進入 REPL 互動模式

系統架構

┌─────────────────────────────────────────────────┐
│                   agtw CLI                      │
│         (One-shot 或 REPL 模式)                  │
└─────────────────┬───────────────────────────────┘
                  │ WebSocket
┌─────────────────▼───────────────────────────────┐
│               agtw Server                       │
│  ┌─────────────────────────────────────────┐   │
│  │           SessionManager               │   │
│  │  ┌─────────┐ ┌─────────┐ ┌─────────┐  │   │
│  │  │ Session │ │ Session │ │ Session │  │   │
│  │  │  ┌────┐ │ │  ┌────┐ │ │  ┌────┐ │  │   │
│  │  │  │Planner│ │  │Planner│ │  │Planner│ │  │   │
│  │  │  └────┘ │ │  └────┘ │ │  └────┘ │  │   │
│  │  │  ┌────┐ │ │  ┌────┐ │ │  ┌────┐ │  │   │
│  │  │  │Exec │ │ │  │Exec │ │ │  │Exec │ │  │   │
│  │  │  └────┘ │ │  └────┘ │ │  └────┘ │  │   │
│  │  │  ┌────┐ │ │  ┌────┐ │ │  ┌────┐ │  │   │
│  │  │  │Eval │ │ │  │Eval │ │ │  │Eval │ │  │   │
│  │  │  └────┘ │ │  └────┘ │ │  └────┘ │  │   │
│  │  └────┬────┘ └────┬────┘ └────┬────┘  │   │
│  │       └───────────┼───────────┘       │   │
│  │              ┌────▼────┐               │   │
│  │              │  Guard  │               │   │
│  │              └────┬────┘               │   │
│  └──────────────────┼─────────────────────┘   │
└─────────────────────┼───────────────────────────┘
                      │ Shell Commands
              ┌───────▼───────┐
              │    System     │
              └───────────────┘

代理說明

  • Planner - 分析需求、規劃任務、協調團隊
  • Executor - 執行 Planner 交辦的具體任務
  • Evaluator - 驗證 Executor 的執行結果
  • Guard - 安全審查員,檢查 Shell 命令是否危險

開發指令

# 執行測試
python -m pytest tests/ -v

# 打包上傳 PyPI
python -m build
twine upload dist/*

依賴

  • Python >= 3.10
  • aiohttp >= 3.8.0
  • websockets >= 10.0

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agtw-0.2.2.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agtw-0.2.2-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file agtw-0.2.2.tar.gz.

File metadata

  • Download URL: agtw-0.2.2.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for agtw-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2bcd704139dd2ddbf08679ab4fcdc2b7e866ad32a49a2a894db8618c3269a93f
MD5 eedabd8b83adc8bac7bc1108cab95ba0
BLAKE2b-256 78c7cedf431f4e37b89595416ffb3c2fce5e291216c9fe18e93e1d27ad519454

See more details on using hashes here.

File details

Details for the file agtw-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: agtw-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for agtw-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eabbc65270c81f588c641b025ff756531ca241e37750b6bf38b4fcd98259ef57
MD5 ed594da66a53529df639ceaadb03a1c9
BLAKE2b-256 d98e87df902221b87a22ccaee865bea1ac350bbf4a015ef2508a4853c10e333a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page