Skip to content

πŸ¦€ Secure, fast and Ultra-lightweight personal AI assistant in Rust. Alternative to OpenClaw

License

Notifications You must be signed in to change notification settings

DioCrafts/OxiBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– OxiBot: Ultra-Lightweight Personal AI Assistant in Rust

Rust License Tests RAM Binary

A Rust reimplementation of nanobot β€” delivering the same features with zero runtime dependencies, ultra-low memory, and sub-second startup.


πŸ¦€ OxiBot is an ultra-lightweight personal AI assistant built entirely in Rust.

⚑️ Ships as a single static binary (~18K lines of Rust) with no Python, no pip, no runtime dependencies.

🎯 Feature-complete port of nanobot: same config format, same channels, same skills, same CLI.

Metric OxiBot nanobot
Language Rust Python
Binary Single static file pip install + 50+ deps
RAM < 8 MB ~50-100 MB
Startup < 1 s 2-4 s
LOC (core) ~18,372 ~3,510
Cross-compile x86_64, ARM64, RISC-V Python-only

πŸ“¦ Install

From source (recommended)

git clone https://github.com/DioCrafts/OxiBot.git
cd OxiBot
cargo build --release

Binary output: target/release/oxibot

With specific channel features

# Only Telegram
cargo build --release --features "telegram"

# Multiple channels
cargo build --release --features "telegram,discord,slack"

# All channels (what the Dockerfile uses)
cargo build --release --features "telegram,discord,whatsapp,slack,email"

Feature Flags

Feature Description
telegram Telegram bot via teloxide
discord Discord bot via WebSocket gateway
whatsapp WhatsApp via Node.js bridge (Baileys)
slack Slack bot via Socket Mode
email Email via IMAP + SMTP

πŸš€ Quick Start

Tip

Set your API key in ~/.oxibot/config.json. Get API keys: OpenRouter (recommended) Β· Anthropic Β· Brave Search (optional)

1. Initialize

oxibot onboard

2. Configure (~/.oxibot/config.json)

{
  "providers": {
    "openrouter": {
      "apiKey": "sk-or-v1-xxx"
    }
  },
  "agents": {
    "defaults": {
      "model": "anthropic/claude-sonnet-4-20250514"
    }
  }
}

3. Chat

oxibot agent -m "What is 2+2?"

That's it! Working AI assistant in 2 minutes. πŸŽ‰

πŸ–₯️ Local Models (vLLM)

Run OxiBot with your own local LLMs using vLLM or any OpenAI-compatible server.

{
  "providers": {
    "vllm": {
      "apiKey": "dummy",
      "apiBase": "http://localhost:8000/v1"
    }
  },
  "agents": {
    "defaults": {
      "model": "meta-llama/Llama-3.1-8B-Instruct"
    }
  }
}
oxibot agent -m "Hello from my local LLM!"

Tip

The apiKey can be any non-empty string for local servers that don't require authentication.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        oxibot (single binary)                       β”‚
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ oxibot-  β”‚  β”‚   oxibot-     β”‚  β”‚  oxibot-   β”‚  β”‚   oxibot-   β”‚   β”‚
β”‚  β”‚  cli     │──│   agent       │──│  providers β”‚  β”‚   cron      β”‚   β”‚
β”‚  β”‚          β”‚  β”‚               β”‚  β”‚            β”‚  β”‚             β”‚   β”‚
β”‚  β”‚ commands β”‚  β”‚ loop, tools,  β”‚  β”‚ 12 LLM     β”‚  β”‚ scheduler,  β”‚   β”‚
β”‚  β”‚ gateway  β”‚  β”‚ memory, ctx   β”‚  β”‚ backends   β”‚  β”‚ jobs, store β”‚   β”‚
β”‚  β”‚ repl     β”‚  β”‚ skills, sub   β”‚  β”‚ + whisper  β”‚  β”‚             β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚       β”‚                β”‚                                    β”‚       β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”‚
β”‚  β”‚                     oxibot-core                               β”‚  β”‚
β”‚  β”‚   config Β· bus Β· session Β· heartbeat Β· types Β· utils          β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                             β”‚                                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                    oxibot-channels                            β”‚  β”‚
β”‚  β”‚   telegram Β· discord Β· whatsapp Β· slack Β· email               β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ (WhatsApp only)
         β”‚ WebSocket ws://localhost:3001
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Node.js WhatsApp Bridge         β”‚
β”‚  (Baileys v7, TypeScript)        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ’¬ Chat Apps

Talk to OxiBot through Telegram, Discord, WhatsApp, Slack, or Email β€” anytime, anywhere.

Channel Setup Requires
Telegram Easy Bot token
Discord Easy Bot token + intents
WhatsApp Medium Node.js + QR scan
Slack Medium Bot + App tokens
Email Medium IMAP/SMTP credentials
Telegram (Recommended)

1. Create a bot β€” Open Telegram β†’ @BotFather β†’ /newbot β†’ copy the token

2. Configure

