Skip to content

OpenKrab β€” Autonomous AI Infrastructure. Any OS. Any Platform. 🦞

License

Notifications You must be signed in to change notification settings

OpenKrab/openkrab

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11,418 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

OpenKrab β€” Personal AI Assistant (Rust Edition)

OpenKrab Logo

CI status GitHub release MIT License Rust Status

OpenKrab is a personal AI assistant designed for self-hosted use across your own devices. The project is implemented in Rust to provide strong performance, predictable resource usage, and memory safety.

OpenKrab integrates with familiar messaging channels (Telegram, Slack, Discord, Signal, WhatsApp, iMessage/BlueBubbles, Matrix, Google Chat, IRC, Microsoft Teams, WebChat) and provides:

  • Native Rust performance with low startup overhead
  • Efficient memory profile for long-running workloads
  • Single-binary deployment across supported platforms
  • Compile-time memory safety guarantees

OpenKrab is a Rust implementation inspired by OpenKrab (TypeScript/Node.js), extended with additional runtime capabilities.

Features Β· Quick Start Β· Architecture Β· Channels Β· Providers


πŸ“Š Benchmark Snapshot (OpenKrab vs Others)

Metric OpenKrab NanoBot PicoClaw OpenKrab ZeroClaw
Language TypeScript Python Go Rust Rust
RAM >1GB >100MB <10MB ~50MB <5MB
Binary Size ~28MB N/A ~8MB ~16MB ~8.8MB
Startup >500s >30s <1s ~46ms <10ms
Cost Mac Mini $599 ~$50 $10 $10 $10

Notes: OpenKrab measured on Windows x86_64, Feb 2026. Binary size is release build. Startup time is CLI --version. RAM is typical runtime memory.


✨ Features

πŸ€– AI Capabilities

  • Multi-agent system β€” Route different channels to different AI personalities
  • Tool use β€” AI can execute shell commands, browse web, process media
  • Streaming responses β€” Real-time token streaming for natural feel
  • Context management β€” Intelligent conversation history handling
  • Memory system β€” AI remembers facts across conversations (vector + text search)

🧠 Advanced Memory & Search

  • Hybrid search β€” Combine vector similarity + full-text search
  • MMR reranking β€” Maximal Marginal Relevance for diverse results
  • Temporal decay β€” Older memories fade naturally
  • Query expansion β€” Automatic keyword extraction (EN/ZH)
  • Embeddings β€” OpenAI, Gemini, Voyage, Ollama providers

πŸ”’ Enterprise Security

  • DM pairing β€” Unknown senders get pairing codes
  • Allowlists β€” allow_from controls who can interact
  • Rate limiting β€” Per-user and global rate limits
  • Input sanitization β€” XSS prevention, content filtering
  • Sandbox mode β€” Docker isolation for non-main sessions
  • Audit logging β€” Comprehensive security event logging
  • MFA/OAuth2 β€” Enterprise authentication support

πŸŽ›οΈ Mission Control

  • Web Dashboard β€” Beautiful, responsive UI for monitoring agents
  • Live Tracking β€” View active sessions, stats, and AI memory in real-time
  • Configuration Management β€” Easy visual editor for system config

πŸŽ™οΈ Voice System

  • Voice wake mode β€” "Hey openkrab" activation
  • Talk mode β€” Continuous conversation with auto-sleep
  • VAD β€” Voice Activity Detection
  • Spectral analysis β€” FFT, spectral features
  • Beep generation β€” Audio feedback
  • Microphone capture β€” Real-time audio input

πŸ”Œ Plugin System

  • WASM runtime β€” Cross-platform plugin execution via Wasmtime
  • Hot reload β€” Development workflow with auto-reload
  • Sandboxing β€” Security isolation (4 levels)
  • Dynamic loading β€” Native libraries + WASM
  • Hook system β€” Event-driven plugin architecture

🌐 Browser Automation

  • CDP (Chrome DevTools Protocol) β€” Full browser control
  • Connection pooling β€” Efficient session management
  • Multi-tab support β€” Handle multiple browser tabs
  • Screenshots & snapshots β€” Visual testing and debugging
  • Network interception β€” Monitor and modify requests

🎨 Canvas/A2UI

  • Agent-to-UI protocol β€” Render dynamic interfaces
  • Surface management β€” Multiple canvas surfaces
  • Component system β€” Reusable UI components
  • Theme support β€” Customizable appearance

πŸš€ Why Rust?

