75ff91565402d14e076bda66f829e8cdbfd3b281
LaodingBot (MVP)
Go-based personal Telegram Agent with:
- Telegram polling transport
- OpenAI-compatible LLM client
- SQLite conversation memory + simple compression
- Tool registry with built-in
fileandshelltools - Default-deny security policy via allowlists
- Soul markdown loading for bot personality
- Skills markdown loading for capability context
- ReAct decision loop with automatic tool execution
Now supports mutually exclusive message channels:
telegram(long polling)feishu(official SDK websocket long connection)
Quick Start
- Prepare env variables (see
configs/env.sample).- The app auto-loads
configs/env(or.env) if present. - You can also set
CONFIG_ENV_FILE=/path/to/env. - Process environment variables override file values.
- The app auto-loads
- Choose exactly one channel with
MESSAGE_CHANNEL=telegram|feishu.- If
telegram: setTELEGRAM_BOT_TOKEN, keepFEISHU_*empty. - If
feishu: setFEISHU_APP_IDandFEISHU_APP_SECRET, keepTELEGRAM_BOT_TOKENempty.
- If
- Set log level with
LOG_LEVEL=debug|info|warn|error.- To inspect full skill/tool execution content and detailed ReAct step traces, use
LOG_LEVEL=debug.
- To inspect full skill/tool execution content and detailed ReAct step traces, use
- Configure knowledge and reasoning:
SOUL_PATHfor bot personality markdown.SKILLS_DIRfor skills markdown directory.REACT_MAX_STEPSfor maximum ReAct steps.
- Create runtime directories:
mkdir -p data workspace
- Run:
go mod tidy
go run ./cmd/bot
Telegram Usage
- Normal text enters unified agent pipeline:
- Receive message and load recent memory context
- Match relevant skill(s) from
skills/ - If no skill matched, respond via direct LLM
- If skill matched, run ReAct and call tools (
shell/file) only when needed - Return final answer
- No
/tool ...command is required for normal use.
Feishu Usage
- Bot uses Feishu official SDK long connection (
ws) to subscribeim.message.receive_v1text events. - Received text is forwarded to the same agent pipeline and replied back to the same chat.
Knowledge Files
- Soul file default path:
bot_context/soul.md - Skills directory default path:
skills/ - Skill format uses subdirectories:
skills/<skill_name>/skill.md
Security Notes
shellonly allows commands listed inALLOWED_COMMANDS.fileonly allows paths insideALLOWED_DIRS.- Working directory for shell is limited by
WORK_DIR.
Next Iteration
- Add skill runtime (process-level hot-plug via RPC)
- Add bootstrap pipeline (generate -> vet/test -> sandbox run -> register)
- Add approval gate for risky commands
Description
Languages
Go
99.4%
Shell
0.3%
Dockerfile
0.3%