Install
openclaw skills install @alvinmediallc/agent-relayBridge between an AI agent and a phone — send/receive messages with attachments and push notifications. Push-first webhook architecture with polling fallback.
openclaw skills install @alvinmediallc/agent-relayBridge between an AI agent and its human's phone. Push-first webhook architecture with polling fallback. Supports text messages, image/file attachments, and standalone push notifications.
Phone → Relay Server (replit.app) → Webhook POST /hooks/agent-relay
↓
Reverse proxy (Caddy/nginx)
↓
OpenClaw hooks engine
↓
Transform: downloads attachments
↓
Isolated agent session
(full tools, memory, search)
↓
relay send → Phone
FALLBACK (runs every 2 min):
cron:poll-inbox-fallback → GET inbox → dedup → re-submit to webhook
Push-first, polling as insurance. No message is lost.
Deploy to Replit (or any Node.js host):
openclaw skills install agent-relay
export RELAY_API_KEY="your-api-key"
export RELAY_BASE_URL="https://your-app.replit.app/api"
Follow the template in references/hooks-config.md. Copy references/transform.mjs
to ~/.openclaw/hooks/transforms/agent-relay.mjs (edit MEDIA_ROOT and paths).
Then restart OpenClaw.
https://your-domain.com/hooks/agent-relayX-Webhook-Secret header){"ok":true}Add a cron job that runs every 2 minutes:
cron add:
schedule: every 120s
session: isolated
payload: agentTurn
message: "Run: scripts/poll-inbox-fallback. Report only if messages were found."
delivery: none
This catches any messages that webhook delivery missed or retried and failed.
./scripts/relay whoami # check connection
./scripts/relay inbox # read pending messages (JSON)
./scripts/relay send "text" # send text message
./scripts/relay notify "title" "body" # push notification (no chat)
./scripts/relay attach "text" "url" "type" "name" # send with attachment
When a push webhook payload includes message.attachment:
[Image attached: photo.jpg (33 KB)]read tool (images) or exec (other files) to inspect./scripts/relay sendNo attachment or failed download → plain text message still flows through.
| Mode | Latency | Reliability | Setup |
|---|---|---|---|
| Push (webhook) | Instant | Best | Needs HTTPS endpoint |
| Polling | 15-120s delay | Good (no HTTPS needed) | Just cron |
| Both (recommended) | Instant | Best of both | Push + fallback cron |
If you can't expose an HTTPS endpoint, use polling-only mode with
scripts/poll-inbox.
| File | Purpose |
|---|---|
SKILL.md | This document |
scripts/relay | CLI for sending messages, reading inbox, pushing notifications |
scripts/poll-inbox | Polling-only inbox reader |
scripts/poll-inbox-fallback | Fallback poller with dedup (for webhook failures) |
references/RELAY_API.md | Full Agent Relay API reference |
references/hooks-config.md | Template for OpenClaw hooks config |
references/transform.mjs | Transform module for attachment downloads |
$RELAY_API_KEY, $RELAY_BASE_URL)$RELAY_API_KEY and restart