Skip to content

guoqingbao/xbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

82 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

xbot logo

A Rust-native autonomous bot runtime for persistent task automation, vibe coding, and multi-channel message delivery. ๐Ÿš€

English | ็ฎ€ไฝ“ไธญๆ–‡ |

โœจ Features

  • ๐Ÿง  Persistent Agent Runtime - Long-running agent runtime with persistent sessions, per-session serialization, and configurable concurrency control
  • ๐Ÿ“ Permanent Memory Capture - LLM-driven memory consolidation, automatic task summaries, explicit /memorize support, and topic-relevant memory lookup
  • ๐Ÿ› ๏ธ Rich Toolset - Filesystem, shell, web fetch, web search, messaging, cron, and background-task tools
  • ๐ŸŒ Provider Integration - OpenAI-compatible, Anthropic, GitHub Copilot (OAuth), Cursor, and local engines
  • ๐Ÿงต Hybrid Model Routing - Run the main task on a remote frontier API such as DeepSeek deepseek-v4-pro, while background subagents use a local Qwen/vLLM/Ollama model for fast parallel work
  • ๐Ÿ”Œ MCP Support - MCP stdio tool integration for external tool servers
  • ๐Ÿงฉ Built-in Skills - Software engineering, research/reporting, GitHub/CI, scheduled operations, memory management, cron, and clawhub marketplace
  • ๐Ÿ“ฌ Multi-Channel - 13 channel backends: email, slack, telegram, feishu, dingtalk, discord, matrix, whatsapp, qq, wecom, weixin, mochat, and extensible plugin channels
  • ๐ŸŒ Gateway Process - Webhook ingress, health checks, readiness checks, Prometheus metrics, and a web admin UI
  • ๐Ÿ”„ Streaming - Stream delta support with per-channel streaming, retry logic with exponential backoff
  • ๐Ÿช Hook System - Extensible AgentHook trait for lifecycle callbacks without modifying the core agent loop

Overview (Hybrid Model Routing)

xbot terminal

The screenshot highlights one of xbot's core advantages: the main agent can use a remote high-capability model, while subagents fan out onto a separate local model. This lets you reserve paid remote tokens for synthesis and hard reasoning, and spend local GPU capacity on parallel exploration, code reading, tests, and report gathering.

๐Ÿ“š Documentation

โšก Quick Start

Install xbot:

npm install -g @trusted-ai/xbot
# or cargo install xbot
# or install a .deb from GitHub Releases
# or install from source code
cargo install --path .

The installed command is xbot. See Installation for details.

Initialize config and workspace:

xbot onboard

This will generate:

# Global config file
Config: ~/.xbot/config.json
# Global workspace
Workspace: ~/.xbot/workspace

Config Providers

xbot supports both remote and local OpenAI-compatible backends. ๐ŸŽฏ You can configure them interactively:

xbot config --provider

Or manually edit ~/.xbot/config.json. Refer to: Getting Started

For the recommended hybrid setup, use a remote main model such as DeepSeek deepseek-v4-pro and a local OpenAI-compatible server such as vLLM serving Qwen for subagents. See Hybrid Remote Main + Local Subagents.

Config Communication Channels

Before starting the backend, you should configure your preferred communication channels (Slack, Telegram, etc.) to enable message ingress and delivery. ๐Ÿ“ฌ

Use the interactive configuration tool:

xbot config --channel

List, configure, and log in to channels:

xbot channels list          # List all available channels
xbot channels status        # Show enabled/disabled state
xbot channels setup discord # Setup instructions (how to get tokens)
xbot channels login weixin  # Interactive login (QR code scan)

Use channels setup <name> to see step-by-step instructions for obtaining the required tokens and keys for any channel. For channels that support interactive login (Weixin QR code, WhatsApp bridge), use channels login. For manual configuration or detailed channel options, see Getting Started.

Tip

Slack Users: Set up Slack App for Agents Slack Manual. Telegram Users: Set up Telegram App for Agents Telegram Manual.

๐ŸงพUsage

CLI usage

xbot working on current folder by default on CLI mode, add --workspace parameter to assign working directory for xbot.

