back to tutorials

How to Build a Personal AI Automation Agent Like Moltbot with ChatBotKit

Learn how to build a secure, personal AI automation agent similar to Moltbot using ChatBotKit's Blueprint Designer, shell environments, Spaces for file storage, scheduled tasks, and OAuth authentication.

Moltbot (formerly Clawdbot) has taken the AI world by storm as a self-hosted personal automation agent that can execute real tasks on your behalf—scheduling meetings, moving files, running scripts, managing email, and more. But running Moltbot requires significant technical expertise, self-hosting infrastructure, and careful security configuration.

In this tutorial, you'll learn how to build a secure, managed alternative to Moltbot using ChatBotKit's platform. You'll get all the power of a personal AI automation agent—shell access, file management, scheduled tasks, and proactive automation—without the complexity of self-hosting, and with enterprise-grade security built in.

What is Moltbot?

Moltbot is an open-source AI agent that runs on your own device and connects to messaging platforms like WhatsApp, Telegram, Discord, and Slack. Unlike traditional chatbots that just answer questions, Moltbot can:

  • Execute operating system commands and shell scripts
  • Automate file management and organization
  • Schedule recurring tasks and send proactive reminders
  • Manage calendars, emails, and other productivity tools
  • Create and run custom automation scripts
  • Maintain persistent memory across conversations

While powerful, Moltbot requires you to manage your own infrastructure, handle security configurations, and maintain the system yourself.

Why Build on ChatBotKit Instead?

With ChatBotKit, you can achieve the same capabilities with significant advantages:

FeatureSelf-Hosted MoltbotChatBotKit Alternative
InfrastructureYou manage serversFully managed platform
SecurityDIY security configIsolated sandbox environments
Code executionRuns on your machineEphemeral containers with no infrastructure access
File storageLocal filesystemDedicated Spaces per project/user
Task schedulingCron jobs on your serverBuilt-in Task Automation
MessagingSelf-configured bridgesNative integrations (Slack, Discord, WhatsApp, etc.)
OAuthManual implementationBuilt-in shared and personal OAuth
Model accessBring your own API keysMulti-provider access (OpenAI, Anthropic, Google)

What You'll Build

By the end of this tutorial, you'll have a personal AI automation agent that can:

  • Execute shell commands and scripts in isolated sandbox environments
  • Read, write, and manage files in a dedicated persistent Space
  • Create, schedule, and run automated tasks
  • Proactively notify you about task completions
  • Connect to external services via OAuth (personal or shared)
  • Work across multiple messaging platforms

Prerequisites

Before starting, ensure you have:

  • A ChatBotKit account (sign up at chatbotkit.com)
  • Basic understanding of AI agents and conversational AI
  • Approximately 30-45 minutes to complete this tutorial

Quick Start: Want to skip ahead? Check out the complete Moltbot blueprint example in our examples catalogue. You can fork it and customize it to your needs.

Step 1: Create Your Blueprint

Blueprints in ChatBotKit are visual compositions that connect AI components—bots, datasets, skillsets, and abilities—into cohesive agentic systems.

  1. Navigate to Blueprints in the sidebar
  2. Click "Create" and select "Blueprint"
  3. Name your blueprint "Personal Automation Agent"
  4. Click "Design" to enter the Blueprint Designer
  5. Choose "Blank" to start from scratch

Tip: The Blueprint Designer provides a visual canvas where you can drag and drop components from the sidebar to build your agent.

Step 2: Configure Your Agent Bot

Your automation agent needs a bot that defines its personality, capabilities, and behavior.

  1. In the Blueprint Designer, drag a Bot component onto the canvas
  2. Click on the bot to configure it
  3. Set the following properties:

Name: Personal Automation Agent

Model: Choose a capable model:

  • claude-4.5-sonnet - Excellent reasoning and task planning
  • gpt-4o - Great balance of capability and speed
  • o3-mini - Strong reasoning with cost efficiency

Backstory: This system prompt shapes your agent's behavior:

  1. Click Build to apply the configuration

Step 3: Add Shell Execution Abilities

Shell abilities give your agent the power to execute commands in isolated sandbox environments—the core of Moltbot's functionality.

  1. In the Blueprint Designer, add a Skillset component
  2. Click to configure it and add the following abilities from the catalogue:

Core Shell Abilities

Search for "shell" in the abilities catalogue and add:

  • Execute Shell Command (shell/exec): Execute any bash command or script
  • Read File from Shell Environment (shell/read): Read file contents with optional line ranges
  • Write File in Shell Environment (shell/write): Write or modify file contents
  • Import URL to Shell Environment (shell/import): Download files from URLs

Script Execution

  • Execute Python Script (shell/exec/python): Run Python scripts with full library support
  • Execute Node.js Script (shell/exec/node): Run JavaScript/Node.js code
  • Evaluate Python Code (shell/eval/python): Quick Python code evaluation
  • Evaluate JavaScript Code (shell/eval/node): Quick JavaScript evaluation

Understanding the Sandbox

Unlike Moltbot which runs directly on your machine (with full access to your filesystem and network), ChatBotKit's shell execution happens in isolated sandbox containers:

  • Ephemeral: Containers are created on-demand and automatically destroyed after use
  • Isolated: No network access to your infrastructure or other users
  • Resource-limited: Strict CPU, memory, and time limits prevent runaway processes
  • Secure by design: Even malicious code cannot escape the sandbox

This means you get all the automation power without the security risks of running AI-generated code on your actual systems.

Step 4: Create a Dedicated Space for File Storage

Moltbot uses your local filesystem for persistent storage. In ChatBotKit, you use Spaces—dedicated, secure environments where your agent can store and organize files that persist across conversations.

Adding a Space to Your Blueprint

  1. In the Blueprint Designer sidebar, select the Resources tab (the first tab)
  2. Drag a Space component onto the canvas
  3. Click on the Space to configure it
  4. Name it "Automation Workspace" or similar
  5. Add a description: "Personal workspace for automation agent files, scripts, and outputs"

Connecting Space to Your Bot

Shell abilities in ChatBotKit are pre-configured to work with Spaces. When you add shell abilities to your skillset and connect a Space to your blueprint, files written in the shell environment automatically persist to your Space.

Add this to your bot's backstory to explain the workspace:

Step 5: Add Task Management Abilities

One of Moltbot's key features is managing tasks and schedules. ChatBotKit has built-in task abilities that let your agent create, schedule, and manage automated tasks.

Adding Task Abilities

In your skillset, add these abilities from the catalogue:

  • List Tasks (task/list): View all scheduled and one-time tasks
  • Create Task (task/create): Create new tasks with optional schedules
  • Fetch Task (task/fetch[by-id]): Get details of a specific task
  • Update Task (task/update[by-id]): Modify an existing task
  • Delete Task (task/delete[by-id]): Remove a task
  • Run Task (task/run[by-id]): Manually trigger a task execution

Understanding Task Scheduling

Tasks can be scheduled using various formats:

ScheduleDescription
2026-12-31T23:59:59One-time execution at specific datetime
quarterhourlyEvery 15 minutes
halfhourlyEvery 30 minutes
hourlyEvery hour
dailyOnce per day
weeklyOnce per week
monthlyOnce per month
0 9 * * *Custom cron (9 AM daily)
0 0 * * 0Custom cron (midnight on Sundays)

Example Task Workflows

Your agent can now handle requests like:

Creating a daily report task:

User: "Every morning at 8 AM, check our API status and send me a summary" Agent: I'll create a daily task scheduled for 8 AM that will: 1. Query your API endpoints 2. Check response times and status codes 3. Send you a summary via your preferred channel [Creates task with schedule: "0 8 * * *" and detailed description]

Managing existing tasks:

User: "What tasks do I have running?" Agent: [Lists all tasks with their schedules and last run status] User: "Pause the daily report task" Agent: [Updates task to disable scheduling while preserving configuration]

Step 6: Configure Messaging Integration

Moltbot connects to messaging platforms like WhatsApp, Telegram, and Slack. ChatBotKit has native integrations for these platforms.

Available Messaging Integrations

From the Blueprint Designer, you can add integrations for:

  • Slack: Team communication and notifications
  • Discord: Community and team channels
  • WhatsApp: Personal and business messaging
  • Telegram: Secure messaging
  • Email: Send and receive emails

Setting Up Slack Integration

  1. In the Blueprint Designer, add a Slack Integration component
  2. Connect it to your bot
  3. Configure your Slack app credentials
  4. The agent can now:
    • Receive messages from Slack
    • Send proactive notifications
    • Post task completion updates

Proactive Notifications

Unlike simple chatbots, your automation agent can proactively reach out when:

  • Scheduled tasks complete
  • Important events occur
  • Reminders are due
  • Errors need attention

This mirrors Moltbot's ability to send you updates without being prompted.

Step 7: Set Up OAuth for External Services

A key advantage of ChatBotKit is its robust OAuth support with clear separation between shared and personal credentials.

Understanding Secret Types

Secret KindDescriptionUse Case
SharedAuthenticated by you (developer)Service accounts, team-wide API access
PersonalEach user authenticates with their own accountPer-user access to personal calendars, email, etc.

Example: Personal Google Calendar Access

To let your agent manage each user's personal calendar:

  1. Navigate to Secrets in the sidebar
  2. Click "Create Secret"
  3. Select Google Calendar template
  4. Choose Personal kind
  5. Configure OAuth settings:
    • Add your Google OAuth Client ID and Secret
    • Set required scopes for calendar access

Now when users interact with your agent:

