How astrbotdevs/astrbot works
AstrBot is an extensible conversational-agent platform that connects messaging channels and Web Chat to AI providers, agent tools, plugins, and knowledge features. Its principal runtime path is incoming platform activity through the core event pipeline to an agent/provider response and back to the channel. The dashboard provides separate administration and ChatUI capabilities. The excerpts show lifecycle orchestration, platform management, and dashboard service wiring; several runtime links are documented only at the product level, so those are marked unverified.
Main entry points: services Dashboard services · agent Agent runners · core_lifecycle.py Core lifecycle · pipeline Event pipeline
Components 20
Messaging channels
- Platform adapters
astrbot/core/platform/sources - Platform manager
astrbot/core/platform/manager.py - Web Chat adapter
astrbot/core/platform/sources/webchat/webchat_adapter.py
Core runtime
- Core lifecycle
astrbot/core/core_lifecycle.py - Event pipeline
astrbot/core/pipeline - Plugin system
astrbot/core/star - Built-in bot
astrbot/builtin_stars/astrbot/main.py
Agent capabilities
- LLM providers
astrbot/core/provider - Agent runners
astrbot/core/agent - Agent tools
astrbot/core/tools - Sandboxed computer
astrbot/core/computer - Skills
astrbot/core/skills/skill_manager.py
Knowledge and state
- Knowledge base
astrbot/core/knowledge_base - Persistent database
astrbot/core/db - Conversation history
astrbot/core/conversation_mgr.py
Dashboard and ChatUI
- Dashboard API
astrbot/dashboard/api/app.py - Dashboard services
astrbot/dashboard/services - ChatUI service
astrbot/dashboard/services/chat_service.py
Other components
- Chat user
- WebUI user
Connections 21
- Chat user → Platform adapters: sends messages
- Platform adapters → Platform manager: registers adapters
astrbot/core/platform/manager.py - Platform manager → Core lifecycle: starts platforms
astrbot/core/core_lifecycle.py - Web Chat adapter → Platform manager: joins runtime
astrbot/core/platform/manager.py - Core lifecycle → Event pipeline: initializes pipeline
astrbot/core/core_lifecycle.py - Event pipeline → Built-in bot: dispatches events
- Event pipeline → Plugin system: dispatches handlers
- Built-in bot → Conversation history: records messages
astrbot/builtin_stars/astrbot/main.py - Agent runners → LLM providers: requests completions
astrbot/core/provider/func_tool_manager.py - Agent runners → Agent tools: invokes tools
- Agent tools → Sandboxed computer: uses sandbox
- Agent runners → Knowledge base: retrieves context
- Core lifecycle → LLM providers: initializes providers
astrbot/core/core_lifecycle.py - Knowledge base → Persistent database: stores knowledge
astrbot/core/db/vec_db/faiss_impl/document_storage.py - Conversation history → Persistent database: persists history
- WebUI user → Dashboard API: uses dashboard
- Dashboard API → Dashboard services: configures services
astrbot/dashboard/api/app.py - Dashboard services → ChatUI service: routes chat
astrbot/dashboard/services/chat_service.py - ChatUI service → Agent runners: runs chat agent
astrbot/dashboard/services/chat_service.py - Dashboard services → Knowledge base: manages knowledge
- Dashboard services → Plugin system: manages extensions
astrbot/dashboard/services/config_service.py