A multi-platform AI agent bot for Slack, Telegram, and Discord β based on pi-mom, with the goal of merging improvements back upstream.
This project is a forked and extended version of the mom package from badlogic/pi-mono by Mario Zechner, licensed under MIT.
- Original project: pi-mom (22K+ stars)
- Base version: forked from pi-mom v0.57.1 (synchronized with
@mariozechner/*packages) - Primary motivation: Internal services urgently needed a multi-platform bot β this fork enables rapid iteration while preparing changes to contribute back upstream
| Aspect | Description |
|---|---|
| Current Status | Temporary standalone fork for urgent internal deployment |
| Ultimate Goal | Merge all improvements back into pi-mono monorepo |
| Unique Value | Multi-platform support (Slack + Telegram + Discord) to be contributed upstream |
Our internal services urgently needed a multi-platform bot, and we couldn't wait for upstream release cycles. This fork allows us to:
- Ship fast: Deploy to production immediately while internal demand is high
- Iterate freely: Test multi-platform adapters (Slack, Telegram, Discord) without monorepo constraints
- Contribute back: All work here is intended to be merged into pi-mono β
mamais not a replacement formom
"This is not a separate product β it's a temporary fork for urgent internal needs, and all improvements will be contributed back to pi-mono."
We actively track the upstream pi-mom and plan to:
- β Submit PRs for platform adapters (Telegram, Discord)
- β Contribute cross-platform abstractions
- β Keep dependencies synchronized with pi-mono releases
- β Document what we learn from production use
- Multi-platform β Slack, Telegram, and Discord adapters out of the box
- Thread sessions β each thread / reply chain gets its own isolated conversation context
- Concurrent threads β multiple threads in the same channel run independently
- Sandbox execution β run agent commands on host or inside a Docker container
- Persistent memory β workspace-level and channel-level
MEMORY.mdfiles - Skills β drop custom CLI tools into
skills/directories - Event system β schedule one-shot or recurring tasks via JSON files
- Multi-provider β configure any provider/model supported by
pi-ai
- Node.js >= 20
- One of the platform integrations below
npm install -g @geminixiang/mamaOr run directly after cloning:
npm install
npm run build- Create a Slack app with Socket Mode enabled (setup guide).
- Add the
app_mentions:read,chat:write,files:write, andim:historyOAuth scopes. - Enable the Home Tab:
- App Home β Show Tabs β toggle Home Tab on
- App Home β Agents & AI Apps β toggle Agent or Assistant on
- Event Subscriptions β Subscribe to bot events β add
app_home_opened
- Copy the App-Level Token (
xapp-β¦) and Bot Token (xoxb-β¦).
export MOM_SLACK_APP_TOKEN=xapp-...
export MOM_SLACK_BOT_TOKEN=xoxb-...
mama [--sandbox=host|docker:<container>] <working-directory>The bot responds when @mentioned in any channel or via DM. Each Slack thread is a separate session.
- Message @BotFather β
/newbotto create a bot and get the Bot Token. - Optionally disable privacy mode (
/setprivacy β Disable) so the bot can read group messages without being@mentioned.
export MOM_TELEGRAM_BOT_TOKEN=123456:ABC-...
mama [--sandbox=host|docker:<container>] <working-directory>- Private chats β every message is forwarded to the bot automatically.
- Group chats β the bot only responds when
@mentionedby username. - Reply chains β replying to a previous message continues the same session.
- Say
stopor/stopto cancel a running task.
- Go to the Discord Developer Portal β New Application.
- Under Bot, enable Message Content Intent (required to read message text).
- Under OAuth2 β URL Generator, select scopes
bot+ permissionsSend Messages,Read Message History,Attach Files. Invite the bot to your server with the generated URL. - Copy the Bot Token.
export MOM_DISCORD_BOT_TOKEN=MTI...
mama [--sandbox=host|docker:<container>] <working-directory>- Server channels β the bot responds when
@mentioned. - DMs β every message is forwarded automatically.
- Threads β messages inside a Discord thread share a single session.
- Reply chains β replying to a message continues that session.
- Say
stopor/stopto cancel a running task.
| Option | Default | Description |
|---|---|---|
--sandbox=host |
β | Run commands directly on host |
--sandbox=docker:<name> |
Run commands inside a Docker container | |
--download <channel-id> |
Download channel history to stdout and exit (Slack only) |
mama --download C0123456789Create settings.json in your working directory to override defaults:
{
"provider": "anthropic",
"model": "claude-sonnet-4-5",
"thinkingLevel": "off",
"sessionScope": "thread"
}| Field | Default | Description |
|---|---|---|
provider |
anthropic |
AI provider (env: MOM_AI_PROVIDER) |
model |
claude-sonnet-4-5 |
Model name (env: MOM_AI_MODEL) |
thinkingLevel |
off |
off / low / medium / high |
sessionScope |
thread |
thread (per thread/reply chain) or channel |
<working-directory>/
βββ settings.json # AI provider/model config
βββ MEMORY.md # Global memory (all channels)
βββ SYSTEM.md # Installed packages / env changes log
βββ skills/ # Global skills (CLI tools)
βββ events/ # Scheduled event files
βββ <channel-id>/
βββ MEMORY.md # Channel-specific memory
βββ log.jsonl # Full message history
βββ attachments/ # Downloaded user files
βββ scratch/ # Agent working directory
βββ skills/ # Channel-specific skills
βββ sessions/
βββ <thread-ts>/
βββ context.jsonl # LLM conversation context
# Create a container (mount your working directory to /workspace)
docker run -d --name mama-sandbox \
-v /path/to/workspace:/workspace \
alpine:latest sleep infinity
# Start mama with Docker sandbox
mama --sandbox=docker:mama-sandbox /path/to/workspaceDrop JSON files into <working-directory>/events/ to trigger the agent:
// Immediate β triggers as soon as mama sees the file
{"type": "immediate", "channelId": "C0123456789", "text": "New deployment finished"}
// One-shot β triggers once at a specific time
{"type": "one-shot", "channelId": "C0123456789", "text": "Daily standup reminder", "at": "2025-12-15T09:00:00+08:00"}
// Periodic β triggers on a cron schedule
{"type": "periodic", "channelId": "C0123456789", "text": "Check inbox", "schedule": "0 9 * * 1-5", "timezone": "Asia/Taipei"}Create reusable CLI tools by adding a directory with a SKILL.md:
skills/
βββ my-tool/
βββ SKILL.md # name + description frontmatter, usage docs
βββ run.sh # the actual script
SKILL.md frontmatter:
---
name: my-tool
description: Does something useful
---
Usage: {baseDir}/run.sh <args>npm run dev # watch mode
npm test # run tests
npm run build # production build| Package | mama Version | pi-mom Synced Version |
|---|---|---|
@mariozechner/pi-agent-core |
^0.57.1 |
β Synchronized |
@mariozechner/pi-ai |
^0.57.1 |
β Synchronized |
@mariozechner/pi-coding-agent |
^0.57.1 |
β Synchronized |
@anthropic-ai/sandbox-runtime |
^0.0.40 |
MIT β see LICENSE.
Note: This project inherits the MIT license from pi-mom and aims to keep its contributions compatible with the upstream ecosystem.