# watergodfurina/astrbot-golang architecture

> Architecture diagram of the GitHub repository watergodfurina/astrbot-golang, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/watergodfurina/astrbot-golang
- Repository: https://github.com/watergodfurina/astrbot-golang

## Overview

AstrBot-golang is a Go chat-bot framework with a Vue management dashboard. Its main runtime path receives messages through platform adapters, processes them through the event bus and pipeline, and returns replies through the platform; the pipeline can use providers, agents, skills, and knowledge retrieval. The dashboard configures and manages the framework through its API. The README documents these subsystem relationships; sampled files confirm selected details, but many runtime connections and dashboard routes were not inspected, so uncertain links are omitted.

Main entry points: [`internal/dashboard/server.go`](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/dashboard/server.go) (Dashboard API), [`internal/pipeline`](https://github.com/watergodfurina/astrbot-golang/tree/main/internal/pipeline) (Message Pipeline), [`internal/plugin/host_service.go`](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/plugin/host_service.go) (Plugin Runtime), [`internal/lifecycle/lifecycle.go`](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/lifecycle/lifecycle.go) (Lifecycle Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Message Runtime"]
  node_platforms["Platform Adapters"]
  node_eventbus["Event Bus<br/>[event_bus.go]"]
  node_pipeline["Message Pipeline"]
  node_lifecycle["Lifecycle Manager<br/>[lifecycle.go]"]
  node_entry["Application Entry<br/>[main.go]"]
end

subgraph group_capabilities["AI Capabilities"]
  node_providers["AI Providers"]
  node_agent["Agent System"]
  node_knowledge[("Knowledge Base")]
  node_skills["Skills Manager<br/>[manager.go]"]
  node_sandbox["Skill Sandbox<br/>[manager.go]"]
end

subgraph group_management["Management"]
  node_plugin["Plugin Runtime<br/>[host_service.go]"]
  node_commands["Command System<br/>[manager.go]"]
  node_cron["Scheduled Jobs<br/>[manager.go]"]
end

subgraph group_webui["Web Dashboard"]
  node_dashboard["Dashboard UI<br/>[App.vue]"]
  node_dashboard_api["Dashboard API<br/>[server.go]"]
  node_handlers["API Handlers<br/>[handlers.go]"]
end

subgraph group_state["Persistent State"]
  node_conversations["Conversation Manager<br/>[manager.go]"]
  node_database[("SQLite Database<br/>[database.go]")]
  node_config["Configuration<br/>[config.go]"]
end

node_user(("Chat User"))
node_external_ai{{"AI Services"}}

node_user -->|"sends messages"| node_platforms
node_platforms -.->|"emits events"| node_eventbus
node_eventbus -->|"dispatches events"| node_pipeline
node_pipeline -.->|"requests inference"| node_providers
node_providers -->|"calls APIs"| node_external_ai
node_pipeline -.->|"uses agents"| node_agent
node_pipeline -.->|"retrieves knowledge"| node_knowledge
node_pipeline -->|"injects skills"| node_skills
node_sandbox -->|"syncs skills"| node_skills
node_plugin -->|"bridges skills"| node_skills
node_plugin -->|"exposes providers"| node_providers
node_plugin -->|"registers jobs"| node_cron
node_pipeline -.->|"sends replies"| node_platforms
node_entry -->|"starts runtime"| node_lifecycle
node_lifecycle -->|"assembles runtime"| node_eventbus
node_user -->|"manages bot"| node_dashboard
node_dashboard -->|"uses API"| node_dashboard_api
node_dashboard_api -.->|"routes requests"| node_handlers
node_dashboard_api -->|"manages conversations"| node_conversations
node_dashboard_api -->|"manages plugins"| node_plugin
node_dashboard_api -->|"manages knowledge"| node_knowledge
node_dashboard_api -->|"updates configuration"| node_config
node_conversations -->|"persists history"| node_database
node_cron -->|"persists jobs"| node_database
node_lifecycle -->|"starts API"| node_dashboard_api

click node_platforms "https://github.com/watergodfurina/astrbot-golang/tree/main/internal/platform"
click node_eventbus "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/core/event_bus.go"
click node_pipeline "https://github.com/watergodfurina/astrbot-golang/tree/main/internal/pipeline"
click node_providers "https://github.com/watergodfurina/astrbot-golang/tree/main/internal/provider"
click node_agent "https://github.com/watergodfurina/astrbot-golang/tree/main/internal/agent"
click node_knowledge "https://github.com/watergodfurina/astrbot-golang/tree/main/internal/knowledgebase"
click node_skills "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/skills/manager.go"
click node_sandbox "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/sandbox/manager.go"
click node_plugin "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/plugin/host_service.go"
click node_commands "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/star/manager.go"
click node_cron "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/cron/manager.go"
click node_lifecycle "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/lifecycle/lifecycle.go"
click node_entry "https://github.com/watergodfurina/astrbot-golang/blob/main/cmd/astrbot/main.go"
click node_dashboard "https://github.com/watergodfurina/astrbot-golang/blob/main/dashboard/src/App.vue"
click node_dashboard_api "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/dashboard/server.go"
click node_handlers "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/dashboard/handlers.go"
click node_conversations "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/conversation/manager.go"
click node_database "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/db/database.go"
click node_config "https://github.com/watergodfurina/astrbot-golang/blob/main/internal/config/config.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_platforms,node_eventbus,node_pipeline,node_lifecycle,node_entry,node_user toneBlue
class node_providers,node_agent,node_knowledge,node_skills,node_sandbox toneAmber
class node_plugin,node_commands,node_cron toneMint
class node_dashboard,node_dashboard_api,node_handlers toneRose
class node_conversations,node_database,node_config,node_external_ai toneIndigo
```

## Components

### Message Runtime

- [Platform Adapters](https://github.com/watergodfurina/astrbot-golang/tree/main/internal/platform): `internal/platform`
- [Event Bus](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/core/event_bus.go): `internal/core/event_bus.go`
- [Message Pipeline](https://github.com/watergodfurina/astrbot-golang/tree/main/internal/pipeline): `internal/pipeline`
- [Lifecycle Manager](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/lifecycle/lifecycle.go): `internal/lifecycle/lifecycle.go`
- [Application Entry](https://github.com/watergodfurina/astrbot-golang/blob/main/cmd/astrbot/main.go): `cmd/astrbot/main.go`

### AI Capabilities

- [AI Providers](https://github.com/watergodfurina/astrbot-golang/tree/main/internal/provider): `internal/provider`
- [Agent System](https://github.com/watergodfurina/astrbot-golang/tree/main/internal/agent): `internal/agent`
- [Knowledge Base](https://github.com/watergodfurina/astrbot-golang/tree/main/internal/knowledgebase): `internal/knowledgebase`
- [Skills Manager](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/skills/manager.go): `internal/skills/manager.go`
- [Skill Sandbox](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/sandbox/manager.go): `internal/sandbox/manager.go`

### Management

- [Plugin Runtime](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/plugin/host_service.go): `internal/plugin/host_service.go`
- [Command System](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/star/manager.go): `internal/star/manager.go`
- [Scheduled Jobs](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/cron/manager.go): `internal/cron/manager.go`

### Web Dashboard

- [Dashboard UI](https://github.com/watergodfurina/astrbot-golang/blob/main/dashboard/src/App.vue): `dashboard/src/App.vue`
- [Dashboard API](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/dashboard/server.go): `internal/dashboard/server.go`
- [API Handlers](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/dashboard/handlers.go): `internal/dashboard/handlers.go`

### Persistent State

- [Conversation Manager](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/conversation/manager.go): `internal/conversation/manager.go`
- [SQLite Database](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/db/database.go): `internal/db/database.go`
- [Configuration](https://github.com/watergodfurina/astrbot-golang/blob/main/internal/config/config.go): `internal/config/config.go`

### Other components

- **Chat User**
- **AI Services**

## Connections

- Chat User → Platform Adapters: sends messages
- Platform Adapters → Event Bus: emits events
- Event Bus → Message Pipeline: dispatches events
- Message Pipeline → AI Providers: requests inference (evidence: `internal/pipeline/plugin_llm.go`)
- AI Providers → AI Services: calls APIs (evidence: `internal/provider/sources/volcengine_tts_source.go`)
- Message Pipeline → Agent System: uses agents
- Message Pipeline → Knowledge Base: retrieves knowledge
- Message Pipeline → Skills Manager: injects skills
- Skill Sandbox → Skills Manager: syncs skills (evidence: `internal/sandbox/manager.go`)
- Plugin Runtime → Skills Manager: bridges skills (evidence: `internal/plugin/host_service.go`)
- Plugin Runtime → AI Providers: exposes providers (evidence: `internal/plugin/host_service.go`)
- Plugin Runtime → Scheduled Jobs: registers jobs (evidence: `internal/plugin/host_service.go`)
- Message Pipeline → Platform Adapters: sends replies
- Application Entry → Lifecycle Manager: starts runtime (evidence: `cmd/astrbot/main.go`)
- Lifecycle Manager → Event Bus: assembles runtime
- Chat User → Dashboard UI: manages bot
- Dashboard UI → Dashboard API: uses API
- Dashboard API → API Handlers: routes requests
- Dashboard API → Conversation Manager: manages conversations (evidence: `internal/dashboard/server.go`)
- Dashboard API → Plugin Runtime: manages plugins (evidence: `internal/dashboard/server.go`)
- Dashboard API → Knowledge Base: manages knowledge (evidence: `internal/dashboard/server.go`)
- Dashboard API → Configuration: updates configuration (evidence: `internal/dashboard/server.go`)
- Conversation Manager → SQLite Database: persists history (evidence: `internal/conversation/manager.go`)
- Scheduled Jobs → SQLite Database: persists jobs (evidence: `internal/cron/manager.go`)
- Lifecycle Manager → Dashboard API: starts API