Feature TypeScript (Node.js) Rust (OpenKrab)
Performance V8 JIT limitations Native compiled, 5x faster
Memory Safety Runtime errors possible Compile-time guarantees
Startup Time ~1-2 seconds Instant (<100ms)
Memory Usage 200-500MB+ <100MB typical
Concurrency Single-threaded event loop True async with Tokio
Deployment Requires Node.js runtime Single static binary
Security Best-effort Memory-safe by design

πŸ“¦ Installation

From Source (Recommended)

# Clone the repository
git clone https://github.com/openkrab/openkrab.git
cd openkrab

# Build optimized release binary
cargo build --release

# Binary location: target/release/openkrab
./target/release/openkrab --help

Pre-built Binaries

Download from GitHub Releases for your platform:

  • Linux (x64, ARM64)
  • macOS (Intel, Apple Silicon)
  • Windows (x64)

⚑ Quick Start

# Start the gateway server
openkrab gateway --port 18789

# Configure your AI provider
openkrab config set providers.openai.api_key "sk-..."

# Send messages
openkrab telegram --to @username --text "Hello from OpenKrab!"
openkrab discord --to 123456789 --text "Hello from OpenKrab!"
openkrab whatsapp --to +1234567890 --text "Hello from OpenKrab!"

# Talk to your AI assistant
openkrab ask "What's on my calendar today?"
openkrab ask "Summarize my recent emails"

# Voice commands
openkrab voice wake
openkrab voice speak "Hello World"
openkrab voice status

# Plugin management
openkrab plugin list
openkrab plugin load ./plugins/my-plugin

# Check system status
openkrab status
openkrab doctor

# Interactive configuration
openkrab configure

# Memory operations (AI knowledge base)
openkrab memory sync --path ./docs
openkrab memory search "machine learning concepts"
openkrab memory index --recursive ./knowledge-base

# Browser automation
openkrab browser open https://example.com
openkrab browser screenshot

πŸ—οΈ Architecture

The system is organized around a gateway control plane that receives channel events, routes sessions, and coordinates AI/runtime services.

flowchart TB
    subgraph Clients["Messaging Channels"]
        Telegram["Telegram"]
        Slack["Slack"]
        Discord["Discord"]
        WhatsApp["WhatsApp"]
        Signal["Signal"]
        iMessage["iMessage"]
        WebChat["WebChat"]
    end

    subgraph GatewayPlane["Gateway (Rust/Tokio)"]
        GatewayCore["WebSocket and HTTP Server"]
        Sessions["Sessions Manager"]
        Channels["Channels Registry"]
        Auth["Authentication & Rate Control"]
    end

    subgraph Runtime["Core Runtime"]
        Agents["AI Agents"]
        Memory["Memory - Vector + Full-text Search"]
        Providers["Model Providers"]
        Tools["Tools - Shell, Web, Media, Browser"]
        Voice["Voice - Wake/VAD/TTS"]
    end

    subgraph Plugins["Plugin System (WASM)"]
        WASM["Wasmtime Runtime"]
        HotReload["Hot Reload"]
        Sandbox["Sandbox Security"]
    end

    Telegram --> GatewayCore
    Slack --> GatewayCore
    Discord --> GatewayCore
    WhatsApp --> GatewayCore
    Signal --> GatewayCore
    iMessage --> GatewayCore
    WebChat --> GatewayCore

    GatewayCore --> Agents
    GatewayCore --> Memory
    GatewayCore --> Providers
    GatewayCore --> Tools
    GatewayCore --> Voice

    Agents --> Plugins
Loading

πŸ“± Supported Channels (18 Platforms)

Channel Status Features Lines
Telegram βœ… Complete Bot API, polling, webhooks, media ~1,200
Discord βœ… Complete Gateway, threads, reactions, moderation ~2,500
Slack βœ… Complete Bolt events, blocks, threading ~1,800
WhatsApp βœ… Complete Cloud API, Business API ~1,500
Signal βœ… Complete signal-cli integration ~800
iMessage βœ… Complete BlueBubbles bridge ~1,200
Matrix βœ… Complete Matrix.org protocol ~900
Google Chat βœ… Complete Chat API ~600
IRC βœ… Complete IRC protocol ~500
Microsoft Teams βœ… Complete Bot Framework ~700
Mattermost βœ… Complete Webhooks ~400
Twitch βœ… Complete IRC + API ~600
Zalo βœ… Complete Zalo API ~500
Feishu/Lark βœ… Complete Lark API ~450
Nextcloud Talk βœ… Complete Talk API ~400
Nostr βœ… Complete Nostr protocol ~550
LINE βœ… Complete LINE API ~600
WebChat βœ… Complete WebSocket/HTTP ~800

πŸ€– AI Providers (7+ Providers)