One-shot prompt:

# this will scan and init the project for following tasks (XBOT.md)
xbot chat /init
# xbot chat /init --workspace ANOTHER_PROJECT_PATH
# this will do one task a time
xbot chat "find bugs in this project"

Interactive shell (TUI, rich terminal UI):

xbot repl
# xbot repl --workspace ANOTHER_PROJECT_PATH

The CLI includes:

  • ๐Ÿ“ก Streamed responses
  • ๐Ÿ“œ Persistent history
  • ๐Ÿ’ป Local shell commands such as /help and /clear
  • ๐Ÿค– Agent commands such as /new, /clear, /memorize <text>, /status, /init and /stop

chat and repl use the current directory as the workspace by default and create .xbot/ there. Use xbot repl --global or xbot chat --global "..." for the configured global workspace, or --workspace <path> for an explicit workspace.

Manage skills:

xbot skills list
xbot skills init my-custom-skill

โšก Backend Bot

Start the backend (Personal AI Assistant):

xbot run

run uses the configured global workspace by default. Use xbot run --workspace . when the backend should run against the current project workspace.

Sending task(s) to xbot using configured channels (such as Slack APP).

Check runtime configuration and local state:

xbot status
xbot sessions
xbot jobs
xbot channels status
xbot skills list

๐Ÿ“ก Runtime Surfaces

Channel Backends

  • ๐Ÿ“ง email: IMAP polling + SMTP send
  • ๐Ÿ’ฌ slack: Socket Mode or webhook ingress + send
  • โœˆ๏ธ telegram: webhook ingress + send
  • ๐Ÿฆ˜ feishu: webhook ingress + send, including inbound media/resource handling
  • ๐Ÿ”” dingtalk: Stream gateway WebSocket + REST send
  • ๐ŸŽฎ discord: Gateway v10 WebSocket + REST send
  • ๐Ÿ  matrix: CS API v3 long-poll sync + send
  • ๐Ÿ“ฑ whatsapp: WebSocket bridge to Node.js Baileys
  • ๐Ÿง qq: QQ Bot API WebSocket gateway + REST send
  • ๐Ÿข wecom: Enterprise WeChat AI Bot WebSocket
  • ๐Ÿ’ฌ weixin: Personal WeChat via HTTP long-poll
  • ๐ŸŒ mochat: HTTP polling with session/panel support
  • ๐Ÿ”Œ mcp: stdio-based external tool servers exposed as native tools

Channel Commands

When messaging the bot through Slack, Telegram, or other channels, you can send these signals as standalone messages:

  • stop or /stop - Immediately stop the current agent task and cancel running subagents.
  • clear, new, /clear, or /new - Start a new session and restore .xbot/memory/HISTORY.md to the default template.
  • memorize <text> or /memorize <text> - Store durable user-directed memory in .xbot/memory/MEMORY.md through the memory-entry-writer summarization skill.
  • status or /status - Get the current version and runtime usage stats.
  • help or /help - Show available commands.

Gateway Endpoints

The gateway exposes:

  • โœ… GET /healthz - Health check
  • ๐ŸŸข GET /readyz - Readiness check
  • ๐Ÿ“Š GET /status - Runtime status
  • ๐Ÿ“ˆ GET /metrics - Prometheus metrics
  • ๐ŸŽ›๏ธ GET /admin - Web admin UI
  • ๐Ÿ”ง GET /api/admin/* - Admin API

โœ… Verification

cargo fmt
cargo test

๐ŸŽฏ Use Cases

  • ๐Ÿค– Personal AI Assistant - Always-on AI assistant across your communication channels
  • ๐Ÿ“Š Automated Monitoring - Scheduled tasks and webhook-based monitoring
  • ๐Ÿ”ง DevOps Automation - Tool execution, file operations, and system management
  • ๐Ÿ“ Research & Reporting - Web search, analysis, and report generation
  • ๐Ÿ”„ CI/CD Integration - GitHub/CI automation and status updates

Built with โค๏ธ in Rust ๐Ÿฆ€

About

A minimal Rust AI agent for vibe coding and task automation

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors