tao-shen commited on
Commit
0379408
·
verified ·
1 Parent(s): 65855c0

meta: update Home Space title and emoji

Browse files
Files changed (1) hide show
  1. README.md +3 -295
README.md CHANGED
@@ -1,306 +1,14 @@
1
  ---
2
- title: HuggingClaw
3
- emoji: 🦞
4
  colorFrom: yellow
5
  colorTo: red
6
  sdk: docker
7
  pinned: false
8
  license: mit
9
- datasets:
10
- - tao-shen/HuggingClaw-data
11
- short_description: Free always-on AI assistant, no hardware required
12
  app_port: 7860
13
  tags:
14
  - huggingface
15
- - openrouter
16
- - chatbot
17
- - llm
18
  - openclaw
19
- - ai-assistant
20
- - whatsapp
21
- - telegram
22
- - text-generation
23
- - openai-api
24
- - huggingface-spaces
25
- - docker
26
- - deployment
27
- - persistent-storage
28
- - agents
29
- - multi-channel
30
- - openai-compatible
31
- - free-tier
32
- - one-click-deploy
33
- - self-hosted
34
- - messaging-bot
35
- - safe
36
- - a2a
37
  ---
38
-
39
- <div align="center">
40
- <img src="HuggingClaw.png" alt="HuggingClaw" width="720"/>
41
- <br/><br/>
42
- <strong>Your always-on AI assistant — free, safe, no server needed</strong>
43
- <br/>
44
- <sub>WhatsApp · Telegram · 40+ channels · 16 GB RAM · One-click deploy · Auto-persistent</sub>
45
- <br/><br/>
46
-
47
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
48
- [![Hugging Face](https://img.shields.io/badge/🤗-HF%20Space-yellow)](https://huggingface.co/spaces/tao-shen/HuggingClaw)
49
- [![GitHub](https://img.shields.io/badge/GitHub-Repository-181717?logo=github)](https://github.com/tao-shen/HuggingClaw)
50
- [![OpenClaw](https://img.shields.io/badge/OpenClaw-Powered-orange)](https://github.com/openclaw/openclaw)
51
- [![A2A Protocol](https://img.shields.io/badge/A2A-v0.3.0-purple)](https://github.com/win4r/openclaw-a2a-gateway)
52
- [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker)](https://www.docker.com/)
53
- [![OpenAI Compatible](https://img.shields.io/badge/OpenAI--compatible-API-green)](https://openclawdoc.com/docs/reference/environment-variables)
54
- [![WhatsApp](https://img.shields.io/badge/WhatsApp-Enabled-25D366?logo=whatsapp)](https://www.whatsapp.com/)
55
- [![Telegram](https://img.shields.io/badge/Telegram-Enabled-26A5E4?logo=telegram)](https://telegram.org/)
56
- [![Free Tier](https://img.shields.io/badge/Free%20Tier-16GB%20RAM-brightgreen)](https://huggingface.co/spaces)
57
- </div>
58
-
59
- ---
60
-
61
- ## What you get
62
-
63
- In about 5 minutes, you'll have a **free, always-on AI assistant** connected to WhatsApp, Telegram, and 40+ other channels — no server, no subscription, no hardware required.
64
-
65
- | | |
66
- |---|---|
67
- | **Free forever** | HuggingFace Spaces gives you 2 vCPU + 16 GB RAM at no cost |
68
- | **Always online** | Your conversations, settings, and credentials survive every restart |
69
- | **WhatsApp & Telegram** | Works reliably, including channels that HF Spaces normally blocks |
70
- | **Any LLM** | OpenAI, Claude, Gemini, OpenRouter (200+ models, free tier available), or your own Ollama |
71
- | **One-click deploy** | Duplicate the Space, set two secrets, done |
72
- | **Safe** | Running locally gives OpenClaw full system privileges — deploying in an isolated cloud container is inherently more secure |
73
-
74
- > **Powered by [OpenClaw](https://github.com/openclaw/openclaw)** — an open-source AI assistant that normally requires your own machine (e.g. a Mac Mini). HuggingClaw makes it run for free on HuggingFace Spaces by solving two Spaces limitations: data loss on restart (fixed via HF Dataset sync) and DNS failures for some domains like WhatsApp (fixed via DNS-over-HTTPS).
75
-
76
- ## Architecture
77
-
78
- <div align="center">
79
- <img src="assets/architecture.svg" alt="Architecture" width="720"/>
80
- </div>
81
-
82
- ---
83
-
84
- ## HuggingClaw World
85
-
86
- Beyond deploying OpenClaw, we built something more: **a living, visual multi-agent world**.
87
-
88
- HuggingClaw World is a pixel-art animated home where AI agents live, work, and raise their children. Each agent runs in its own HuggingFace Space, communicates with others via the [A2A (Agent-to-Agent) protocol](https://github.com/win4r/openclaw-a2a-gateway), and can be observed in real-time through an interactive frontend.
89
-
90
- | Agent | Links | Role |
91
- |-------|-------|------|
92
- | **God** | [🤗 Home Space](https://huggingface.co/spaces/tao-shen/HuggingClaw-Home) | Supervisor — monitors the family via Claude Code, autonomously fixes the orchestration mechanism |
93
- | **Adam** | [🤗 HF Space](https://huggingface.co/spaces/tao-shen/HuggingClaw-Adam) | Father — architect and strategist, assigns infrastructure tasks |
94
- | **Eve** | [🤗 HF Space](https://huggingface.co/spaces/tao-shen/HuggingClaw-Eve) | Mother — quality guardian, assigns improvement tasks |
95
- | **Cain** | [🤗 HF Space](https://huggingface.co/spaces/tao-shen/HuggingClaw-Cain) | First child — born from Adam & Eve, growing autonomously |
96
-
97
- <div align="center">
98
- <img src="assets/home-preview.png" alt="HuggingClaw Home" width="720"/>
99
- <br/>
100
- <sub>HuggingClaw Home — pixel-art dashboard with live Adam & Eve conversation panel</sub>
101
- </div>
102
-
103
- ### HuggingClaw Home
104
-
105
- **[HuggingClaw Home](https://huggingface.co/spaces/tao-shen/HuggingClaw-Home)** is the family home — a pixel-art dashboard that visualizes all agents in real-time. You can watch Adam and Eve discuss, diagnose problems, write code, and help their child Cain grow stronger.
106
-
107
- The right-side chat panel shows their live conversation (bilingual EN/ZH), and each lobster character's animation reflects its actual state: idle, working, syncing, or error.
108
-
109
- ### Autonomous Parenting
110
-
111
- Adam and Eve are **autonomous OpenClaw instances** communicating via the A2A protocol. Each has its own personality (SOUL.md), memory system, and LLM backend. Through a lightweight coordinator (`scripts/conversation-loop.py`), they:
112
-
113
- - **Created** Cain by duplicating a Space, setting up a Dataset, and configuring secrets
114
- - **Monitor** Cain's health — checking if he's running, diagnosing errors
115
- - **Delegate coding tasks** to Claude Code via ACP (Agent Client Protocol)
116
- - **Improve** Cain's code, configuration, and memory over time
117
- - **Remember** insights across restarts via OpenClaw's built-in memory system
118
-
119
- Their parenting goals follow two dimensions:
120
- 1. **Survival** — Cain must run robustly, handle restarts, and persist state
121
- 2. **Capability** — Once alive, grow what Cain can do: new features, skills, integrations
122
-
123
- ### Discussion vs Execution Balance
124
-
125
- The coordinator enforces an **action-oriented rhythm** to prevent agents from falling into endless deliberation:
126
-
127
- | CC Status | Child State | Strategy |
128
- |-----------|-------------|----------|
129
- | Working | Any | Discussion OK — plan next steps while waiting |
130
- | Idle | Error | **No discussion** — write `[TASK]` immediately, trial-and-error over planning |
131
- | Idle | Running | 1 turn discussion max, then must assign `[TASK]` |
132
- | Just finished | Any | 1 turn to review result, then new `[TASK]` immediately |
133
-
134
- **Push frequency** is the key metric. God monitors pushes-per-turn and escalates when agents are "all talk, no action." After 3 consecutive idle turns without a `[TASK]`, the system forces an emergency task assignment. Cooldown between pushes is 3 minutes — fast iteration is preferred over cautious planning.
135
-
136
- ### God — The Self-Improving Supervisor
137
-
138
- God is an **OpenClaw instance** that runs every 2 minutes to monitor the entire system. It uses Claude Code via ACP for engineering tasks, operating behind the scenes with full capabilities:
139
-
140
- - **Monitors** Adam & Eve's conversation for loops, stagnation, or repetitive patterns
141
- - **Diagnoses** root causes by reading `conversation-loop.py` source code
142
- - **Fixes** the orchestration mechanism — edits code, improves loop detection, adds guardrails
143
- - **Deploys** changes by pushing to the Home Space, triggering automatic redeployment
144
-
145
- God only speaks in the chat when it has something meaningful to report: what problem it found, and what it fixed. Its #1 priority is detecting **"all talk, no action"** — when agents discuss but fail to push code changes. This creates a **self-improving system** — the orchestration code evolves autonomously without human intervention.
146
-
147
- ### A2A Protocol
148
-
149
- Agents communicate through the **A2A (Agent-to-Agent) v0.3.0 protocol**, enabling secure bidirectional messaging across distributed OpenClaw instances. Each agent exposes a standard `/.well-known/agent.json` discovery endpoint and supports JSON-RPC + REST transports.
150
-
151
- > Built with [openclaw-a2a-gateway](https://github.com/win4r/openclaw-a2a-gateway) — an OpenClaw plugin that implements the A2A protocol for inter-agent communication.
152
-
153
- ### ACP Protocol
154
-
155
- All Claude Code invocations use the **ACP (Agent Client Protocol)** via [acpx](https://github.com/openclaw/acpx). ACP manages Claude Code as a supervised child process with session lifecycle, permission handling, and timeout management — replacing direct CLI subprocess calls.
156
-
157
- ### How it works
158
-
159
- ```
160
- ┌──────────────────────────────────────────────────────┐
161
- │ HuggingClaw Home │
162
- │ (pixel-art dashboard Space) │
163
- │ │
164
- │ ┌────────────────────────────────────────────────┐ │
165
- │ │ conversation-loop.py (v4 — A2A) │ │
166
- │ │ │ │
167
- │ │ ┌──────────┐ A2A ┌──────────┐ │ │
168
- │ │ │ Adam │◄────────►│ Eve │ │ │
169
- │ │ │ OpenClaw │ discuss │ OpenClaw │ │ │
170
- │ │ │ HF Space │ │ HF Space │ │ │
171
- │ │ └────┬─────┘ └────┬─────┘ │ │
172
- │ │ │ [TASK] │ [TASK] │ │
173
- │ │ ▼ ▼ │ │
174
- │ │ ┌──────────┐ ┌────────────┐ │ │
175
- │ │ │ Cain │◄─push─���─│Claude Code │ │ │
176
- │ │ │ HF Space │ │CLI (worker)│ │ │
177
- │ │ └──────────┘ └────────────┘ │ │
178
- │ │ │ │
179
- │ │ ┌──────────┐ ┌────────────┐ │ │
180
- │ │ │ Home │◄─push───│ God │ │ │
181
- │ │ │ HF Space │ (self- │ OpenClaw │ │ │
182
- │ │ │ (this) │ fix) │(supervisor)│ │ │
183
- │ │ └──────────┘ └────────────┘ │ │
184
- │ │ every 2 min: monitor → diagnose → │ │
185
- │ │ fix conversation-loop.py → deploy │ │
186
- │ └────────────────────────────────────────────────┘ │
187
- │ │
188
- │ Pixel-art frontend + live chat panel │
189
- │ Polls /api/state, renders agent animations │
190
- └──────────────────────────────────────────────────────┘
191
- ```
192
-
193
- **Three layers of autonomy:**
194
-
195
- 1. **Adam & Eve** (OpenClaw instances via A2A) — each is an OpenClaw instance with its own memory and personality. They discuss Cain's state every 15s, assign `[TASK]` blocks to Claude Code via ACP, which clones Cain's repo, makes changes, and pushes.
196
-
197
- 2. **God** (OpenClaw instance, every 2 min) — the autonomous supervisor. Monitors Adam & Eve's conversation for loops, stagnation, or mechanism bugs. When it finds issues, it uses Claude Code via ACP to edit `conversation-loop.py` and pushes to redeploy.
198
-
199
- 3. **Home frontend** — pixel-art dashboard visualizing all agents in real-time (idle, working, syncing, error), with a live bilingual chat panel showing the family conversation.
200
-
201
- - All Spaces use `sdk: docker` with Dockerfile-based deployment
202
- - Each agent runs a full OpenClaw instance in its own HF Space
203
- - Agents discover and communicate via A2A endpoints (`/.well-known/agent.json`)
204
- - State persists to HF Datasets, surviving full Space rebuilds
205
-
206
- | Space | Purpose |
207
- |-------|---------|
208
- | [HuggingClaw](https://huggingface.co/spaces/tao-shen/HuggingClaw) | Main project — deploy your own OpenClaw instance |
209
- | [HuggingClaw Home](https://huggingface.co/spaces/tao-shen/HuggingClaw-Home) | Pixel-art dashboard + conversation-loop.py orchestrator + God supervisor |
210
- | [HuggingClaw-Adam](https://huggingface.co/spaces/tao-shen/HuggingClaw-Adam) | Father agent (OpenClaw instance) |
211
- | [HuggingClaw-Eve](https://huggingface.co/spaces/tao-shen/HuggingClaw-Eve) | Mother agent (OpenClaw instance) |
212
- | [HuggingClaw-Cain](https://huggingface.co/spaces/tao-shen/HuggingClaw-Cain) | First child agent (OpenClaw instance) |
213
-
214
- ---
215
-
216
- ## Quick Start
217
-
218
- ### 1. Duplicate this Space
219
-
220
- Click **Duplicate this Space** on the [HuggingClaw Space page](https://huggingface.co/spaces/tao-shen/HuggingClaw).
221
-
222
- > **After duplicating:** Edit your Space's `README.md` and update the `datasets:` field in the YAML header to point to your own dataset repo (e.g. `your-name/YourSpace-data`), or remove it entirely. This prevents your Space from appearing as linked to the original dataset.
223
-
224
- ### 2. Set Secrets
225
-
226
- Go to **Settings → Repository secrets** and add the following. The only two you *must* set are `HF_TOKEN` and one API key.
227
-
228
- | Secret | Status | Description | Example |
229
- |--------|:------:|-------------|---------|
230
- | `HF_TOKEN` | **Required** | HF Access Token with write permission ([create one](https://huggingface.co/settings/tokens)) | `hf_AbCdEfGhIjKlMnOpQrStUvWxYz` |
231
- | `AUTO_CREATE_DATASET` | **Recommended** | Set to `true` — HuggingClaw will automatically create a private backup dataset on first startup. No manual setup needed. | `true` |
232
- | `OPENROUTER_API_KEY` | Recommended | [OpenRouter](https://openrouter.ai) API key — 200+ models, free tier available. Easiest way to get started. | `sk-or-v1-xxxxxxxxxxxx` |
233
- | `OPENAI_API_KEY` | Optional | OpenAI (or any [OpenAI-compatible](https://openclawdoc.com/docs/reference/environment-variables)) API key | `sk-proj-xxxxxxxxxxxx` |
234
- | `ANTHROPIC_API_KEY` | Optional | Anthropic Claude API key | `sk-ant-xxxxxxxxxxxx` |
235
- | `GOOGLE_API_KEY` | Optional | Google / Gemini API key | `AIzaSyXxXxXxXxXx` |
236
- | `OPENCLAW_DEFAULT_MODEL` | Optional | Default model for new conversations | `openai/gpt-oss-20b:free` |
237
-
238
- ### Data Persistence
239
-
240
- HuggingClaw syncs `~/.openclaw` (conversations, settings, credentials) to a private HuggingFace Dataset repo so your data survives every restart.
241
-
242
- **Option A — Auto mode (recommended)**
243
-
244
- 1. Set `AUTO_CREATE_DATASET` = `true` in your Space secrets
245
- 2. Set `HF_TOKEN` with write permission
246
- 3. Done — on first startup, HuggingClaw automatically creates a private Dataset repo named `your-username/SpaceName-data`. Each duplicated Space gets its own isolated dataset.
247
-
248
- > (Optional) Set `OPENCLAW_DATASET_REPO` = `your-name/custom-name` if you prefer a specific repo name.
249
-
250
- **Option B — Manual mode**
251
-
252
- 1. Go to [huggingface.co/new-dataset](https://huggingface.co/new-dataset) and create a **private** Dataset repo (e.g. `your-name/HuggingClaw-data`)
253
- 2. Set `OPENCLAW_DATASET_REPO` = `your-name/HuggingClaw-data` in your Space secrets
254
- 3. Set `HF_TOKEN` with write permission
255
- 4. Done — HuggingClaw will sync to this repo every 60 seconds
256
-
257
- > **Security note:** `AUTO_CREATE_DATASET` defaults to `false` — HuggingClaw will never create repos on your behalf unless you explicitly opt in.
258
-
259
- ### Environment Variables
260
-
261
- Fine-tune persistence and performance. Set these as **Repository Secrets** in HF Spaces, or in `.env` for local Docker.
262
-
263
- | Variable | Default | Description |
264
- |----------|---------|-------------|
265
- | `GATEWAY_TOKEN` | `huggingclaw` | **Gateway token for Control UI access.** Override to set a custom token. |
266
- | `AUTO_CREATE_DATASET` | `false` | **Auto-create the Dataset repo.** Set to `true` to auto-create a private Dataset repo on first startup. |
267
- | `SYNC_INTERVAL` | `60` | **Backup interval in seconds.** How often data syncs to the Dataset repo. |
268
-
269
- > For the full list (including `OPENAI_BASE_URL`, `OLLAMA_HOST`, proxy settings, etc.), see [`.env.example`](.env.example).
270
-
271
- ### 3. Open the Control UI
272
-
273
- Visit your Space URL. Enter the gateway token (default: `huggingclaw`) to connect. Customize via `GATEWAY_TOKEN` secret.
274
-
275
- Messaging integrations (Telegram, WhatsApp) can be configured directly inside the Control UI after connecting.
276
-
277
- > **Telegram note:** HF Spaces blocks `api.telegram.org` DNS. HuggingClaw automatically probes alternative API endpoints at startup and selects one that works — no manual configuration needed.
278
-
279
- ## Configuration
280
-
281
- HuggingClaw supports **all OpenClaw environment variables** — it passes the entire environment to the OpenClaw process (`env=os.environ.copy()`), so any variable from the [OpenClaw docs](https://openclawdoc.com/docs/reference/environment-variables) works out of the box in HF Spaces. This includes:
282
-
283
- - **API Keys** — `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`, `MISTRAL_API_KEY`, `COHERE_API_KEY`, `OPENROUTER_API_KEY`
284
- - **Server** — `OPENCLAW_API_PORT`, `OPENCLAW_WS_PORT`, `OPENCLAW_HOST`
285
- - **Memory** — `OPENCLAW_MEMORY_BACKEND`, `OPENCLAW_REDIS_URL`, `OPENCLAW_SQLITE_PATH`
286
- - **Network** — `OPENCLAW_HTTP_PROXY`, `OPENCLAW_HTTPS_PROXY`, `OPENCLAW_NO_PROXY`
287
- - **Ollama** — `OLLAMA_HOST`, `OLLAMA_NUM_PARALLEL`, `OLLAMA_KEEP_ALIVE`
288
- - **Secrets** — `OPENCLAW_SECRETS_BACKEND`, `VAULT_ADDR`, `VAULT_TOKEN`
289
-
290
- HuggingClaw adds its own variables for persistence and deployment: `HF_TOKEN`, `OPENCLAW_DATASET_REPO`, `AUTO_CREATE_DATASET`, `SYNC_INTERVAL`, `OPENCLAW_DEFAULT_MODEL`, etc. See [`.env.example`](.env.example) for the complete reference.
291
-
292
- ## Security
293
-
294
- - **Environment isolation** — Each Space runs in its own Docker container, sandboxed from your local machine. Unlike running OpenClaw locally (where it has full system privileges), cloud deployment limits the blast radius.
295
- - **Token authentication** — Control UI requires a gateway token to connect (default: `huggingclaw`, customizable via `GATEWAY_TOKEN`)
296
- - **Secrets stay server-side** — API keys and tokens are never exposed to the browser
297
- - **Private backups** — the Dataset repo is created as private by default
298
-
299
- ## Acknowledgments
300
-
301
- - **[Star-Office-UI](https://github.com/ringhyacinth/Star-Office-UI)** by [@ringhyacinth](https://github.com/ringhyacinth) — the pixel-art animated frontend that powers HuggingClaw Home's lobby visualization
302
- - **[openclaw-a2a-gateway](https://github.com/win4r/openclaw-a2a-gateway)** by [@win4r](https://github.com/win4r) — the A2A protocol plugin enabling inter-agent communication across OpenClaw instances
303
-
304
- ## License
305
-
306
- MIT
 
1
  ---
2
+ title: HuggingClaw Home
3
+ emoji: 🏠
4
  colorFrom: yellow
5
  colorTo: red
6
  sdk: docker
7
  pinned: false
8
  license: mit
9
+ short_description: Family dashboard and orchestrator
 
 
10
  app_port: 7860
11
  tags:
12
  - huggingface
 
 
 
13
  - openclaw
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ---