# bidingcc/buildingai architecture

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

- Interactive diagram: https://gitdiagram.com/bidingcc/buildingai
- Repository: https://github.com/bidingcc/buildingai

## Overview

BuildingAI is an enterprise AI-agent platform with a web client, API, and extension system. Its principal user workflow is configuring an AI application, then using conversations, agents, or knowledge-base retrieval to produce AI-assisted results. The README also identifies MCP, unified model management, extensions, and billing as major capabilities. The graph combines those documented product branches with sampled storage and client implementation; unsampled subsystem links are omitted unless documented in the README.

Main entry points: [`packages/api/src/modules/ai`](https://github.com/bidingcc/buildingai/tree/master/packages/api/src/modules/ai) (AI conversations), [`packages/api/src/modules/ai/datasets/services/datasets-retrieval.service.ts`](https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/ai/datasets/services/datasets-retrieval.service.ts) (Knowledge retrieval), [`packages/api/src/modules/system/services/storage-config.service.ts`](https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/system/services/storage-config.service.ts) (Storage settings), [`packages/core/src/modules/cloud-storage/services/cloud-storage.service.ts`](https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/cloud-storage/services/cloud-storage.service.ts) (Cloud storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_client["Web client<br/>[main.tsx]"]
  node_api["API application"]
end

subgraph group_ai["AI runtime"]
  node_conversations["AI conversations"]
  node_agents["AI agents"]
  node_models["Model providers"]
  node_mcp["MCP integration"]
end

subgraph group_knowledge["Knowledge and data"]
  node_datasets["Knowledge retrieval"]
  node_preprocessor["Query preprocessing"]
  node_database[("Application database")]
end

subgraph group_platform["Platform services"]
  node_storage_config["Storage settings"]
  node_storage_controller["Storage API"]
  node_cloud_storage["Cloud storage"]
  node_cos["Tencent COS"]
  node_oss["Aliyun OSS"]
  node_file_storage["File storage"]
end

subgraph group_extensions["Extensions and business"]
  node_extensions["Extension system"]
  node_blog["Simple blog extension<br/>[article.service.ts]"]
  node_billing["Billing and payments"]
end

node_user(("User"))

node_user -->|"uses"| node_client
node_client -.->|"requests"| node_api
node_api -.->|"serves"| node_conversations
node_conversations -.->|"generates with"| node_models
node_agents -.->|"uses models"| node_models
node_agents -.->|"calls tools"| node_mcp
node_conversations -.->|"retrieves context"| node_datasets
node_datasets -->|"preprocesses queries"| node_preprocessor
node_datasets -.->|"reads knowledge data"| node_database
node_storage_controller -->|"delegates"| node_storage_config
node_storage_config -->|"updates settings"| node_database
node_storage_config -->|"clears credentials"| node_cloud_storage
node_cloud_storage -->|"uses provider"| node_cos
node_cloud_storage -->|"uses provider"| node_oss
node_extensions -.->|"hosts example"| node_blog
node_user -.->|"subscribes and pays"| node_billing
node_user -.->|"installs extensions"| node_extensions

click node_client "https://github.com/bidingcc/buildingai/blob/master/packages/client/src/main.tsx"
click node_api "https://github.com/bidingcc/buildingai/tree/master/packages/api/src"
click node_conversations "https://github.com/bidingcc/buildingai/tree/master/packages/api/src/modules/ai"
click node_agents "https://github.com/bidingcc/buildingai/tree/master/packages/api/src/modules/ai/agents"
click node_models "https://github.com/bidingcc/buildingai/tree/master/packages/%40buildingai/ai-sdk/src/providers"
click node_mcp "https://github.com/bidingcc/buildingai/tree/master/packages/%40buildingai/ai-sdk/src/utils/mcp"
click node_datasets "https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/ai/datasets/services/datasets-retrieval.service.ts"
click node_preprocessor "https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/ai/datasets/services/datasets-query-preprocessor.service.ts"
click node_database "https://github.com/bidingcc/buildingai/tree/master/packages/%40buildingai/db/src/entities"
click node_storage_config "https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/system/services/storage-config.service.ts"
click node_storage_controller "https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/system/controllers/console/storage-config.controller.ts"
click node_cloud_storage "https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/cloud-storage/services/cloud-storage.service.ts"
click node_cos "https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/cloud-storage/services/cos-storage.service.ts"
click node_oss "https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/cloud-storage/services/oss-storage.service.ts"
click node_file_storage "https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/upload/services/file-storage.service.ts"
click node_extensions "https://github.com/bidingcc/buildingai/tree/master/packages/api/src/modules/extension"
click node_blog "https://github.com/bidingcc/buildingai/blob/master/extensions/simple-blog/src/api/modules/article/services/article.service.ts"
click node_billing "https://github.com/bidingcc/buildingai/tree/master/packages/core/src/modules/billing"

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_client,node_api,node_user toneBlue
class node_conversations,node_agents,node_models,node_mcp toneAmber
class node_datasets,node_preprocessor,node_database toneMint
class node_storage_config,node_storage_controller,node_cloud_storage,node_cos,node_oss,node_file_storage toneRose
class node_extensions,node_blog,node_billing toneIndigo
```

## Components

### User experience

- [Web client](https://github.com/bidingcc/buildingai/blob/master/packages/client/src/main.tsx): `packages/client/src/main.tsx`
- [API application](https://github.com/bidingcc/buildingai/tree/master/packages/api/src): `packages/api/src`

### AI runtime

- [AI conversations](https://github.com/bidingcc/buildingai/tree/master/packages/api/src/modules/ai): `packages/api/src/modules/ai`
- [AI agents](https://github.com/bidingcc/buildingai/tree/master/packages/api/src/modules/ai/agents): `packages/api/src/modules/ai/agents`
- [Model providers](https://github.com/bidingcc/buildingai/tree/master/packages/%40buildingai/ai-sdk/src/providers): `packages/@buildingai/ai-sdk/src/providers`
- [MCP integration](https://github.com/bidingcc/buildingai/tree/master/packages/%40buildingai/ai-sdk/src/utils/mcp): `packages/@buildingai/ai-sdk/src/utils/mcp`

### Knowledge and data

- [Knowledge retrieval](https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/ai/datasets/services/datasets-retrieval.service.ts): `packages/api/src/modules/ai/datasets/services/datasets-retrieval.service.ts`
- [Query preprocessing](https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/ai/datasets/services/datasets-query-preprocessor.service.ts): `packages/api/src/modules/ai/datasets/services/datasets-query-preprocessor.service.ts`
- [Application database](https://github.com/bidingcc/buildingai/tree/master/packages/%40buildingai/db/src/entities): `packages/@buildingai/db/src/entities`

### Platform services

- [Storage settings](https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/system/services/storage-config.service.ts): `packages/api/src/modules/system/services/storage-config.service.ts`
- [Storage API](https://github.com/bidingcc/buildingai/blob/master/packages/api/src/modules/system/controllers/console/storage-config.controller.ts): `packages/api/src/modules/system/controllers/console/storage-config.controller.ts`
- [Cloud storage](https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/cloud-storage/services/cloud-storage.service.ts): `packages/core/src/modules/cloud-storage/services/cloud-storage.service.ts`
- [Tencent COS](https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/cloud-storage/services/cos-storage.service.ts): `packages/core/src/modules/cloud-storage/services/cos-storage.service.ts`
- [Aliyun OSS](https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/cloud-storage/services/oss-storage.service.ts): `packages/core/src/modules/cloud-storage/services/oss-storage.service.ts`
- [File storage](https://github.com/bidingcc/buildingai/blob/master/packages/core/src/modules/upload/services/file-storage.service.ts): `packages/core/src/modules/upload/services/file-storage.service.ts`

### Extensions and business

- [Extension system](https://github.com/bidingcc/buildingai/tree/master/packages/api/src/modules/extension): `packages/api/src/modules/extension`
- [Simple blog extension](https://github.com/bidingcc/buildingai/blob/master/extensions/simple-blog/src/api/modules/article/services/article.service.ts): `extensions/simple-blog/src/api/modules/article/services/article.service.ts`
- [Billing and payments](https://github.com/bidingcc/buildingai/tree/master/packages/core/src/modules/billing): `packages/core/src/modules/billing`

### Other components

- **User**

## Connections

- User → Web client: uses (evidence: `README.md`)
- Web client → API application: requests
- API application → AI conversations: serves (evidence: `packages/api/src/modules/ai/datasets/services/datasets-retrieval.service.ts`)
- AI conversations → Model providers: generates with (evidence: `README.md`)
- AI agents → Model providers: uses models (evidence: `README.md`)
- AI agents → MCP integration: calls tools (evidence: `README.md`)
- AI conversations → Knowledge retrieval: retrieves context (evidence: `README.md`)
- Knowledge retrieval → Query preprocessing: preprocesses queries (evidence: `packages/api/src/modules/ai/datasets/services/datasets-retrieval.service.ts`)
- Knowledge retrieval → Application database: reads knowledge data (evidence: `README.md`)
- Storage API → Storage settings: delegates (evidence: `packages/api/src/modules/system/controllers/console/storage-config.controller.ts`)
- Storage settings → Application database: updates settings (evidence: `packages/api/src/modules/system/services/storage-config.service.ts`)
- Storage settings → Cloud storage: clears credentials (evidence: `packages/api/src/modules/system/services/storage-config.service.ts`)
- Cloud storage → Tencent COS: uses provider (evidence: `packages/core/src/modules/cloud-storage/services/cloud-storage.service.ts`)
- Cloud storage → Aliyun OSS: uses provider (evidence: `packages/core/src/modules/cloud-storage/services/cloud-storage.service.ts`)
- Extension system → Simple blog extension: hosts example
- User → Billing and payments: subscribes and pays (evidence: `README.md`)
- User → Extension system: installs extensions (evidence: `README.md`)