User: "Schedule a meeting with John tomorrow at 2 PM" Agent: [Checks for personal Google Calendar token] Agent: [If not authenticated] "I need access to your Google Calendar. Click here to connect: [OAuth Link]" Agent: [After authentication] "I've scheduled a meeting with John for tomorrow at 2 PM. I sent an invite to his email."

Shared Service Credentials

For team-wide integrations that don't require per-user auth:

  1. Create a Shared secret
  2. Authenticate once with a service account
  3. All users of your agent can access this integration

Examples:

  • Company Notion workspace
  • Shared Slack channels
  • Team project management tools

Step 8: Test Your Automation Agent

Test your agent using Chat, ChatBotKit's testing environment.

  1. In the Blueprint Designer, click "Chat"
  2. Start a conversation with your agent

Test Scenarios

Test 1: Shell Command Execution

You: List all files in the current directory

Expected: Agent executes ls -la and shows the output.

Test 2: Script Creation and Execution

You: Write a Python script that calculates the first 20 prime numbers and run it

Expected: Agent creates the script, executes it in the sandbox, and shows results.

Test 3: File Persistence

You: Save that prime numbers script to my workspace as primes.py

Expected: Agent saves the file to your Space for future use.

Test 4: Task Creation

You: Create a task that runs every hour to check disk space and alert me if it's over 80%

Expected: Agent creates a scheduled task with the specified cron schedule.

Test 5: Task Management

You: Show me all my scheduled tasks

Expected: Agent lists all tasks with their schedules and status.

Test 6: Multi-Step Workflow

You: Download the Bitcoin price from CoinGecko API, save it to a file, and create a daily task that does this every morning and saves to a log file

Expected: Agent executes the immediate download, saves to Space, and creates a recurring task.

Step 9: Add Additional Capabilities

Extend your automation agent with more abilities:

Web Search and Browsing

Add the Brave Search ability to let your agent:

  • Search for information
  • Research solutions to problems
  • Stay updated on current events

Email Management

Add email abilities to:

  • Read and summarize incoming emails
  • Draft and send responses
  • Create email-triggered automations

Database and API Access

For data-driven automation:

  • Query databases
  • Make API calls to external services
  • Process and transform data

Multi-Agent Orchestration

For complex workflows, use the Ask a Bot ability to:

  • Route specialized tasks to different agent personas
  • Create evaluation and planning sub-agents
  • Build sophisticated multi-step automations

Security Comparison: Moltbot vs ChatBotKit

Security AspectSelf-Hosted MoltbotChatBotKit
Code execution locationYour machine (full access)Isolated ephemeral containers
Network accessFull network accessNo access to your infrastructure
File system accessYour actual filesystemDedicated Space (isolated)
Credential storageDIY encryptionManaged secret vault
OAuth tokensStored locallyEncrypted, never exposed to AI
Audit loggingManual setupBuilt-in conversation history
Resource limitsNone by defaultEnforced CPU, memory, time limits

Key Security Benefits

  1. Sandbox Isolation: Even if the AI generates malicious code, it cannot affect your systems
  2. Credential Protection: OAuth tokens and API keys never appear in conversation logs
  3. Ephemeral Execution: Each command runs in a fresh container that's destroyed after use
  4. Space Isolation: Each user/project has isolated file storage
  5. Audit Trail: All actions are logged for review and compliance

Troubleshooting

Shell Commands Not Executing

  1. Verify shell abilities are added to your skillset
  2. Check that the skillset is connected to your bot
  3. Ensure your backstory mentions when to use shell commands

Tasks Not Running on Schedule

  1. Verify the task was created successfully (list tasks)
  2. Check the schedule format is correct
  3. Ensure the bot has the necessary abilities to execute the task

Files Not Persisting

  1. Confirm you're saving to the Space, not just ephemeral sandbox
  2. Check Space abilities are properly connected
  3. Verify the Space exists and you have write permissions

OAuth Not Working

  1. Verify OAuth credentials (Client ID, Secret)
  2. Check callback URL configuration
  3. Ensure all required scopes are requested
  4. Test OAuth flow manually in browser

Next Steps

Congratulations! You've built a personal AI automation agent that provides Moltbot-like capabilities with enterprise-grade security.

Explore these resources to expand your agent:

Summary

In this tutorial, you built a personal AI automation agent using ChatBotKit that provides:

  1. Shell Execution: Secure, isolated command and script execution
  2. Dedicated Space: Persistent file storage for your automation workspace
  3. Task Management: Create, schedule, and manage automated tasks with cron-like scheduling
  4. Proactive Automation: Set up recurring tasks that run without manual triggering
  5. OAuth Integration: Connect to external services with personal or shared credentials
  6. Multi-Platform Messaging: Deploy across Slack, Discord, WhatsApp, and more

You've achieved Moltbot's core functionality—personal AI automation that can execute real tasks—but with the security, reliability, and convenience of a managed platform.

Happy automating!