{
  "channels": {
    "telegram": {
      "token": "YOUR_BOT_TOKEN",
      "allowedUsers": ["YOUR_USER_ID"]
    }
  }
}

3. Build & Run

cargo build --release --features telegram
oxibot gateway
Discord

1. Create a bot

  • Discord Developer Portal β†’ Create Application β†’ Bot β†’ Add Bot
  • Enable MESSAGE CONTENT INTENT
  • Copy the bot token

2. Invite the bot

  • OAuth2 β†’ URL Generator β†’ Scopes: bot β†’ Permissions: Send Messages, Read Message History
  • Open the generated URL and add to your server

3. Configure

{
  "channels": {
    "discord": {
      "token": "YOUR_BOT_TOKEN",
      "allowedUsers": ["YOUR_USER_ID"]
    }
  }
}

4. Build & Run

cargo build --release --features discord
oxibot gateway
WhatsApp

Requires Node.js β‰₯20 for the Baileys bridge.

1. Build the bridge

cd bridge && npm install && npm run build && cd ..

2. Link device

oxibot channels login
# Scan QR with WhatsApp β†’ Settings β†’ Linked Devices

3. Configure

{
  "channels": {
    "whatsapp": {
      "bridgeUrl": "ws://localhost:3001",
      "allowedUsers": ["+1234567890"]
    }
  }
}

4. Run (two terminals)

# Terminal 1: Start the bridge
cd bridge && npm start

# Terminal 2: Start the bot
cargo build --release --features whatsapp
oxibot gateway
Slack

Uses Socket Mode β€” no public URL required.

1. Create a Slack app

  • Slack API β†’ Create New App β†’ "From scratch"
  • Socket Mode: Toggle ON β†’ Generate App-Level Token (xapp-...)
  • OAuth & Permissions: Add scopes: chat:write, reactions:write, app_mentions:read
  • Event Subscriptions: Toggle ON β†’ Subscribe: message.im, message.channels, app_mention
  • App Home: Enable Messages Tab β†’ Allow messages
  • Install to Workspace β†’ Copy Bot Token (xoxb-...)

2. Configure

{
  "channels": {
    "slack": {
      "botToken": "xoxb-...",
      "appToken": "xapp-...",
      "groupPolicy": "mention"
    }
  }
}

3. Build & Run

cargo build --release --features slack
oxibot gateway

[!TIP] groupPolicy: "mention" (respond to @mentions), "open" (all messages), or "allowlist".

Email

Polls IMAP for incoming mail, replies via SMTP.

1. Get credentials (Gmail example: enable 2FA β†’ create App Password)

2. Configure

{
  "channels": {
    "email": {
      "imapHost": "imap.gmail.com",
      "imapPort": 993,
      "imapUsername": "my-oxibot@gmail.com",
      "imapPassword": "your-app-password",
      "smtpHost": "smtp.gmail.com",
      "smtpPort": 587,
      "smtpUsername": "my-oxibot@gmail.com",
      "smtpPassword": "your-app-password",
      "fromAddress": "my-oxibot@gmail.com",
      "allowedUsers": ["your-real-email@gmail.com"]
    }
  }
}

3. Build & Run

cargo build --release --features email
oxibot gateway

βš™οΈ Configuration

Config file: ~/.oxibot/config.json

Providers

Provider Purpose Get API Key
openrouter LLM (recommended, access to all models) openrouter.ai
anthropic LLM (Claude direct) console.anthropic.com
openai LLM (GPT direct) platform.openai.com
deepseek LLM (DeepSeek direct) platform.deepseek.com
groq LLM + Voice transcription (Whisper) console.groq.com
gemini LLM (Gemini direct) aistudio.google.com
minimax LLM (MiniMax direct) platform.minimax.io
aihubmix LLM (API gateway) aihubmix.com
dashscope LLM (Qwen) dashscope.console.aliyun.com
moonshot LLM (Moonshot/Kimi) platform.moonshot.cn
zhipu LLM (Zhipu GLM) open.bigmodel.cn
vllm LLM (local, any OpenAI-compatible server) β€”

Tip

Groq provides free voice transcription via Whisper. If configured, Telegram voice messages will be automatically transcribed.

Environment Variables

All env vars use OXIBOT_ prefix with __ as section delimiter:

export OXIBOT_PROVIDERS__ANTHROPIC__API_KEY=sk-ant-xxx
export OXIBOT_AGENTS__DEFAULTS__MODEL=anthropic/claude-sonnet-4-20250514
export OXIBOT_GATEWAY__PORT=9090

Config precedence: Defaults β†’ config.json β†’ Environment variables (env overrides all).

Security

For production, set "restrictToWorkspace": true to sandbox the agent.

Option Default Description
tools.restrictToWorkspace false Restricts all agent tools to workspace directory
channels.*.allowedUsers [] (allow all) Whitelist of user IDs. Empty = allow everyone

See SECURITY.md for comprehensive security guidance.

πŸ“– CLI Reference

