DEV Community

Ramu Narasinga
Ramu Narasinga

Posted on

mom, a Slack bot powered by an LLM, in pi-mono codebase.

In this article, we review mom (Master Of Mischief). You will learn:

  1. What is mom?

  2. Features

What is mom?

A Slack bot powered by an LLM that can execute bash commands, read/write files, and interact with your development environment. Mom is self-managing. She installs her own tools, programs CLI tools (aka “skills”) she can use to help with your workflows and tasks, configures credentials, and maintains her workspace autonomously.

Features

  • Minimal by Design: Turn mom into whatever you need. She builds her own tools without pre-built assumptions

  • Self-Managing: Installs tools (apk, npm, etc.), writes scripts, configures credentials. Zero setup from you

  • Slack Integration: Responds to @mentions in channels and DMs

  • Full Bash Access: Execute any command, read/write files, automate workflows

  • Docker Sandbox: Isolate mom in a container (recommended for all use)

  • Persistent Workspace: All conversation history, files, and tools stored in one directory you control

  • Working Memory & Custom Tools: Mom remembers context across sessions and creates workflow-specific CLI tools (aka “skills”) for your tasks

  • Thread-Based Details: Clean main messages with verbose tool details in threads

Check out the slack app setup.

I also looked into its source code and found this below function that has core features:

function createSlackContext(event: SlackEvent, slack: SlackBot, state: ChannelState, isEvent?: boolean) {

  message: {
   text: event.text,
   rawText: event.text,
   user: event.user,
   userName: user?.userName,
   channel: event.channel,
   ts: event.ts,
   attachments: (event.attachments || []).map((a) => ({ local: a.local })),
  },
  channelName: slack.getChannel(event.channel)?.name,
  store: state.store,
  channels: slack.getAllChannels().map((c) => ({ id: c.id, name: c.name })),
  users: slack.getAllUsers().map((u) => ({ id: u.id, userName: u.userName, displayName: u.displayName })),

  respond: async (text: string, shouldLog = true) => {
   ...
  },

  replaceMessage: async (text: string) => {
   ...
  },

  respondInThread: async (text: string) => {
   ...
  },

  setTyping: async (isTyping: boolean) => {
   ...
  },

  uploadFile: async (filePath: string, title?: string) => {
   await slack.uploadFile(event.channel, filePath, title);
  },

  setWorking: async (working: boolean) => {
   ...
  },

  deleteMessage: async () => {
   ...
  },

}
Enter fullscreen mode Exit fullscreen mode

This is in packages/mom/src/main.ts.

About me:

Hey, my name is Ramu Narasinga. Email: ramu.narasinga@gmail.com

Tired of AI slop?

I spent 3+ years studying OSS codebases and wrote 350+ articles on what makes them production-grade. I built an open source tool that reviews your PR against your existing codebase patterns.

Your codebase. Your patterns. Enforced.

Get started for free —thinkthroo.com

References

  1. badlogic/pi-mono/packages/mom/src/main.ts

  2. badlogic/pi-mono/packages/mom/README.md

Top comments (0)