VoidBot English Docs

Back to Index | 中文文档 | Architecture

Overview

VoidBot is a Python agent runtime built around three ideas:

  • Borrow the lightweight execution loop and persistence style from nanobot
  • Borrow the provider compatibility and gateway/runtime separation from openclaw
  • Keep the first version runnable while supporting CLI, gateway, SQLite persistence, multi-provider config, and per-session model switching

Current Capabilities

  • Build runtime context from workspace data, system prompt, tools, and session history
  • Call an OpenAI-compatible /chat/completions endpoint
  • Execute tools and feed tool results back into the model loop
  • Run directly as a CLI or as a standalone gateway
  • Let the gateway receive HTTP, Feishu, and QQ traffic
  • Store sessions, messages, and session metadata in SQLite
  • Configure multiple providers and switch models per session
  • Support canonical identity binding, with local CLI always treated as the owner
  • Let owner-bound direct messages share context with the local main session

Installation

uv tool install --editable .

After installation:

voidbot --help

You can also use the Makefile shortcuts:

make help
make sync
make install
make run

Quick Start

  1. Sync the default config into ~/.voidbot/config.json
voidbot config sync
  1. Check or open the config file
voidbot config path
voidbot config open
  1. Add a model after installation

The easiest path is to append one provider profile with the built-in command instead of editing JSON by hand.

For OpenAI:

voidbot config add-model \
  --provider openai_chatgpt \
  --api-key YOUR_OPENAI_API_KEY \
  --model gpt-4.1-mini \
  --id openai \
  --label "OpenAI GPT-4.1 Mini" \
  --set-default

For Zhipu Coding Plan:

voidbot config add-model \
  --provider zhipu_coding_plan \
  --api-key YOUR_ZHIPU_API_KEY \
  --model glm-4.7 \
  --id zhipu \
  --label "Zhipu GLM-4.7" \
  --set-default

For a custom OpenAI-compatible endpoint:

voidbot config add-model \
  --provider custom_openai_compatible \
  --api-key YOUR_API_KEY \
  --api-base http://localhost:8000/v1 \
  --model your-model-name \
  --id local-model \
  --label "Local Compatible Model" \
  --set-default

After this, the config is written into ~/.voidbot/config.json or the current project's config.json, and VoidBot can connect to that model directly.

  1. Optionally adjust the config manually for advanced fields

  2. Start the CLI

voidbot
  1. Run one message
voidbot --message "Summarize this repository"
  1. Start the gateway
voidbot gateway
  1. Inspect the current identity inside a channel conversation

First, send this to VoidBot from Feishu or QQ:

/whoami

It returns the identity resolved for the current incoming message, including:

  • identity_status
  • actor_user_id
  • actor_external_id
  • actor_is_owner
  • session_id

The most important field here is actor_external_id, because you will use it for binding.

  1. Bind that channel identity to the owner locally

For Feishu:

voidbot identity bind-owner --channel feishu --external-id YOUR_FEISHU_OPEN_ID

For QQ:

voidbot identity bind-owner --channel qq --external-id YOUR_QQ_EXTERNAL_ID

After this, the system layer treats that external identity as the owner. The model does not decide this on its own.

  1. Continue chatting from the channel DM or the local CLI

Current routing rules:

  • Local cli is always treated as the owner and always enters main
  • Direct messages bound to the owner also enter main
  • Unbound identities or group messages do not merge into main

So once you bind a Feishu or QQ direct-message identity to the owner, the local CLI and that direct-message thread share the same context.

  1. Inspect SQLite data
voidbot data dump
voidbot data dump --session-id main

Common make targets:

  • make help
  • make sync
  • make sync-dev
  • make install
  • make reinstall
  • make run
  • make gateway
  • make test
  • make fmt
  • make lint

Config Shape

Key fields:

  • default_provider: default provider id for new sessions
  • providers: list of configured model endpoints
  • providers[].id: stable id used by /use <id>
  • providers[].preset: provider preset name Built-in presets include openai_chatgpt, zhipu_coding_plan, siliconflow, and custom_openai_compatible
  • providers[].api_key: provider API key
  • providers[].api_base: optional compatible base URL
  • providers[].model: model name
  • providers[].label: display label
  • providers[].context_window_tokens: optional per-model context window limit
  • providers[].max_output_tokens: optional per-model output reserve
  • workspace: workspace used by tools and context
  • database_path: SQLite database path
  • cli_via: local / gateway / auto
  • context_window_tokens: global default context window
  • max_output_tokens: global default output reserve
  • context_warn_threshold_ratio: warning threshold when nearing the window
  • context_compact_threshold_ratio: threshold that triggers compaction
  • context_safety_margin_tokens: conservative input headroom
  • context_compaction_max_rounds: maximum preflight compaction rounds

Channel fields:

  • channels.feishu.enabled
  • channels.feishu.app_id
  • channels.feishu.app_secret
  • channels.feishu.group_policy
  • channels.qq.enabled
  • channels.qq.app_id
  • channels.qq.secret

Dynamic Model Switching

Each provider has a unique id, for example:

{
  "default_provider": "1",
  "providers": [
    { "id": "1", "preset": "zhipu_coding_plan", "api_key": "...", "model": "glm-4.7" },
    { "id": "2", "preset": "openai_chatgpt", "api_key": "...", "model": "gpt-4.1-mini" },
    { "id": "3", "preset": "siliconflow", "api_key": "...", "model": "deepseek-ai/DeepSeek-V3" }
  ]
}

Inside a conversation:

/models
/use 2
/whoami
  • /models lists configured models
  • /use <id> switches only the current session
  • /whoami shows the identity resolution result for the current message
  • The selected provider id is stored in SQLite session metadata

Identity Binding

If you want one Feishu or QQ direct-message conversation to share the owner's context with the local CLI, use this flow:

  1. Send /whoami in that direct-message conversation
  2. Copy the returned actor_external_id
  3. Run voidbot identity bind-owner --channel <channel> --external-id <id> locally
  4. Later direct messages from that bound identity are routed into the owner main session

Available commands:

voidbot identity bind-owner --channel feishu --external-id YOUR_FEISHU_OPEN_ID
voidbot identity bind-owner --channel qq --external-id YOUR_QQ_EXTERNAL_ID
voidbot identity list

Notes:

  • bind-owner is a local CLI management command used to bind one external identity to the owner
  • identity list prints canonical users and stored external identity bindings
  • Binding direct-message identities is recommended before binding any group-side identities

User Home

The default user-level data directory is ~/.voidbot:

  • ~/.voidbot/config.json
  • ~/.voidbot/voidbot.db
  • ~/.voidbot/cli_history

Without --config, config lookup order is:

  1. ./config.json
  2. ~/.voidbot/config.json

Notes

  • The model layer currently focuses on OpenAI-compatible APIs first
  • Built-in tools are list_dir, read_file, write_file, and run_command
  • When session history approaches the context budget, VoidBot compacts older turns into a summary and keeps the recent active tail
  • If the provider returns a direct context overflow error, VoidBot tries to compact and retry automatically
  • voidbot starts the interactive CLI by default
  • voidbot gateway starts HTTP and any enabled channel listeners
S
Description
No description provided
Readme
223 KiB
Languages
Python 99.5%
Makefile 0.5%