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/completionsendpoint - 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
mainsession
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
- Sync the default config into
~/.voidbot/config.json
voidbot config sync
- Check or open the config file
voidbot config path
voidbot config open
- 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.
-
Optionally adjust the config manually for advanced fields
-
Start the CLI
voidbot
- Run one message
voidbot --message "Summarize this repository"
- Start the gateway
voidbot gateway
- 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_statusactor_user_idactor_external_idactor_is_ownersession_id
The most important field here is actor_external_id, because you will use it for binding.
- 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.
- Continue chatting from the channel DM or the local CLI
Current routing rules:
- Local
cliis always treated as the owner and always entersmain - 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.
- Inspect SQLite data
voidbot data dump
voidbot data dump --session-id main
Common make targets:
make helpmake syncmake sync-devmake installmake reinstallmake runmake gatewaymake testmake fmtmake lint
Config Shape
Key fields:
default_provider: default provider id for new sessionsproviders: list of configured model endpointsproviders[].id: stable id used by/use <id>providers[].preset: provider preset name Built-in presets includeopenai_chatgpt,zhipu_coding_plan,siliconflow, andcustom_openai_compatibleproviders[].api_key: provider API keyproviders[].api_base: optional compatible base URLproviders[].model: model nameproviders[].label: display labelproviders[].context_window_tokens: optional per-model context window limitproviders[].max_output_tokens: optional per-model output reserveworkspace: workspace used by tools and contextdatabase_path: SQLite database pathcli_via:local/gateway/autocontext_window_tokens: global default context windowmax_output_tokens: global default output reservecontext_warn_threshold_ratio: warning threshold when nearing the windowcontext_compact_threshold_ratio: threshold that triggers compactioncontext_safety_margin_tokens: conservative input headroomcontext_compaction_max_rounds: maximum preflight compaction rounds
Channel fields:
channels.feishu.enabledchannels.feishu.app_idchannels.feishu.app_secretchannels.feishu.group_policychannels.qq.enabledchannels.qq.app_idchannels.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
/modelslists configured models/use <id>switches only the current session/whoamishows 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:
- Send
/whoamiin that direct-message conversation - Copy the returned
actor_external_id - Run
voidbot identity bind-owner --channel <channel> --external-id <id>locally - Later direct messages from that bound identity are routed into the owner
mainsession
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-owneris a local CLI management command used to bind one external identity to the owneridentity listprints 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:
./config.json~/.voidbot/config.json
Notes
- The model layer currently focuses on OpenAI-compatible APIs first
- Built-in tools are
list_dir,read_file,write_file, andrun_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
voidbotstarts the interactive CLI by defaultvoidbot gatewaystarts HTTP and any enabled channel listeners