Kiến trúc
Bestie là runtime local-first, tự host được. Cùng một runtime core phục vụ terminal chat, Telegram, UI local tương lai, MCP và các extension sau này.
User / Channel -> Channel Adapter -> Runtime Orchestrator -> Mode Detector -> Memory Router -> Prompt Builder -> LLM Adapter -> Safety / Permission Layer -> Tool / Plugin / MCP Router -> Response -> Logs + Memory UpdateCLI sở hữu các lệnh user-facing:
onboardchatstatuslogsdoctormemorytelegramtoolsmcp
CLI nên gọi runtime services, không duplicate business logic.
Runtime
Phần tiêu đề “Runtime”Một turn đi qua các bước:
- Nhận message từ terminal, Telegram hoặc adapter khác.
- Load config, env, character files và memory context.
- Build prompt.
- Gọi OpenAI-compatible LLM.
- Chạy tool loop nếu được phép.
- Gửi response.
- Lưu logs đã redact và memory updates được duyệt.
Character system
Phần tiêu đề “Character system”Bestie load character từ file local như character.json, system-prompt.md, style examples và safety boundaries.
Mục tiêu là một AI best friend có cá tính: hài, thẳng, biết quan tâm, có thể phản biện nhưng không hạ nhục người dùng.
Memory router
Phần tiêu đề “Memory router”Memory hiện tại dùng SQLite local. Nó lưu active memories, pending memories, terminal/Telegram messages, pause state và pending approvals.
Zep có thể được thêm sau như lớp memory nâng cao, nhưng không nên thay thế character files hoặc memory controls local.
Permissions và tools
Phần tiêu đề “Permissions và tools”Mọi hành động ngoài text reply nên được phân loại:
- read-only
- local write
- external write
- public action
- destructive
- money/payment
- unknown
Bestie bắt đầu với internal read tools và MCP read-only đã classify. Các hành động rủi ro hơn cần permission UX, logs và approval rõ ràng.