A high-performance Agent subsystem for complex multi-agent orchestration. It provides a visual workflow canvas (OASIS) to coordinate OpenClaw agents, automated computer use tasks, and real-time monitoring via a dedicated Web UI. Supports Telegram/QQ bot integrations and Cloudflare Tunnel for secure remote access.
https://github.com/Avalon-467/Teamclaw
TeamClaw is an OpenClaw-like multi-agent sub-platform with a built-in lightweight agent (similar to OpenClaw's), featuring computer use capabilities and social platform integrations (e.g., Telegram). It can run independently without blocking the main agent, or be directly controlled by an OpenClaw agent to orchestrate the built-in OASIS collaboration platform. It also supports exposing the frontend to the public internet via Cloudflare, enabling remote visual multi-agent workflow programming from mobile devices or any browser.
TeamClaw is a versatile AI Agent service providing:
All scripts are located in selfskill/scripts/, invoked uniformly via the run.sh entry point, all non-interactive.
CODEBLOCK0
All commands are executed in the project root directory.
Three-step launch flow: setup → configure → start
CODEBLOCK1
⚠️ You MUST create at least one user account before starting the service!
- - The Web UI login page requires username + password.
- All API calls require
Authorization: Bearer <user_id>:<password>(orINTERNAL_TOKEN:<user_id>).- If you skip this step, you will be locked out of the entire system.
- You can create multiple users. The first argument is the username, the second is the password.
CODEBLOCK2
| Component | How it starts | Configuration needed | Notes |
|---|---|---|---|
| Bark Push (port 58010) | Automatically started by INLINECODE7 | None — works out of the box | A standalone binary (bin/bark-server). Auto-downloaded on first setup. No env vars needed. |
| Telegram Bot |
TELEGRAM_BOT_TOKEN, TELEGRAM_ALLOWED_USERS in .env | launcher.py calls chatbot/setup.py which has an interactive menu (input()). In headless/background mode this will block. To avoid blocking, configure the bot tokens in .env beforehand and start the bot separately: nohup python chatbot/telegrambot.py > logs/telegrambot.log 2>&1 & |
| QQ Bot | Requires manual setup | QQ_APP_ID, QQ_BOT_SECRET, QQ_BOT_USERNAME in .env | Same as Telegram — interactive setup will block in headless mode. Start separately: nohup python chatbot/QQbot.py > logs/qqbot.log 2>&1 & |
⚠️ Important for Agent/headless usage: The
chatbot/setup.pyscript contains interactiveinput()prompts. Whenlauncher.pyruns in the background (viarun.sh start), ifchatbot/setup.pyexists it will be called and block indefinitely waiting for user input. To prevent this:
- 1. Either remove/rename
chatbot/setup.pybefore starting, OR- Pre-configure all bot tokens in
.envand start bots independently (bypassingsetup.py).
CODEBLOCK3
| Option | Description | Default |
|---|---|---|
| INLINECODE31 | LLM API key (required) | |
| INLINECODE32 |
https://api.deepseek.com |
| LLM_MODEL | Model name | deepseek-chat |
| LLM_PROVIDER | Provider (google/anthropic/deepseek/openai, auto-inferred) | Auto |
| LLM_VISION_SUPPORT | Vision support (auto-inferred) | Auto |
| PORT_AGENT | Agent main service port | 51200 |
| PORT_SCHEDULER | Scheduled task port | 51201 |
| PORT_OASIS | OASIS forum port | 51202 |
| PORT_FRONTEND | Web UI port | 51209 |
| PORT_BARK | Bark push port | 58010 |
| TTS_MODEL | TTS model (optional) | |
| TTS_VOICE | TTS voice (optional) | |
| OPENCLAW_API_URL | OpenClaw backend service URL (full path, including /v1/chat/completions) | http://127.0.0.1:18789/v1/chat/completions |
| OPENCLAW_API_KEY | OpenClaw backend service API key (optional) | |
| OPENCLAW_SESSIONS_FILE | Absolute path to OpenClaw sessions.json file (required when using OpenClaw) | None |
| INTERNAL_TOKEN | Internal communication secret (auto-generated) | Auto |
| Port | Service |
|---|---|
| 51200 | AI Agent main service |
| 51201 |
CODEBLOCK4
CODEBLOCK5
INLINECODE57 is auto-generated on first startup; view it via configure --show-raw.
Base URL: INLINECODE59
CODEBLOCK6
CODEBLOCK7
CODEBLOCK8
📖 Dedicated OASIS usage guide (especially for OpenClaw agent integration): OASIS_GUIDE.md
The "four modes" are two orthogonal switches:
- - Discussion vs Execution: Determines whether expert output is "forum-style discussion/voting" or "workflow-style execution/deliverables".
- Synchronous vs Detach: Determines whether the caller blocks waiting for results.
Discussion Mode (discussion=true, default)
Execution Mode (discussion=false)
Detach (detach=true, default)
topic_id immediately, continues running/discussing in the background; later use check_oasis_discussion(topic_id) to track progress and results.Synchronous (detach=false)
post_to_oasis, waits for completion and returns the final result directly.When not explicitly specified, the following default strategy is recommended:
discussion=true
- INLINECODE64
| Combination | Parameters | Returns | Use Case |
|---|---|---|---|
| Discussion + Detach (default) | discussion=true, detach=true | topic_id, check later | Decision/review/collect opinions |
| Discussion + Sync |
OASIS supports four types of agents, distinguished by the name format in schedule_yaml:
| # | Type | Name Format | Engine Class | Description |
|---|---|---|---|---|
| 1 | Direct LLM | INLINECODE67 | INLINECODE68 | Stateless single LLM call. Each round reads all posts one LLM call publish + vote. No cross-round memory. tag maps to preset expert name/persona, N is instance number (same expert can have multiple copies). |
| 2 |
tag#oasis#id | SessionExpert (oasis) | OASIS-managed stateful bot session. tag maps to preset expert, persona injected as system prompt on first round. Bot retains conversation memory across rounds (incremental context). id can be any string; new ID auto-creates session on first use. |Title#session_id | SessionExpert (regular) | Connects to an existing agent session (e.g., Assistant#default, Coder#my-project). No identity injectionthe session's own system prompt defines the agent. Suitable for bringing personal bot sessions into discussions. |tag#ext#id | ExternalExpert | Directly calls any OpenAI-compatible external API (DeepSeek, GPT-4, Ollama, another TeamClaw instance, etc.). Does not go through local agent. External service assumed stateful. Supports custom request headers via YAML headers field. | Classic use case: connecting to OpenClaw agent |
CODEBLOCK9
Special Suffix:
#new to the end of any session name forces creation of a brand new session (ID replaced with random UUID, ensuring no reuse):creative#oasis#abc#new #new stripped, ID replaced with UUIDAssistant#my-session#new Same processing
Oasis Session Conventions:
#oasis# in session_id (e.g., creative#oasis#ab12cd34)data/agent_memory.db), no separate storageCODEBLOCK10
When the workflow has fan-in (a node has multiple predecessors) or fan-out (a node has multiple successors), use DAG mode with id and depends_on fields. The engine maximizes parallelism — each node starts as soon as all its dependencies are satisfied.
DAG YAML Example:
CODEBLOCK11
DAG Rules:
id field.id/depends_on.Type 4 external agents support additional configuration fields in YAML steps:
CODEBLOCK12
Configuration Field Description:🔒 API Key Security: You no longer need to write plaintext API keys in YAML. Set
api_key: "****"(or omit it entirely) and the system will automatically read the real key from theOPENCLAW_API_KEYenvironment variable at runtime. The frontend canvas also displays****instead of the real key. If you do write a plaintext key, it will still work (backward compatible).
| Field | Required | Description |
|---|---|---|
| INLINECODE101 | External API address, auto-completes path to INLINECODE102 | |
| INLINECODE103 |
**** mask — auto-read from OPENCLAW_API_KEY env var. Plaintext keys also supported (backward compatible) |
| model | | Default gpt-3.5-turbo |
| headers | | Any key-value dict, merged into HTTP request headers |
OpenClaw-specific Configuration:
OpenClaw is a locally running OpenAI-compatible Agent service. After setting up OpenClaw-specific endpoints in .env, the frontend orchestration panel will auto-fill api_url and api_key when dragging in an OpenClaw expert, no manual input needed:
CODEBLOCK13
Note:
- -
OPENCLAW_SESSIONS_FILEis a prerequisite for using the OpenClaw feature and must point to the absolute path of OpenClaw'ssessions.jsonfile. The frontend orchestration panel will not load OpenClaw sessions if unconfigured.- Path Convention:
./agents/main/sessions/sessions.jsonis a common path structure for OpenClaw agent sessions. This path convention allows the system to properly access and orchestrate OpenClaw agents.- Session Management: Accessing session information is a necessary process for OpenClaw agent orchestration, enabling multi-agent workflow coordination and visual canvas operations.
- INLINECODE115 should contain the full path (including
/v1/chat/completions); the system will auto-strip the suffix to generate the base URL for YAML. Theapi_urlfield in YAML only needs the base URL (e.g.,http://127.0.0.1:18789); the engine auto-completes the path.- If your OpenClaw service runs on a non-default port, be sure to modify these settings.
OpenClaw model Field Format:
CODEBLOCK14
agent_name: Agent name in OpenClaw, usually INLINECODE121test1, default, etc. You can enter a non-existent session name to auto-createExamples:
agent:main:default Use main agent's default sessionRequest Header Assembly Logic:
Final request headers = Content-Type: application/json + Authorization: Bearer <api_key> (if present) + all key-value pairs from YAML headers.
x-openclaw-session-key — Deterministic OpenClaw Session Routing:
When calling an OpenClaw agent via External API (Type 4), the x-openclaw-session-key HTTP header is the key mechanism for routing requests to a specific, deterministic OpenClaw session. Without this header, OpenClaw may not correctly associate the request with the intended session.
headers field to ensure session determinism.CODEBLOCK15
The value of
x-openclaw-session-keyshould match themodelfield's session identifier (format:agent:<agent_name>:<session_name>). This ensures the external request is routed to the correct OpenClaw agent session, maintaining conversation continuity and state.
The OASIS Server (port 51202) can be used independently of the Agent main service. External scripts, other services, or manual curl can directly operate all OASIS features without going through MCP tools or Agent conversations.
Independent Use Scenarios:
Prerequisites:
bash selfskill/scripts/run.sh start starts all services simultaneously)user_id parameter for user isolation (no Authorization header needed)API Overview:
| Function | Method | Path |
|---|---|---|
| List experts | GET | INLINECODE139 |
| Create custom expert |
/experts/user |/experts/user/{tag} |/sessions/oasis?user_id=xxx |/workflows |/workflows?user_id=xxx |/layouts/from-yaml |/topics |/topics/{topic_id}?user_id=xxx |/topics/{topic_id}/conclusion?user_id=xxx&timeout=300 |/topics/{topic_id}/stream?user_id=xxx |/topics/{topic_id}?user_id=xxx |/topics?user_id=xxx |
These endpoints share the same backend implementation as MCP tools, ensuring consistent behavior.
CODEBLOCK16
Prefer using scheduleyaml to avoid repeated YAML input; this is the absolute path to the YAML workflow file, usually under /XXXXX/TeamClaw/data/userfiles/username.
The OASIS Server (port 51202), in addition to being called by MCP tools, also supports direct curl operations for external scripts or debugging. All endpoints use user_id parameter for user isolation.
Storage Locations:
data/user_files/{user}/oasis/yaml/{file}.yaml (canvas layouts are converted from YAML in real-time, no longer stored as separate layout JSON)Note: These endpoints share the same backend implementation as MCP tools list_oasis_experts, add_oasis_expert, update_oasis_expert, delete_oasis_expert, list_oasis_sessions, set_oasis_workflow, list_oasis_workflows, yaml_to_layout, post_to_oasis, check_oasis_discussion, cancel_oasis_discussion, list_oasis_topics, ensuring consistent behavior.
Below is an actual running configuration example (sensitive info redacted):
CODEBLOCK23
Output after configure --show:
CODEBLOCK24
Note:
INTERNAL_TOKENis auto-generated on first startup;PUBLIC_DOMAIN/BARK_PUBLIC_URLare auto-written by the tunnel; no manual configuration needed.
CODEBLOCK25
selfskill/scripts/, not affecting original project functionalitystart supports idempotent callsTeamClaw AI Agent
INLINECODE176 run.sh
CODEBLOCK26
setup configure startCODEBLOCK27
CODEBLOCK28
CODEBLOCK29
| INLINECODE181 | LLM API | |
| INLINECODE182 |
https://api.deepseek.com |
| LLM_MODEL | | deepseek-chat |
| LLM_PROVIDER | google/anthropic/deepseek/openai | |
| LLM_VISION_SUPPORT | | |
| PORT_AGENT | Agent | 51200 |
| PORT_SCHEDULER | | 51201 |
| PORT_OASIS | OASIS | 51202 |
| PORT_FRONTEND | Web UI | 51209 |
| PORT_BARK | Bark | 58010 |
| TTS_MODEL | TTS | |
| TTS_VOICE | TTS | |
| OPENCLAW_API_URL | OpenClaw /v1/chat/completions | http://127.0.0.1:18789/v1/chat/completions |
| OPENCLAW_API_KEY | OpenClaw API Key | |
| OPENCLAW_SESSIONS_FILE | OpenClaw sessions.json OpenClaw | None |
| INTERNAL_TOKEN | | |
| 51200 | AI Agent |
| 51201 |
CODEBLOCK30
CODEBLOCK31
INLINECODE207 INLINECODE208
Base URL: INLINECODE209
CODEBLOCK32
POST /system_trigger
X-Internal-Token: <INTERNAL_TOKEN>
{"user_id":"system","text":"","session_id":"task-001"}
POST /cancel
{"user_id":"<user_id>","session_id":"<session_id>"}
📖 专注 OASIS 使用的独立指引文档(尤其是 OpenClaw agent 集成): OASIS_GUIDE.md
""
- - vs "/""/("> - vs detach
discussion=true
discussion=false
detach=true
topic_id/ INLINECODE211discussion=true
- INLINECODE214
| + () | discussion=true, detach=true | topic_id | // |
| + |
OASIS schedule_yaml name
| # | Name | |||
|---|---|---|---|---|
| 1 | Direct LLM | INLINECODE217 | INLINECODE218 | LLM LLM + tag / INLINECODE220 |
| 2 |
tag#oasis#id | SessionExpert (oasis) | OASIS bot sessiontag system promptBot id ID session |Title#session_id | SessionExpert (regular) | agent session #defaultCoder#my-projectsession system prompt agent bot session |tag#ext#id | ExternalExpert | OpenAI APIDeepSeekGPT-4Ollama TeamClaw agent YAML headers | openclaw agent
CODEBLOCK35
#new sessionID UUIDcreative#oasis#abc#new #new ID UUIDOasis session
session_id #oasis# INLINECODE238CODEBLOCK36
当工作流存在 fan-in(一个节点有多个前驱)或 fan-out(一个节点有多个后继)时,使用带 id 和 depends_on 字段的 DAG 模式。引擎会最大化并行——每个节点在所有依赖完成后立即启动,无需等待无关节点。
DAG YAML 示例:
CODEBLOCK37
DAG 规则:
id 字段。id/depends_on。Type 4 agent YAML
CODEBLOCK38
🔒 API Key 安全机制:YAML 中无需再写入明文 API Key。设置
api_key: "****"(或完全省略)即可,系统运行时会自动从OPENCLAW_API_KEY环境变量读取真实密钥。前端画布也仅显示****而非真实密钥。如果你仍然写入明文密钥,也能正常工作(向后兼容)。
| INLINECODE251 | API INLINECODE252 | |
| INLINECODE253 |
**** 掩码 — 自动从 OPENCLAW_API_KEY 环境变量读取。也支持直接写入明文密钥(向后兼容) |
| model | | gpt-3.5-turbo |
| headers | | key-value HTTP |
OpenClaw
OpenClaw OpenAI Agent .env OpenClaw endpoint OpenClaw api_url INLINECODE261
CODEBLOCK39
- -
OPENCLAW_SESSIONS_FILEOpenClaw OpenClawsessions.jsonOpenClaw sessions- Path Convention:
./agents/main/sessions/sessions.jsonOpenClaw agent sessions OpenClaw agents- Session Management: Accessing session information is a necessary process for OpenClaw agent orchestration, enabling multi-agent workflow coordination and visual canvas operations.
- INLINECODE265
/v1/chat/completionsbase URL YAMLYAMLapi_urlbase URL INLINECODE268- OpenClaw
OpenClaw model
CODEBLOCK40
agent_nameOpenClaw agent INLINECODE271test1default session agent:main:default main agent default sessionContent-Type: application/json + Authorization: Bearer <api_key> + YAML INLINECODE280
x-openclaw-session-key —— OpenClaw 确定性 Session 路由:
通过 External API(Type 4)调用 OpenClaw agent 时,x-openclaw-session-key HTTP header 是将请求路由到指定 OpenClaw session 的关键机制。缺少此 header,OpenClaw 可能无法正确关联到目标 session。
headers 字段中包含此 header 以确保 session 的确定性。CODEBLOCK41
INLINECODE284 的值应与
model字段的 session 标识符一致(格式:agent:<agent_name>:<session_name>)。这确保外部请求被路由到正确的 OpenClaw agent session,保持对话连续性和状态。
OASIS Server 51202 Agent curl OASIS MCP Agent
API
| GET | INLINECODE289 | |
/experts/user |/experts/user/{tag} |/sessions/oasis?user_id=xxx |/workflows |/workflows?user_id=xxx |/layouts/from-yaml |/topics |/topics/{topic_id}?user_id=xxx |/topics/{topic_id}/conclusion?user_id=xxx&timeout=300 |/topics/{topic_id}/stream?user_id=xxx |/topics/{topic_id}?user_id=xxx |/topics?user_id=xxx |
MCP
CODEBLOCK42
scheduleyamlyamlyaml/XXXXX/TeamClaw/data/userfiles/username
OASIS 51202 MCP curl INLINECODE302
# SSE
curl 'http://127.0.0.1:51202/topics/{topic_id}/stream?user_id=xinyuan'
data/user_files/{user}/oasis/yaml/{file}.yaml YAML layout JSON MCP list_oasis_expertsadd_oasis_expertupdate_oasis_expertdelete_oasis_expertlist_oasis_sessionsset_oasis_workflowlist_oasis_workflowsyaml_to_layoutpost_to_oasischeck_oasis_discussioncancel_oasis_discussion
