How to Build a Personal AI Automation Agent Like Moltbot with ChatBotKit
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:
| Feature | Self-Hosted Moltbot | ChatBotKit Alternative |
|---|---|---|
| Infrastructure | You manage servers | Fully managed platform |
| Security | DIY security config | Isolated sandbox environments |
| Code execution | Runs on your machine | Ephemeral containers with no infrastructure access |
| File storage | Local filesystem | Dedicated Spaces per project/user |
| Task scheduling | Cron jobs on your server | Built-in Task Automation |
| Messaging | Self-configured bridges | Native integrations (Slack, Discord, WhatsApp, etc.) |
| OAuth | Manual implementation | Built-in shared and personal OAuth |
| Model access | Bring your own API keys | Multi-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.
- Navigate to Blueprints in the sidebar
- Click "Create" and select "Blueprint"
- Name your blueprint "Personal Automation Agent"
- Click "Design" to enter the Blueprint Designer
- 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.
- In the Blueprint Designer, drag a Bot component onto the canvas
- Click on the bot to configure it
- Set the following properties:
Name: Personal Automation Agent
Model: Choose a capable model:
claude-4.5-sonnet- Excellent reasoning and task planninggpt-4o- Great balance of capability and speedo3-mini- Strong reasoning with cost efficiency
Backstory: This system prompt shapes your agent's behavior:
- 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.
- In the Blueprint Designer, add a Skillset component
- 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
- In the Blueprint Designer sidebar, select the Resources tab (the first tab)
- Drag a Space component onto the canvas
- Click on the Space to configure it
- Name it "Automation Workspace" or similar
- 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:
| Schedule | Description |
|---|---|
2026-12-31T23:59:59 | One-time execution at specific datetime |
quarterhourly | Every 15 minutes |
halfhourly | Every 30 minutes |
hourly | Every hour |
daily | Once per day |
weekly | Once per week |
monthly | Once per month |
0 9 * * * | Custom cron (9 AM daily) |
0 0 * * 0 | Custom 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
- In the Blueprint Designer, add a Slack Integration component
- Connect it to your bot
- Configure your Slack app credentials
- 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 Kind | Description | Use Case |
|---|---|---|
| Shared | Authenticated by you (developer) | Service accounts, team-wide API access |
| Personal | Each user authenticates with their own account | Per-user access to personal calendars, email, etc. |
Example: Personal Google Calendar Access
To let your agent manage each user's personal calendar:
- Navigate to Secrets in the sidebar
- Click "Create Secret"
- Select Google Calendar template
- Choose Personal kind
- 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:
- Create a Shared secret
- Authenticate once with a service account
- 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.
- In the Blueprint Designer, click "Chat"
- 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 Aspect | Self-Hosted Moltbot | ChatBotKit |
|---|---|---|
| Code execution location | Your machine (full access) | Isolated ephemeral containers |
| Network access | Full network access | No access to your infrastructure |
| File system access | Your actual filesystem | Dedicated Space (isolated) |
| Credential storage | DIY encryption | Managed secret vault |
| OAuth tokens | Stored locally | Encrypted, never exposed to AI |
| Audit logging | Manual setup | Built-in conversation history |
| Resource limits | None by default | Enforced CPU, memory, time limits |
Key Security Benefits
- Sandbox Isolation: Even if the AI generates malicious code, it cannot affect your systems
- Credential Protection: OAuth tokens and API keys never appear in conversation logs
- Ephemeral Execution: Each command runs in a fresh container that's destroyed after use
- Space Isolation: Each user/project has isolated file storage
- Audit Trail: All actions are logged for review and compliance
Troubleshooting
Shell Commands Not Executing
- Verify shell abilities are added to your skillset
- Check that the skillset is connected to your bot
- Ensure your backstory mentions when to use shell commands
Tasks Not Running on Schedule
- Verify the task was created successfully (list tasks)
- Check the schedule format is correct
- Ensure the bot has the necessary abilities to execute the task
Files Not Persisting
- Confirm you're saving to the Space, not just ephemeral sandbox
- Check Space abilities are properly connected
- Verify the Space exists and you have write permissions
OAuth Not Working
- Verify OAuth credentials (Client ID, Secret)
- Check callback URL configuration
- Ensure all required scopes are requested
- 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:
- Creating an AI Agent That Can Interact with Shells: Advanced shell usage
- Task Automation Feature: Deep dive into scheduling
- Collaborative Spaces Feature: Advanced file management
- OAuth Secrets Documentation: Credential management
- Building a Simple Multi-Agent System: Create specialized agent teams
Summary
In this tutorial, you built a personal AI automation agent using ChatBotKit that provides:
- Shell Execution: Secure, isolated command and script execution
- Dedicated Space: Persistent file storage for your automation workspace
- Task Management: Create, schedule, and manage automated tasks with cron-like scheduling
- Proactive Automation: Set up recurring tasks that run without manual triggering
- OAuth Integration: Connect to external services with personal or shared credentials
- 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!