Command Description
oxibot onboard Initialize config & workspace
oxibot agent -m "..." Chat (single message)
oxibot agent Interactive REPL
oxibot agent --no-markdown Plain-text replies
oxibot agent --logs Show debug logs
oxibot gateway Start all channels + cron + heartbeat
oxibot status Show config & provider status
oxibot channels status Show channel status
oxibot channels login Link WhatsApp (scan QR)
oxibot cron list List scheduled jobs
oxibot cron add Add a scheduled job
oxibot cron remove <id> Remove a job
oxibot cron enable <id> Enable/disable a job
oxibot cron run <id> Manually trigger a job

Interactive mode exits: exit, quit, /exit, /quit, :q, Ctrl-C, Ctrl-D.

Scheduled Tasks (Cron)
# Cron expression
oxibot cron add --name "morning" --message "Daily summary" --cron "0 9 * * *"

# Interval (seconds)
oxibot cron add --name "check" --message "Status update" --every 3600

# One-time at specific time
oxibot cron add --name "remind" --message "Call dentist" --at "2026-03-01T09:00:00"

# With channel delivery
oxibot cron add --name "alert" --message "Health check" --every 300 \
  --deliver --channel telegram --to "123456789"

# List / remove
oxibot cron list
oxibot cron remove <job_id>

🎯 Skills

Bundled skills in crates/oxibot-agent/skills/:

Skill Description
skill-creator Guides the agent on creating new skills
weather Weather via wttr.in (no API key needed)
cron Schedule reminders and recurring tasks
tmux Remote-control tmux sessions
github Interact with GitHub via gh CLI
summarize Summarize URLs and articles

Custom skills can be added to ~/.oxibot/workspace/skills/.

🐳 Docker

# Build the image
docker build -t oxibot .

# Initialize (first time)
docker run -v ~/.oxibot:/home/oxibot/.oxibot --rm oxibot onboard

# Edit config to add API keys
vim ~/.oxibot/config.json

# Run gateway
docker run -d \
  -v ~/.oxibot:/home/oxibot/.oxibot \
  -p 18790:18790 \
  oxibot gateway

# Single command
docker run -v ~/.oxibot:/home/oxibot/.oxibot --rm oxibot agent -m "Hello!"
docker run -v ~/.oxibot:/home/oxibot/.oxibot --rm oxibot status

Tip

The -v ~/.oxibot:/home/oxibot/.oxibot flag persists config and workspace across container restarts.

πŸ“ Project Structure

OxiBot/
β”œβ”€β”€ Cargo.toml                  # Workspace root
β”œβ”€β”€ Dockerfile                  # Multi-stage build (Rust + Node.js bridge)
β”œβ”€β”€ bridge/                     # πŸŒ‰ Node.js WhatsApp bridge (Baileys)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.ts            #    Entry point
β”‚   β”‚   β”œβ”€β”€ server.ts           #    WebSocket server
β”‚   β”‚   └── whatsapp.ts         #    Baileys client
β”‚   └── package.json
└── crates/
    β”œβ”€β”€ oxibot-core/            # βš™οΈ  Config, bus, session, heartbeat, utils
    β”œβ”€β”€ oxibot-agent/           # 🧠  Agent loop, tools, memory, context, skills
    β”‚   └── skills/             # 🎯  Bundled skills (weather, cron, tmux, etc.)
    β”œβ”€β”€ oxibot-providers/       # πŸ€–  12 LLM backends + Whisper transcription
    β”œβ”€β”€ oxibot-channels/        # πŸ“±  Telegram, Discord, WhatsApp, Slack, Email
    β”œβ”€β”€ oxibot-cron/            # ⏰  Scheduled task engine
    └── oxibot-cli/             # πŸ–₯️  CLI commands, gateway, REPL

πŸ§ͺ Testing

# Run all tests
cargo test --workspace

# With all channel features
cargo test --workspace --features "telegram,discord,whatsapp,slack,email"

# Specific crate
cargo test -p oxibot-core
cargo test -p oxibot-agent
cargo test -p oxibot-providers
cargo test -p oxibot-channels
cargo test -p oxibot-cron
cargo test -p oxibot-cli

See TESTING-GUIDE.md for comprehensive testing procedures, sample configs, and Docker instructions.

🀝 Contributing

PRs welcome! See CONTRIBUTING.md for guidelines.

Roadmap:

  • Core agent loop (tools, memory, sessions)
  • 12 LLM providers
  • 5 chat channels (Telegram, Discord, WhatsApp, Slack, Email)
  • Cron scheduler
  • Heartbeat service
  • Voice transcription (Groq Whisper)
  • WhatsApp bridge (TypeScript + Baileys)
  • Multi-modal support (images, video)
  • Enhanced long-term memory
  • Web UI dashboard
  • Plugin system for custom tools
  • CI/CD with GitHub Actions

πŸ“œ License

MIT

OxiBot is a Rust reimplementation of nanobot for educational and research purposes.