Zgent
Examples

MiniClaw

A multi-channel personal AI assistant built with Zgent.

MiniClaw is a personal AI assistant that connects to Telegram, Discord, Slack, and a web chat UI — all through Zgent channels. It demonstrates how Zgent's channel system handles multiple message sources with a single agent definition.

Inspired by OpenClaw, MiniClaw achieves similar functionality in ~1,500 lines of Python.

Architecture

CLI ─────────────┐
Telegram Bot ────┤
Discord Bot ─────┤──▶ Channels ──▶ Zgent Context ──▶ AgentDefinition
Slack Bot ───────┤                                        │
WebChat (HTML) ──┘                                   ClaudeEngine
                                                     + Skills
                                                     + Hooks

How it maps to Zgent

ConceptMiniClaw implementation
ChannelsTelegramChannel, DiscordChannel, SlackChannel, WSServerChannel
DispatcherOne agent instance per chat (keyed by channel + chat ID)
SkillsSKILL.md files loaded from ~/.miniclaw/workspace/skills/
Agent definitionSingle definition with Claude engine and skill-injected system prompt

Quick start

Run the python -m miniclaw ... commands below from zgent/python-sdk/examples/.

Install dependencies

cd zgent/python-sdk/examples
pip install -e ..
pip install websockets

Initialize workspace

cd zgent/python-sdk/examples
python -m miniclaw init

This creates ~/.miniclaw/ with default config, a SOUL.md personality file, and an example skill.

Start the gateway

cd zgent/python-sdk/examples
export ANTHROPIC_API_KEY="sk-ant-..."
python -m miniclaw gateway

Open the web chat

Visit http://127.0.0.1:18790/ in your browser.

Channel adapters

Each channel adapter is a Zgent BaseChannel subclass:

ChannelSession ID formatDependency
WebChatwebchat-{id}websockets
Telegramtg-{chat_id}python-telegram-bot
Discorddc-{channel_id}discord.py
Slacksk-{channel_id}slack-bolt

Configuration

Config file lives at ~/.miniclaw/config.json:

{
  "agent": {
    "model": "claude-sonnet-4-20250514",
    "system_prompt_file": "SOUL.md"
  },
  "gateway": {
    "host": "127.0.0.1",
    "port": 18789
  },
  "channels": {
    "telegram": { "enabled": true, "botToken": "123456:ABCDEF" },
    "discord": { "enabled": true, "token": "..." },
    "slack": { "enabled": true, "botToken": "xoxb-...", "appToken": "xapp-..." }
  }
}

Environment variables override config values:

VariableEffect
ANTHROPIC_API_KEYRequired for Claude
TELEGRAM_BOT_TOKENAuto-enables Telegram channel
DISCORD_BOT_TOKENAuto-enables Discord channel
SLACK_BOT_TOKEN / SLACK_APP_TOKENAuto-enables Slack channel

Skills

Skills are markdown files that extend the assistant's capabilities. Place them under ~/.miniclaw/workspace/skills/<name>/SKILL.md:

~/.miniclaw/workspace/
├── SOUL.md                # Base personality
└── skills/
    ├── coding/
    │   └── SKILL.md       # Coding assistant instructions
    └── writing/
        └── SKILL.md       # Writing style guide

Source code

Browse the full source at python-sdk/examples/miniclaw/.

On this page