Provider Status Auth Models
OpenAI βœ… API Key GPT-4, GPT-4o, GPT-3.5
Anthropic βœ… API Key Claude 3.5/3 Opus/Sonnet/Haiku
Gemini βœ… API Key / OAuth Gemini 1.5 Pro/Flash
Ollama βœ… Local Llama, Mistral, CodeLlama, etc.
GitHub Copilot βœ… OAuth GPT-4 powered
MiniMax βœ… OAuth MiniMax models
Qwen βœ… OAuth Qwen models

πŸŽ™οΈ Voice Commands

# Voice control
openkrab voice wake                    # Force wake
openkrab voice sleep                   # Force sleep
openkrab voice status                  # Show voice status
openkrab voice speak "Hello"           # TTS output
openkrab voice beep wake               # Play wake beep

# Audio analysis
openkrab voice analyze_audio file.wav  # Analyze audio file
openkrab voice detect "hey openkrab"   # Detect wake phrase
openkrab voice vad file.wav            # Voice activity detection
openkrab voice spectral file.wav       # Spectral analysis

# Microphone
openkrab voice mic_list                # List microphones
openkrab voice mic_start [device]      # Start capture
openkrab voice mic_stop                # Stop capture
openkrab voice mic_read                # Read audio buffer
openkrab voice mic_status              # Check mic status

πŸ”Œ Plugin System

Loading Plugins

# List loaded plugins
openkrab plugin list

# Load a plugin
openkrab plugin load ./plugins/my-plugin

# Unload a plugin
openkrab plugin unload my-plugin

# Enable hot reload (development)
openkrab plugin watch ./plugins

Creating Plugins

Create plugin.json:

{
  "name": "my-plugin",
  "version": "1.0.0",
  "description": "My custom plugin",
  "author": "Your Name",
  "kind": "extension",
  "sandbox": {
    "level": "medium",
    "resources": {
      "max_memory": 67108864
    }
  },
  "tools": [
    {
      "name": "my_tool",
      "description": "Does something useful"
    }
  ],
  "hooks": [
    {
      "event": "message.received",
      "handler": "on_message"
    }
  ]
}

🌐 Browser Automation

# Browser control
openkrab browser open https://example.com
openkrab browser tabs
openkrab browser navigate https://example.com
openkrab browser click "#button"
openkrab browser type "#input" "Hello World"
openkrab browser screenshot
openkrab browser snapshot

# Profile management
openkrab browser profiles
openkrab browser create-profile --name my-profile

πŸ“Š Codebase Statistics

Metric Value
Total Lines ~60,000+ lines of Rust
Test Coverage 450+ tests, 0 failures
Porting Parity 100% Feature Parity with OpenKrab
Channels 18 messaging platforms
AI Providers 7+ LLM providers
Core Modules 62 Rust modules

Module Breakdown

Module Lines Description
Browser 2,708 CDP automation with pooling
Canvas/A2UI 452 Agent-to-UI protocol
Hooks 177 Event system
Voice ~5,000 Wake/VAD/TTS pipeline
Memory ~10,000 Vector + text search
Plugins ~6,000 WASM runtime
Gateway ~12,000 WebSocket/HTTP server
Agents ~8,000 AI runtime + tools

πŸ› οΈ Development

Build & Test

# Debug build
cargo build

# Optimized release build
cargo build --release

# Run tests
cargo test                    # All tests
cargo test --lib             # Library tests only
cargo test --release         # Release mode tests

# Code quality
cargo clippy                 # Linting
cargo fmt                    # Formatting
cargo doc --open             # Generate docs

# Run CLI
cargo run -- --help
cargo run -- gateway --port 18789
cargo run -- ask "Hello world"

πŸ”„ Migration from OpenKrab

  1. Config format: JSON β†’ TOML (better for humans)
  2. Config location: ~/.openkrab/ β†’ ~/.config/openkrab/
  3. Binary name: OpenKrab β†’ openkrab
  4. Most connectors: Compatible with same tokens/webhooks

Migration tool:

openkrab migrate --from-OpenKrab ~/.openkrab/config.json

See Migration Guide for detailed instructions.


πŸ“š Documentation


⭐ Star History

Star History Chart


🀝 Community


🦞 About

OpenKrab was built for Molty, a space lobster AI assistant.

This is a complete Rust port of OpenKrab, originally created by Peter Steinberger and the community.


πŸ“„ License

MIT License β€” see LICENSE


Built with Rust

About

OpenKrab β€” Autonomous AI Infrastructure. Any OS. Any Platform. 🦞

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 93.2%
  • HTML 2.5%
  • Python 1.8%
  • MDX 0.9%
  • Swift 0.7%
  • Shell 0.5%
  • Other 0.4%