tiger-agent 0.2.5 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +19 -0
- package/.env.secrets.example +3 -0
- package/README.md +373 -6
- package/package.json +1 -1
- package/scripts/onboard.js +156 -59
- package/src/agent/skills.js +1 -1
- package/src/apiProviders.js +10 -11
- package/src/apiProviders.js.bak +222 -0
- package/src/cli.js +21 -0
- package/src/config.js +19 -0
- package/src/llmClient.js +11 -1
- package/src/swarm/agentRuntime.js +836 -0
- package/src/swarm/agentRuntime.js.bak +456 -0
- package/src/swarm/configStore.js +360 -0
- package/src/swarm/index.js +25 -0
- package/src/swarm/taskBus.js +246 -0
- package/src/telegram/bot.js +330 -2
- package/src/telegram/supervisor.js +53 -2
package/.env.example
CHANGED
|
@@ -4,12 +4,31 @@
|
|
|
4
4
|
# NEVER commit .env to git!
|
|
5
5
|
# ============================================
|
|
6
6
|
|
|
7
|
+
# Provider Routing (default: MiniMax)
|
|
8
|
+
ACTIVE_PROVIDER=minimax
|
|
9
|
+
PROVIDER_ORDER=minimax,claude,kimi,moonshot,zai
|
|
10
|
+
MINIMAX_API_KEY=your_minimax_api_key_here
|
|
11
|
+
MINIMAX_BASE_URL=https://api.minimax.io/v1
|
|
12
|
+
MINIMAX_MODEL=MiniMax-M2.5
|
|
13
|
+
|
|
7
14
|
# Google Gemini (for image generation)
|
|
8
15
|
GEMINI_API_KEY=your_gemini_api_key_here
|
|
9
16
|
|
|
10
17
|
# Telegram Bot
|
|
11
18
|
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
|
|
12
19
|
TELEGRAM_CHAT_ID=8172556270
|
|
20
|
+
# Swarm agent step timeout in ms (0 = no extra swarm timeout)
|
|
21
|
+
SWARM_AGENT_TIMEOUT_MS=0
|
|
22
|
+
# Start Telegram swarm routing enabled or disabled (true/false)
|
|
23
|
+
SWARM_ENABLED=false
|
|
24
|
+
# Swarm-only provider failover on timeout/network/API error (true/false)
|
|
25
|
+
SWARM_ROUTE_ON_PROVIDER_ERROR=false
|
|
26
|
+
# Swarm default flow for new Telegram tasks (auto|design|research_build)
|
|
27
|
+
SWARM_DEFAULT_FLOW=auto
|
|
28
|
+
# First agent policy (auto|flow|fixed|designer|scout|coder|critic|senior_eng|spec_writer)
|
|
29
|
+
SWARM_FIRST_AGENT_POLICY=auto
|
|
30
|
+
# Used when SWARM_FIRST_AGENT_POLICY=fixed
|
|
31
|
+
SWARM_FIRST_AGENT=designer
|
|
13
32
|
|
|
14
33
|
# X/Twitter (optional - paid API)
|
|
15
34
|
X_BEARER_TOKEN=your_x_bearer_token_here
|
package/.env.secrets.example
CHANGED
package/README.md
CHANGED
|
@@ -8,13 +8,25 @@
|
|
|
8
8
|
[](LICENSE)
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**Agentic Swarm AI Agent** with persistent long-term memory, multi-provider LLM support, token management, self-learning, and Telegram bot integration — designed for 24/7 autonomous operation on Linux.
|
|
12
12
|
|
|
13
13
|
Made by **AI Research Group, Department of Civil Engineering, KMUTT**
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
## 🆕 What's New — v0.
|
|
17
|
+
## 🆕 What's New — v0.3.1
|
|
18
|
+
|
|
19
|
+
- **YAML swarm architecture** — swarm flow is now configurable in `swarm/architecture/*.yaml` with orchestrator, agents, stages, and judgment matrix
|
|
20
|
+
- **YAML task style** — task routing style is configurable in `tasks/styles/*.yaml` and can select which architecture file to use
|
|
21
|
+
- **Telegram architecture editing** — added `/architecture` and `/taskstyle` commands so Telegram users can list/show/write YAML and switch default architecture
|
|
22
|
+
- **Parallel design orchestration default** — default architecture runs 3 designers in parallel, reviewer selects best, revision loop applies, then spec writer finalizes
|
|
23
|
+
|
|
24
|
+
### v0.2.5
|
|
25
|
+
|
|
26
|
+
- **Context-file mirror compatibility** — if legacy root files like `./soul.md` or `./ownskill.md` already exist, Tiger now mirrors updates to them automatically while continuing to use `DATA_DIR` as the canonical source
|
|
27
|
+
- **README path clarification** — docs now explicitly distinguish canonical `DATA_DIR` files from optional legacy root mirrors
|
|
28
|
+
|
|
29
|
+
### v0.2.4
|
|
18
30
|
|
|
19
31
|
- **ClawHub skill install fixed** — `clawhub_install` and `clawhub_search` now work correctly when installed via `npm install -g`
|
|
20
32
|
- **No required API keys** — `tiger onboard` skips providers with no key; any single provider is enough to start
|
|
@@ -42,6 +54,32 @@ Made by **AI Research Group, Department of Civil Engineering, KMUTT**
|
|
|
42
54
|
| **Channels** | CLI + Telegram simultaneously | Single channel only |
|
|
43
55
|
| **Execution** | Chains multiple skills autonomously | Single command only |
|
|
44
56
|
|
|
57
|
+
## 📊 Dimension Comparison
|
|
58
|
+
|
|
59
|
+
| Dimension | Tiger v0.3.1 🐯 | OpenClaw 🔧 | NanoClaw 🪐 |
|
|
60
|
+
|---|---|---|---|
|
|
61
|
+
| Language | JS + Python | TypeScript | TypeScript |
|
|
62
|
+
| Platform | Linux + Docker | macOS/Linux/Win | macOS/Linux/Win |
|
|
63
|
+
| Install | `npm install -g tiger-agent` | `npm install -g openclaw` | `git clone` + Claude Code |
|
|
64
|
+
| LLM Providers | 5 (Kimi, Z.ai, MiniMax, Claude, Moonshot) | OpenAI + Claude | Claude only |
|
|
65
|
+
| Multi-provider Failover | ✅ Auto on 429/403 | ✅ | ❌ |
|
|
66
|
+
| Token Budgeting | ✅ Per-provider daily limits | ❌ | ❌ |
|
|
67
|
+
| Predefined Agents | ✅ Role-based, customizable via Markdown files | ✅ Built-in typed agents | ❌ User-defined only |
|
|
68
|
+
| Swarm Architecture | ✅ YAML configurable | ❌ | ❌ |
|
|
69
|
+
| Parallel Execution | ✅ Fault-tolerant `min_success` threshold | ✅ | ✅ |
|
|
70
|
+
| Judgment Matrix | ✅ Weighted criteria + review-revise loop | ❌ | ❌ |
|
|
71
|
+
| Task Resume | ✅ `/task continue <id>` | ❌ | ❌ |
|
|
72
|
+
| Crash Detection | ✅ 60s heartbeat; 5-min stale -> restart worker | ❌ | ✅ 5-min -> reclaim tasks |
|
|
73
|
+
| Container Isolation | ✅ Docker hardened (`cap_drop: ALL`, read-only FS) | Optional Docker | ✅ Docker default |
|
|
74
|
+
| Memory Persistence | ✅ Cross-session SQLite + 30-day backup | Session only | Team lifetime only |
|
|
75
|
+
| Self-learning | ✅ 12h reflection + 24h regeneration | ❌ | ❌ |
|
|
76
|
+
| Vector Retrieval | ✅ sqlite-vec / cosine fallback | ❌ | ❌ |
|
|
77
|
+
| Audit Logging | ✅ | ❌ | ❌ |
|
|
78
|
+
| Voice / Browser | ❌ / ❌ | ✅ / ✅ | ❌ / ❌ |
|
|
79
|
+
| Channel Coverage | Telegram, WhatsApp, CLI | All + iMessage + Teams | Most major |
|
|
80
|
+
| Core Strength | Cost control + YAML swarm + self-learning | Channel breadth + voice + sync A2A | Security + formal swarm lifecycle |
|
|
81
|
+
| Core Weakness | Linux-primary; no cross-task DAG | High complexity; app-layer security | Single-provider lock-in |
|
|
82
|
+
|
|
45
83
|
---
|
|
46
84
|
|
|
47
85
|
## 📋 Requirements
|
|
@@ -60,16 +98,60 @@ npm install -g tiger-agent
|
|
|
60
98
|
|
|
61
99
|
All config and runtime data is stored in `~/.tiger/` — nothing written to the npm global directory.
|
|
62
100
|
|
|
101
|
+
## 🐳 Docker (Safer Runtime Isolation)
|
|
102
|
+
|
|
103
|
+
Run Tiger in a hardened container with:
|
|
104
|
+
- non-root user (`node`)
|
|
105
|
+
- dropped Linux capabilities (`cap_drop: [ALL]`)
|
|
106
|
+
- `no-new-privileges`
|
|
107
|
+
- read-only root filesystem
|
|
108
|
+
- persistent writable volume only for `TIGER_HOME` (`/home/node/.tiger`)
|
|
109
|
+
|
|
110
|
+
Build image:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
docker build -t tiger-agent:local .
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Run CLI mode:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
docker run --rm -it \
|
|
120
|
+
--env-file .env \
|
|
121
|
+
--read-only \
|
|
122
|
+
--tmpfs /tmp \
|
|
123
|
+
--security-opt no-new-privileges:true \
|
|
124
|
+
--cap-drop ALL \
|
|
125
|
+
-e TIGER_HOME=/home/node/.tiger \
|
|
126
|
+
-v tiger_home:/home/node/.tiger \
|
|
127
|
+
tiger-agent:local start
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Run Telegram mode via Compose:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
docker compose up -d
|
|
134
|
+
docker compose logs -f tiger
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Default compose command is `telegram`. Change `command:` in `docker-compose.yml` if you want `start` instead.
|
|
138
|
+
|
|
63
139
|
---
|
|
64
140
|
|
|
65
141
|
## 🚀 Quick Start
|
|
66
142
|
|
|
67
|
-
### 1. Run the setup wizard
|
|
143
|
+
### 1. Run the setup wizard (`npm`, not `npn`)
|
|
68
144
|
|
|
69
145
|
```bash
|
|
70
146
|
tiger onboard
|
|
71
147
|
```
|
|
72
148
|
|
|
149
|
+
If you cloned this repo and run locally (without global install), use:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npm run onboard
|
|
153
|
+
```
|
|
154
|
+
|
|
73
155
|
The wizard will ask for:
|
|
74
156
|
- **Active provider** — which LLM to use by default (e.g. `zai`, `claude`)
|
|
75
157
|
- **Fallback order** — comma-separated list tried when the active provider is rate-limited
|
|
@@ -80,24 +162,51 @@ The wizard will ask for:
|
|
|
80
162
|
|
|
81
163
|
Config is saved to `~/.tiger/.env` (mode 600).
|
|
82
164
|
|
|
165
|
+
**MiniMax starter (quick setup):**
|
|
166
|
+
```bash
|
|
167
|
+
# during onboard: choose active provider = minimax
|
|
168
|
+
tiger onboard
|
|
169
|
+
# local repo alternative
|
|
170
|
+
# npm run onboard
|
|
171
|
+
```
|
|
172
|
+
Set at least:
|
|
173
|
+
- `ACTIVE_PROVIDER=minimax`
|
|
174
|
+
- `MINIMAX_API_KEY=...`
|
|
175
|
+
|
|
83
176
|
### 2. Start
|
|
84
177
|
|
|
85
178
|
**CLI chat:**
|
|
86
179
|
```bash
|
|
87
180
|
tiger start
|
|
181
|
+
# local repo
|
|
182
|
+
npm run start
|
|
88
183
|
```
|
|
89
184
|
Exit with `/exit` or `/quit`.
|
|
90
185
|
|
|
91
186
|
**Telegram bot (foreground):**
|
|
92
187
|
```bash
|
|
93
188
|
tiger telegram
|
|
189
|
+
# local repo
|
|
190
|
+
npm run telegram
|
|
94
191
|
```
|
|
192
|
+
Use foreground mode only for testing/log watching in the current terminal session.
|
|
95
193
|
|
|
96
194
|
**Telegram bot (background daemon):**
|
|
97
195
|
```bash
|
|
98
196
|
tiger telegram --background # start
|
|
99
197
|
tiger status # check if running
|
|
100
198
|
tiger stop # stop
|
|
199
|
+
# local repo
|
|
200
|
+
npm run telegram:bg # start
|
|
201
|
+
npm run telegram:stop # stop
|
|
202
|
+
```
|
|
203
|
+
Recommended for daily use: run background mode so Tiger keeps running after you close the terminal.
|
|
204
|
+
|
|
205
|
+
**Restart background bot (after editing `.env` in this repo):**
|
|
206
|
+
```bash
|
|
207
|
+
cd /root/tiger
|
|
208
|
+
npm run telegram:stop
|
|
209
|
+
npm run telegram:bg
|
|
101
210
|
```
|
|
102
211
|
|
|
103
212
|
Logs: `~/.tiger/logs/telegram.out.log`
|
|
@@ -115,6 +224,11 @@ Logs: `~/.tiger/logs/telegram.out.log`
|
|
|
115
224
|
| **Status** | `tiger status` | Check daemon status |
|
|
116
225
|
| **Onboard** | `tiger onboard` | Re-run setup wizard |
|
|
117
226
|
|
|
227
|
+
Background crash detection:
|
|
228
|
+
- Telegram worker now emits a heartbeat every 60 seconds.
|
|
229
|
+
- Supervisor watchdog checks heartbeat every minute.
|
|
230
|
+
- If heartbeat is stale for 5 minutes, supervisor force-restarts the worker.
|
|
231
|
+
|
|
118
232
|
---
|
|
119
233
|
|
|
120
234
|
## 🔧 Setup Wizard Details
|
|
@@ -145,7 +259,7 @@ Logs: `~/.tiger/logs/telegram.out.log`
|
|
|
145
259
|
| `ALLOW_SHELL` | `false` | Enable shell tool |
|
|
146
260
|
| `ALLOW_SKILL_INSTALL` | `false` | Enable ClawHub skill install |
|
|
147
261
|
| `VECTOR_DB_PATH` | `~/.tiger/db/memory.sqlite` | SQLite vector DB path |
|
|
148
|
-
| `DATA_DIR` | `~/.tiger/data` |
|
|
262
|
+
| `DATA_DIR` | `~/.tiger/data` | Canonical context files directory |
|
|
149
263
|
| `OWN_SKILL_UPDATE_HOURS` | `24` | Hours between `ownskill.md` regenerations (min 1) |
|
|
150
264
|
| `SOUL_UPDATE_HOURS` | `24` | Hours between `soul.md` regenerations (min 1) |
|
|
151
265
|
| `REFLECTION_UPDATE_HOURS` | `12` | Hours between reflection cycles (min 1) |
|
|
@@ -167,7 +281,7 @@ Tiger supports **5 providers** with automatic fallback and daily token limits.
|
|
|
167
281
|
| Kimi Code | `kimi` | `k2p5` | `KIMI_CODE_API_KEY` |
|
|
168
282
|
| Kimi Moonshot | `moonshot` | `kimi-k1` | `MOONSHOT_API_KEY` |
|
|
169
283
|
| Z.ai (Zhipu) | `zai` | `glm-4.7` | `ZAI_API_KEY` (format: `id.secret`) |
|
|
170
|
-
| MiniMax | `minimax` | `
|
|
284
|
+
| MiniMax | `minimax` | `MiniMax-M2.5` | `MINIMAX_API_KEY` |
|
|
171
285
|
| Claude (Anthropic) | `claude` | `claude-sonnet-4-6` | `CLAUDE_API_KEY` |
|
|
172
286
|
|
|
173
287
|
### `.env` Example
|
|
@@ -188,6 +302,26 @@ ZAI_TOKEN_LIMIT=100000
|
|
|
188
302
|
MINIMAX_TOKEN_LIMIT=100000
|
|
189
303
|
CLAUDE_TOKEN_LIMIT=500000
|
|
190
304
|
MOONSHOT_TOKEN_LIMIT=100000
|
|
305
|
+
|
|
306
|
+
# Provider request timeouts (ms)
|
|
307
|
+
KIMI_TIMEOUT_MS=120000
|
|
308
|
+
ZAI_TIMEOUT_MS=120000
|
|
309
|
+
|
|
310
|
+
# Swarm worker-step timeout (0 = no extra swarm timeout)
|
|
311
|
+
SWARM_AGENT_TIMEOUT_MS=120000
|
|
312
|
+
|
|
313
|
+
# Swarm only: on timeout/network/API error, retry via next provider
|
|
314
|
+
SWARM_ROUTE_ON_PROVIDER_ERROR=true
|
|
315
|
+
|
|
316
|
+
# Swarm execution resilience
|
|
317
|
+
SWARM_STEP_MAX_RETRIES=2
|
|
318
|
+
SWARM_CONTINUE_ON_ERROR=true
|
|
319
|
+
|
|
320
|
+
# Swarm task entry policy
|
|
321
|
+
SWARM_DEFAULT_FLOW=auto
|
|
322
|
+
SWARM_FIRST_AGENT_POLICY=auto
|
|
323
|
+
# Used only when SWARM_FIRST_AGENT_POLICY=fixed
|
|
324
|
+
SWARM_FIRST_AGENT=designer
|
|
191
325
|
```
|
|
192
326
|
|
|
193
327
|
### Auto-Switch Behaviour
|
|
@@ -209,15 +343,244 @@ MOONSHOT_TOKEN_LIMIT=100000
|
|
|
209
343
|
| `/tokens` | Show today's token usage per provider |
|
|
210
344
|
| `/limit` | Show daily token limits per provider |
|
|
211
345
|
| `/limit <provider> <n>` | Set daily token limit (0 = unlimited, e.g. `/limit zai 100000`) |
|
|
346
|
+
| `/swarm` | Show agent swarm status (ON/OFF) |
|
|
347
|
+
| `/swarm <on|off>` | Enable or disable internal swarm routing for normal messages |
|
|
348
|
+
| `/status` | Show swarm task queues (`pending`, `in_progress`, `done`, `failed`) |
|
|
349
|
+
| `/task` | List swarm tasks across queues |
|
|
350
|
+
| `/task continue <task_id>` | Resume a failed/stuck swarm task from the last failed agent |
|
|
351
|
+
| `/task retry <task_id>` | Alias of `/task continue <task_id>` |
|
|
352
|
+
| `/task delete <task_id>` | Delete a swarm task file from queue storage |
|
|
353
|
+
| `/agents` | Show internal swarm agents and availability |
|
|
354
|
+
| `/cancel <task_id>` | Cancel a swarm task |
|
|
355
|
+
| `/ask <agent> <question>` | Ask a specific internal agent role directly |
|
|
356
|
+
| `/architecture` | List swarm architecture YAML files |
|
|
357
|
+
| `/architecture show <file>` | Show one architecture YAML file |
|
|
358
|
+
| `/architecture use <file>` | Set default task-style architecture file |
|
|
359
|
+
| `/architecture write <file>` + newline + yaml | Save architecture YAML from Telegram |
|
|
360
|
+
| `/taskstyle` | List task-style YAML files |
|
|
361
|
+
| `/taskstyle show <file>` | Show one task-style YAML file |
|
|
362
|
+
| `/taskstyle write <file>` + newline + yaml | Save task-style YAML from Telegram |
|
|
212
363
|
| `/help` | Show all commands |
|
|
213
364
|
|
|
365
|
+
### Swarm Settings (`/swarm`)
|
|
366
|
+
|
|
367
|
+
Tiger v0.3.1 includes an internal agent swarm for Telegram message routing.
|
|
368
|
+
|
|
369
|
+
- **Default:** swarm is **OFF** when the Telegram bot starts (`SWARM_ENABLED=false`)
|
|
370
|
+
- **`/swarm on`**: regular user messages are routed through the YAML architecture in `swarm/architecture/*.yaml` (selected by `tasks/styles/default.yaml`)
|
|
371
|
+
- **`/swarm off`**: regular user messages skip the swarm and go directly to the standard Tiger agent reply path
|
|
372
|
+
- **Scope:** this toggle affects only **normal chat messages** (not admin commands like `/api`, `/tokens`, `/limit`)
|
|
373
|
+
- **Current persistence:** the `/swarm` toggle is currently **in-memory only** and resets to `SWARM_ENABLED` value after bot restart
|
|
374
|
+
- **Task resume:** use `/task continue <task_id>` (or `/task retry <task_id>`) to continue a failed timeout/API-error task without starting over
|
|
375
|
+
|
|
376
|
+
### Swarm Timeout / Failover (`.env`)
|
|
377
|
+
|
|
378
|
+
- `SWARM_AGENT_TIMEOUT_MS`: timeout per swarm worker step (e.g. one `designer` turn). `0` disables the extra swarm timeout.
|
|
379
|
+
- `SWARM_ENABLED=true|false`: default `/swarm` state at bot startup.
|
|
380
|
+
- `SWARM_ROUTE_ON_PROVIDER_ERROR=true|false`: swarm-only provider failover on timeout/network/API errors.
|
|
381
|
+
- `SWARM_STEP_MAX_RETRIES`: retries per failed worker/stage before giving up.
|
|
382
|
+
- `SWARM_CONTINUE_ON_ERROR=true|false`: if `true`, swarm continues on degraded path after retries are exhausted (instead of hard failing).
|
|
383
|
+
- Provider timeouts are separate and provider-specific, for example `KIMI_TIMEOUT_MS`, `ZAI_TIMEOUT_MS`, `CLAUDE_TIMEOUT_MS`.
|
|
384
|
+
|
|
385
|
+
### Swarm Entry Policy (`.env`)
|
|
386
|
+
|
|
387
|
+
- `SWARM_DEFAULT_FLOW=auto|design|research_build`: default flow for new Telegram swarm tasks.
|
|
388
|
+
- `SWARM_FIRST_AGENT_POLICY` controls who starts first:
|
|
389
|
+
- `auto` (default): Tiger/orchestrator picks based on the goal text
|
|
390
|
+
- `flow`: use flow mapping (`research_build -> scout`, otherwise `designer`)
|
|
391
|
+
- `fixed`: use `SWARM_FIRST_AGENT`
|
|
392
|
+
- or set a direct agent name (for example `designer`, `scout`, `coder`)
|
|
393
|
+
- `SWARM_FIRST_AGENT` is used when `SWARM_FIRST_AGENT_POLICY=fixed`
|
|
394
|
+
|
|
395
|
+
Examples:
|
|
396
|
+
|
|
397
|
+
```text
|
|
398
|
+
/swarm
|
|
399
|
+
/swarm off
|
|
400
|
+
/swarm on
|
|
401
|
+
/task
|
|
402
|
+
/task retry task_xxx
|
|
403
|
+
/task delete task_xxx
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### Swarm Agent Files (Manual Customization)
|
|
407
|
+
|
|
408
|
+
Tiger creates a local swarm workspace so you can manually customize each agent's behavior.
|
|
409
|
+
|
|
410
|
+
Default folders (project/runtime root):
|
|
411
|
+
|
|
412
|
+
```text
|
|
413
|
+
agents/
|
|
414
|
+
tiger/
|
|
415
|
+
designer/
|
|
416
|
+
senior_eng/
|
|
417
|
+
spec_writer/
|
|
418
|
+
scout/
|
|
419
|
+
coder/
|
|
420
|
+
critic/
|
|
421
|
+
tasks/
|
|
422
|
+
pending/
|
|
423
|
+
in_progress/
|
|
424
|
+
done/
|
|
425
|
+
failed/
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Each agent folder includes files such as:
|
|
429
|
+
|
|
430
|
+
- `soul.md` — the agent's personality, rules, and mindset
|
|
431
|
+
- `ownskill.md` — what the agent is good at / preferred workflow
|
|
432
|
+
- `experience.json` — learned lessons and task stats
|
|
433
|
+
- `memory.md` — long-form notes/patterns
|
|
434
|
+
- `human.md` — only for `agents/tiger/` (user preferences)
|
|
435
|
+
|
|
436
|
+
Manual setup / editing:
|
|
437
|
+
|
|
438
|
+
- Start the bot once (`tiger telegram` or `tiger start`) and Tiger will auto-create missing `agents/` and `tasks/` folders
|
|
439
|
+
- You can then open and edit files like `agents/designer/soul.md` or `agents/senior_eng/soul.md` manually
|
|
440
|
+
- Your edits are used on future swarm runs (for example `/ask designer ...` or normal swarm-routed messages)
|
|
441
|
+
- Keep edits in plain Markdown/JSON and avoid deleting required files while the bot is running
|
|
442
|
+
|
|
443
|
+
Example customization ideas:
|
|
444
|
+
|
|
445
|
+
- Make `designer` more creative / visual
|
|
446
|
+
- Make `senior_eng` stricter about security, error handling, and scalability
|
|
447
|
+
- Make `spec_writer` produce a specific document format your team uses
|
|
448
|
+
|
|
449
|
+
### Swarm Architecture YAML (v0.3.1)
|
|
450
|
+
|
|
451
|
+
Default files:
|
|
452
|
+
|
|
453
|
+
```text
|
|
454
|
+
swarm/architecture/tiger_parallel_design.yaml
|
|
455
|
+
tasks/styles/default.yaml
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Default architecture behavior:
|
|
459
|
+
|
|
460
|
+
- Orchestrator: `tiger`
|
|
461
|
+
- Stage 1: send task simultaneously to `designer_a`, `designer_b`, `designer_c` (different souls/personalities)
|
|
462
|
+
- `designer_a`: senior conservative
|
|
463
|
+
- `designer_b`: balanced, around 40 style
|
|
464
|
+
- `designer_c`: young aggressive, higher risk appetite
|
|
465
|
+
- Stage 2: `reviewer` evaluates with the judgment matrix and picks best candidate
|
|
466
|
+
- Stage 3: selected designer revises based on reviewer feedback (loop until approved)
|
|
467
|
+
- Stage 4: `spec_writer` writes final output in two sections: **Calculation Report** and **Executive Summary**
|
|
468
|
+
|
|
469
|
+
Resilient execution behavior:
|
|
470
|
+
|
|
471
|
+
- Parallel stages are fault-tolerant: one failed role does not abort the whole stage.
|
|
472
|
+
- `type: parallel` now supports `min_success` (default `1`) to define how many successful role outputs are required.
|
|
473
|
+
- Failed parallel-role errors are stored in context as `<store_as>_errors`.
|
|
474
|
+
- Worker/stage retries are controlled by `SWARM_STEP_MAX_RETRIES`.
|
|
475
|
+
- If retries are exhausted and `SWARM_CONTINUE_ON_ERROR=true`, swarm continues on a degraded path instead of hard fail.
|
|
476
|
+
|
|
477
|
+
Example `swarm/architecture/tiger_parallel_design.yaml`:
|
|
478
|
+
|
|
479
|
+
```yaml
|
|
480
|
+
version: 1
|
|
481
|
+
name: tiger_parallel_design
|
|
482
|
+
main_orchestrator: tiger
|
|
483
|
+
start_stage: design_parallel
|
|
484
|
+
agents:
|
|
485
|
+
- id: designer_a
|
|
486
|
+
runtime_agent: designer_a
|
|
487
|
+
role: designer
|
|
488
|
+
- id: designer_b
|
|
489
|
+
runtime_agent: designer_b
|
|
490
|
+
role: designer
|
|
491
|
+
- id: designer_c
|
|
492
|
+
runtime_agent: designer_c
|
|
493
|
+
role: designer
|
|
494
|
+
- id: reviewer
|
|
495
|
+
runtime_agent: senior_eng
|
|
496
|
+
role: reviewer
|
|
497
|
+
- id: spec_writer
|
|
498
|
+
runtime_agent: spec_writer
|
|
499
|
+
role: spec_writer
|
|
500
|
+
stages:
|
|
501
|
+
- id: design_parallel
|
|
502
|
+
type: parallel
|
|
503
|
+
roles:
|
|
504
|
+
- designer_a
|
|
505
|
+
- designer_b
|
|
506
|
+
- designer_c
|
|
507
|
+
min_success: 2
|
|
508
|
+
store_as: design_candidates
|
|
509
|
+
next: review_best
|
|
510
|
+
- id: review_best
|
|
511
|
+
type: judge
|
|
512
|
+
role: reviewer
|
|
513
|
+
candidates_from: design_candidates
|
|
514
|
+
selected_role_key: selected_role
|
|
515
|
+
feedback_key: reviewer_feedback
|
|
516
|
+
calculation_report_key: best_calculation_report
|
|
517
|
+
pass_next: final_spec
|
|
518
|
+
fail_next: revise_selected
|
|
519
|
+
- id: revise_selected
|
|
520
|
+
type: revise
|
|
521
|
+
role_from_context: selected_role
|
|
522
|
+
feedback_from_context: reviewer_feedback
|
|
523
|
+
candidates_from: design_candidates
|
|
524
|
+
update_context_keys_from_revised:
|
|
525
|
+
- best_calculation_report
|
|
526
|
+
next: review_best
|
|
527
|
+
- id: final_spec
|
|
528
|
+
type: final
|
|
529
|
+
role: spec_writer
|
|
530
|
+
source_from_context: best_calculation_report
|
|
531
|
+
output_sections:
|
|
532
|
+
- Calculation Report
|
|
533
|
+
- Executive Summary
|
|
534
|
+
output_notes: Include formulas, assumptions, step-by-step calculations, final values, and concise recommendations.
|
|
535
|
+
next: tiger_done
|
|
536
|
+
judgment_matrix:
|
|
537
|
+
criteria:
|
|
538
|
+
- name: objective_fit
|
|
539
|
+
weight: 0.35
|
|
540
|
+
description: How well the design satisfies the objective.
|
|
541
|
+
- name: feasibility
|
|
542
|
+
weight: 0.25
|
|
543
|
+
description: Delivery realism and technical viability.
|
|
544
|
+
- name: clarity
|
|
545
|
+
weight: 0.2
|
|
546
|
+
description: Readability and implementation clarity.
|
|
547
|
+
- name: risk
|
|
548
|
+
weight: 0.2
|
|
549
|
+
description: Risk exposure and mitigation quality.
|
|
550
|
+
pass_rule: reviewer_approval
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
### Task Style YAML
|
|
554
|
+
|
|
555
|
+
Task style is the selector/policy layer for swarm execution.
|
|
556
|
+
|
|
557
|
+
- `architecture`: which file in `swarm/architecture/` to run
|
|
558
|
+
- `flow`: flow label for task routing mode
|
|
559
|
+
- `objective_prefix`: text prepended to the user objective before processing
|
|
560
|
+
|
|
561
|
+
Default file:
|
|
562
|
+
|
|
563
|
+
```text
|
|
564
|
+
tasks/styles/default.yaml
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
Example:
|
|
568
|
+
|
|
569
|
+
```yaml
|
|
570
|
+
version: 1
|
|
571
|
+
name: default
|
|
572
|
+
architecture: tiger_parallel_design.yaml
|
|
573
|
+
flow: architecture
|
|
574
|
+
objective_prefix: "Objective:"
|
|
575
|
+
```
|
|
576
|
+
|
|
214
577
|
---
|
|
215
578
|
|
|
216
579
|
## 🧠 Memory & Context
|
|
217
580
|
|
|
218
581
|
### Context Files
|
|
219
582
|
|
|
220
|
-
Loaded on every turn from `~/.tiger/data
|
|
583
|
+
Loaded on every turn from `DATA_DIR` (default: `~/.tiger/data/`):
|
|
221
584
|
|
|
222
585
|
| File | Purpose |
|
|
223
586
|
|------|---------|
|
|
@@ -226,6 +589,8 @@ Loaded on every turn from `~/.tiger/data/`:
|
|
|
226
589
|
| `human2.md` | Running update log written after every conversation turn |
|
|
227
590
|
| `ownskill.md` | Known skills, workflows, and lessons learned |
|
|
228
591
|
|
|
592
|
+
> **v0.2.5 compatibility note:** If root-level legacy files already exist (for example `./soul.md`, `./ownskill.md`), Tiger mirrors updates to those files automatically. The canonical source remains `DATA_DIR`.
|
|
593
|
+
|
|
229
594
|
### Auto-Refresh Cycles
|
|
230
595
|
|
|
231
596
|
Tiger periodically regenerates these files using the LLM. All durations are configurable in `.env` (minimum 1 hour).
|
|
@@ -339,6 +704,8 @@ rm .env.secrets
|
|
|
339
704
|
| `403` quota error | Daily quota exhausted — auto-switches; raise `*_TOKEN_LIMIT` |
|
|
340
705
|
| `429` rate limit | Auto-switches to next provider in `PROVIDER_ORDER` |
|
|
341
706
|
| Z.ai auth fails | Key must be `id.secret` format (from Zhipu/BigModel console) |
|
|
707
|
+
| Telegram bot runs but does not respond | Ensure only one polling instance is running for the same bot token (stop old/global service copies) |
|
|
708
|
+
| `soul.md` / `ownskill.md` look stale | Check `DATA_DIR` first (default `~/.tiger/data`). In v0.2.5+, existing root legacy copies are mirrored automatically |
|
|
342
709
|
| Shell tool disabled | Set `ALLOW_SHELL=true` in `~/.tiger/.env` |
|
|
343
710
|
| Stuck processes | `pkill -f tiger-agent` then restart |
|
|
344
711
|
| Reset token counters | Delete `~/.tiger/db/token_usage.json` and restart |
|