# teamwiseflow/xiaobei architecture

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

- Interactive diagram: https://gitdiagram.com/teamwiseflow/xiaobei
- Repository: https://github.com/teamwiseflow/xiaobei

## Overview

xiaobei is an OpenClaw-based social-media customer-acquisition agent. Its documented user workflow is to send requests through WeChat (also Feishu and WeCom), have the agent produce or research content through its skills, and publish or monitor results on social platforms. The graph emphasizes those product capabilities and the Awada bridge; relationships between unsampled skill implementations are supported only where the README describes them, so some links remain broad.

Main entry points: [`awada/src/channel.ts`](https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/channel.ts) (Chat channels), [`awada/src/message-handler.ts`](https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/message-handler.ts) (Awada bridge), [`crews/content-producer/skills/expert-video/tools/video-producer/scripts/assemble.py`](https://github.com/teamwiseflow/xiaobei/blob/master/crews/content-producer/skills/expert-video/tools/video-producer/scripts/assemble.py) (Video production), [`crews/main/skills/expert-douyin/tools/douyin-publish/scripts/douyin_publish.py`](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/expert-douyin/tools/douyin-publish/scripts/douyin_publish.py) (Platform publishing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_messaging["Chat channels<br/>[channel.ts]"]
  node_awada["Awada bridge<br/>[message-handler.ts]"]
  node_agent["OpenClaw agent"]
end

subgraph group_creation["Content production"]
  node_research["Research and intelligence"]
  node_content["Writing and calibration<br/>[dna-eval.py]"]
  node_video["Video production<br/>[assemble.py]"]
  node_image["Image and deck creation<br/>[html_to_pptx.py]"]
end

subgraph group_distribution["Publishing and insights"]
  node_publishing["Platform publishing<br/>[douyin_publish.py]"]
  node_wxpublish["WeChat publishing<br/>[publish_wx_mp.py]"]
  node_engagement["Audience engagement<br/>[xhs_engagement.py]"]
  node_monitor["Published-work monitoring<br/>[platform-status.py]"]
end

subgraph group_platform["Platform services"]
  node_xhs["Xiaohongshu client<br/>[api.py]"]
  node_platforms(("Social platforms"))
  node_models(("AI model services"))
end

subgraph group_support["Business support"]
  node_customerdb[("Customer database<br/>[customerdb.ts]")]
  node_sales["Sales and customer support"]
end

node_user(("Business user"))

node_user -->|"requests work"| node_messaging
node_messaging -->|"relays messages"| node_awada
node_awada -->|"routes events"| node_agent
node_agent -->|"gathers information"| node_research
node_agent -->|"creates content"| node_content
node_agent -->|"delegates production"| node_video
node_agent -->|"creates materials"| node_image
node_agent -->|"publishes content"| node_publishing
node_agent -->|"publishes articles"| node_wxpublish
node_agent -->|"finds prospects"| node_engagement
node_agent -->|"reviews results"| node_monitor
node_publishing -->|"posts content"| node_platforms
node_wxpublish -->|"posts articles"| node_platforms
node_engagement -->|"interacts with"| node_platforms
node_monitor -->|"collects metrics"| node_platforms
node_video -.->|"generates media"| node_models
node_agent -->|"loads customer context"| node_customerdb
node_agent -->|"handles inquiries"| node_sales
node_xhs -.->|"calls platform APIs"| node_platforms

click node_messaging "https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/channel.ts"
click node_awada "https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/message-handler.ts"
click node_research "https://github.com/teamwiseflow/xiaobei/tree/master/crews/main/skills"
click node_content "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/content-calibrator/scripts/dna-eval.py"
click node_video "https://github.com/teamwiseflow/xiaobei/blob/master/crews/content-producer/skills/expert-video/tools/video-producer/scripts/assemble.py"
click node_image "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/pitch-deck/scripts/html_to_pptx.py"
click node_publishing "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/expert-douyin/tools/douyin-publish/scripts/douyin_publish.py"
click node_wxpublish "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/expert-wx-mp/tools/wx-mp-publisher/scripts/publish_wx_mp.py"
click node_engagement "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/expert-xhs/tools/xhs-engagement/scripts/xhs_engagement.py"
click node_monitor "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/published-track/scripts/platform-status.py"
click node_xhs "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/_shared/xhs_utils/xhs_pc/api.py"
click node_customerdb "https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/customerdb.ts"
click node_sales "https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/sales-cs-manager/tools/sales-cs-enablement/scripts/check_awada_channel.py"

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_messaging,node_awada,node_agent,node_user toneBlue
class node_research,node_content,node_video,node_image toneAmber
class node_publishing,node_wxpublish,node_engagement,node_monitor toneMint
class node_xhs,node_platforms,node_models toneRose
class node_customerdb,node_sales toneIndigo
```

## Components

### User interaction

- [Chat channels](https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/channel.ts): `awada/src/channel.ts`
- [Awada bridge](https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/message-handler.ts): `awada/src/message-handler.ts`
- **OpenClaw agent**

### Content production

- [Research and intelligence](https://github.com/teamwiseflow/xiaobei/tree/master/crews/main/skills): `crews/main/skills`
- [Writing and calibration](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/content-calibrator/scripts/dna-eval.py): `crews/main/skills/content-calibrator/scripts/dna-eval.py`
- [Video production](https://github.com/teamwiseflow/xiaobei/blob/master/crews/content-producer/skills/expert-video/tools/video-producer/scripts/assemble.py): `crews/content-producer/skills/expert-video/tools/video-producer/scripts/assemble.py`
- [Image and deck creation](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/pitch-deck/scripts/html_to_pptx.py): `crews/main/skills/pitch-deck/scripts/html_to_pptx.py`

### Publishing and insights

- [Platform publishing](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/expert-douyin/tools/douyin-publish/scripts/douyin_publish.py): `crews/main/skills/expert-douyin/tools/douyin-publish/scripts/douyin_publish.py`
- [WeChat publishing](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/expert-wx-mp/tools/wx-mp-publisher/scripts/publish_wx_mp.py): `crews/main/skills/expert-wx-mp/tools/wx-mp-publisher/scripts/publish_wx_mp.py`
- [Audience engagement](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/expert-xhs/tools/xhs-engagement/scripts/xhs_engagement.py): `crews/main/skills/expert-xhs/tools/xhs-engagement/scripts/xhs_engagement.py`
- [Published-work monitoring](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/published-track/scripts/platform-status.py): `crews/main/skills/published-track/scripts/platform-status.py`

### Platform services

- [Xiaohongshu client](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/_shared/xhs_utils/xhs_pc/api.py): `crews/main/skills/_shared/xhs_utils/xhs_pc/api.py`
- **Social platforms**
- **AI model services**

### Business support

- [Customer database](https://github.com/teamwiseflow/xiaobei/blob/master/awada/src/customerdb.ts): `awada/src/customerdb.ts`
- [Sales and customer support](https://github.com/teamwiseflow/xiaobei/blob/master/crews/main/skills/sales-cs-manager/tools/sales-cs-enablement/scripts/check_awada_channel.py): `crews/main/skills/sales-cs-manager/tools/sales-cs-enablement/scripts/check_awada_channel.py`

### Other components

- **Business user**

## Connections

- Business user → Chat channels: requests work (evidence: `README.md`)
- Chat channels → Awada bridge: relays messages
- Awada bridge → OpenClaw agent: routes events (evidence: `awada/src/message-handler.ts`)
- OpenClaw agent → Research and intelligence: gathers information (evidence: `README.md`)
- OpenClaw agent → Writing and calibration: creates content (evidence: `README.md`)
- OpenClaw agent → Video production: delegates production (evidence: `README.md`)
- OpenClaw agent → Image and deck creation: creates materials (evidence: `README.md`)
- OpenClaw agent → Platform publishing: publishes content (evidence: `README.md`)
- OpenClaw agent → WeChat publishing: publishes articles (evidence: `README.md`)
- OpenClaw agent → Audience engagement: finds prospects (evidence: `README.md`)
- OpenClaw agent → Published-work monitoring: reviews results (evidence: `README.md`)
- Platform publishing → Social platforms: posts content (evidence: `README.md`)
- WeChat publishing → Social platforms: posts articles (evidence: `README.md`)
- Audience engagement → Social platforms: interacts with (evidence: `README.md`)
- Published-work monitoring → Social platforms: collects metrics (evidence: `README.md`)
- Video production → AI model services: generates media (evidence: `README.md`)
- OpenClaw agent → Customer database: loads customer context
- OpenClaw agent → Sales and customer support: handles inquiries (evidence: `README.md`)
- Xiaohongshu client → Social platforms: calls platform APIs (evidence: `crews/main/skills/_shared/xhs_utils/xhs_pc/api.py`)
