Skip to content

Commit edc97db

Browse files
committed
gateway: document schedules, stateful conversations, per-channel tier, and the service installer
1 parent 6732169 commit edc97db

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

docs/gateway/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,25 @@ channels:
5252
telegram:
5353
allow_from: ["123456789"] # STABLE user ids (not @handles); "*" = anyone
5454
# respond_to_all: true # act on every message in a group (default: mention required)
55+
# tier: strong # route this channel to a stronger model (strong|frontier)
5556
github:
5657
reply_to: "telegram:123456789" # where CI-failure results are posted
5758
whatsapp:
5859
phone_number_id: "10012345"
5960
active: false # stays inert until Meta verification
6061
allow_from: ["+15555550123"]
62+
schedules:
63+
- name: standup
64+
cron: "0 9 * * 1-5" # or every: "24h"
65+
task: "Summarize yesterday's commits and open PRs"
66+
deliver_to: "telegram:123456789"
6167
```
6268
69+
Conversations are **stateful**: each `(channel, conversation)` keeps its own agent
70+
session, so follow-up messages continue with context instead of starting fresh.
71+
Per-channel `tier` routes a channel to a stronger model (a code-review channel can
72+
run strong while a status channel stays cheap).
73+
6374
## Authorization and triggering
6475

6576
Two independent checks gate a chat message, matching what Hermes and OpenClaw do:
@@ -92,6 +103,13 @@ default locations when no path is given. Anything it can't carry automatically
92103
unsupported channels, WhatsApp's non-transferable QR session) is reported as a
93104
note — never silently dropped.
94105

106+
## Schedules
107+
108+
The gateway isn't only reactive. A `schedules:` entry runs a task on a cadence
109+
(`every: "24h"` or a `cron:` expression) and posts the result to a chat
110+
conversation. Each fire flows through the same durable inbox and reply path as a
111+
chat message, so scheduled work is autonomous but just as reliable.
112+
95113
## Run
96114

97115
```
@@ -100,6 +118,18 @@ memcode gateway
100118
101119
in the project the agent should operate in. It runs until interrupted (Ctrl-C).
102120
121+
### As a background service
122+
123+
To keep it running across logout/reboot instead of a foreground terminal:
124+
125+
```
126+
memcode gateway install
127+
```
128+
129+
This writes a launchd LaunchAgent (macOS) or systemd `--user` unit (Linux) that
130+
runs the gateway in the current project, and prints the command to start it.
131+
`memcode gateway uninstall` removes it.
132+
103133
Chat channels connect outbound (no public URL needed). GitHub and WhatsApp are
104134
inbound webhooks served on `:8787` by default (`webhook.addr`); expose that
105135
endpoint over HTTPS (a tunnel in local dev) and point the platform's webhook at

0 commit comments

Comments
 (0)