# coze-dev/coze-studio architecture

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

- Interactive diagram: https://gitdiagram.com/coze-dev/coze-studio
- Repository: https://github.com/coze-dev/coze-studio

## Overview

Coze Studio is a visual, low-code platform for creating, publishing, and running AI agents, apps, and workflows. The main product journey is developer authoring through the workflow canvas and resource configuration, publishing an agent or app, then initiating a conversation and receiving a run result. Its README also identifies model management, prompts, plugins, knowledge, databases, memory, and OpenAPI as product capabilities. The graph follows the documented DDD architecture and tree paths; most backend implementation links are architectural-level, since the sampled source excerpts primarily cover frontend database-node behavior and storage interfaces.

Main entry points: [`backend/application/singleagent`](https://github.com/coze-dev/coze-studio/tree/main/backend/application/singleagent) (Agent authoring), [`backend/api/handler/coze`](https://github.com/coze-dev/coze-studio/tree/main/backend/api/handler/coze) (API handlers), [`backend/domain/conversation/agentrun/service`](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/conversation/agentrun/service) (Agent run service), [`backend/application/workflow`](https://github.com/coze-dev/coze-studio/tree/main/backend/application/workflow) (Workflow authoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API access"]
  node_api_router["Coze API router<br/>[api.go]"]
  node_api_handlers["API handlers"]
end

subgraph group_authoring["Visual authoring"]
  node_workflow_canvas["Workflow canvas"]
  node_workflow_app["Workflow authoring"]
  node_agent_app["Agent authoring"]
  node_app_authoring["App authoring"]
end

subgraph group_execution["Agent execution"]
  node_agent_flow["Agent flow"]
  node_conversation_app["Conversation service"]
  node_agent_run["Agent run service"]
end

subgraph group_resources["Agent resources"]
  node_model_service["Model management"]
  node_prompt_service["Prompt resources"]
  node_plugin_service["Plugin resources"]
  node_knowledge_service["Knowledge resources"]
  node_memory_service["Database and memory"]
end

subgraph group_core["Domain services"]
  node_conversation_state[("Conversation state")]
  node_message_state[("Message state")]
  node_knowledge_domain[("Knowledge domain")]
  node_memory_domain[("Memory domain")]
  node_workflow_domain["Workflow domain"]
  node_agent_domain[("Agent domain")]
end

node_developer(("Developer"))
node_external_models{{"Model providers"}}

node_developer -->|"authors visually"| node_workflow_canvas
node_developer -->|"calls OpenAPI"| node_api_router
node_workflow_canvas -->|"configures workflows"| node_workflow_app
node_api_router -->|"dispatches requests"| node_api_handlers
node_api_handlers -->|"invokes authoring"| node_agent_app
node_api_handlers -->|"invokes workflow"| node_workflow_app
node_api_handlers -->|"invokes app"| node_app_authoring
node_api_handlers -->|"starts conversations"| node_conversation_app
node_agent_app -->|"manages agents"| node_agent_domain
node_workflow_app -->|"manages workflows"| node_workflow_domain
node_app_authoring -->|"configures agents"| node_agent_domain
node_agent_app -->|"configures workflow"| node_workflow_app
node_agent_app -->|"configures knowledge"| node_knowledge_service
node_agent_app -->|"configures plugins"| node_plugin_service
node_agent_app -->|"configures prompts"| node_prompt_service
node_agent_app -->|"configures memory"| node_memory_service
node_model_service -.->|"integrates models"| node_external_models
node_knowledge_service -->|"manages knowledge"| node_knowledge_domain
node_memory_service -->|"manages memory"| node_memory_domain
node_conversation_app -->|"runs agent"| node_agent_run
node_agent_run -->|"executes flow"| node_agent_flow
node_agent_run -->|"stores conversation"| node_conversation_state
node_agent_run -->|"stores messages"| node_message_state

click node_api_router "https://github.com/coze-dev/coze-studio/blob/main/backend/api/router/coze/api.go"
click node_api_handlers "https://github.com/coze-dev/coze-studio/tree/main/backend/api/handler/coze"
click node_workflow_canvas "https://github.com/coze-dev/coze-studio/blob/main/frontend/packages/workflow/playground/src/node-registries/database/database-query/database-query-form.tsx"
click node_workflow_app "https://github.com/coze-dev/coze-studio/tree/main/backend/application/workflow"
click node_agent_app "https://github.com/coze-dev/coze-studio/tree/main/backend/application/singleagent"
click node_app_authoring "https://github.com/coze-dev/coze-studio/tree/main/backend/application/app"
click node_model_service "https://github.com/coze-dev/coze-studio/tree/main/backend/application/modelmgr"
click node_prompt_service "https://github.com/coze-dev/coze-studio/tree/main/backend/application/prompt"
click node_plugin_service "https://github.com/coze-dev/coze-studio/tree/main/backend/application/plugin"
click node_knowledge_service "https://github.com/coze-dev/coze-studio/tree/main/backend/application/knowledge"
click node_memory_service "https://github.com/coze-dev/coze-studio/tree/main/backend/application/memory"
click node_agent_flow "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/agent/singleagent/internal/agentflow"
click node_conversation_app "https://github.com/coze-dev/coze-studio/tree/main/backend/application/conversation"
click node_agent_run "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/conversation/agentrun/service"
click node_conversation_state "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/conversation/conversation"
click node_message_state "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/conversation/message"
click node_knowledge_domain "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/knowledge"
click node_memory_domain "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/memory"
click node_workflow_domain "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/workflow"
click node_agent_domain "https://github.com/coze-dev/coze-studio/tree/main/backend/domain/agent/singleagent"

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_api_router,node_api_handlers toneBlue
class node_workflow_canvas,node_workflow_app,node_agent_app,node_app_authoring toneAmber
class node_agent_flow,node_conversation_app,node_agent_run toneMint
class node_model_service,node_prompt_service,node_plugin_service,node_knowledge_service,node_memory_service toneRose
class node_conversation_state,node_message_state,node_knowledge_domain,node_memory_domain,node_workflow_domain,node_agent_domain,node_developer,node_external_models toneIndigo
```

## Components

### API access

- [Coze API router](https://github.com/coze-dev/coze-studio/blob/main/backend/api/router/coze/api.go): `backend/api/router/coze/api.go`
- [API handlers](https://github.com/coze-dev/coze-studio/tree/main/backend/api/handler/coze): `backend/api/handler/coze`

### Visual authoring

- [Workflow canvas](https://github.com/coze-dev/coze-studio/blob/main/frontend/packages/workflow/playground/src/node-registries/database/database-query/database-query-form.tsx): `frontend/packages/workflow/playground/src/node-registries/database/database-query/database-query-form.tsx`
- [Workflow authoring](https://github.com/coze-dev/coze-studio/tree/main/backend/application/workflow): `backend/application/workflow`
- [Agent authoring](https://github.com/coze-dev/coze-studio/tree/main/backend/application/singleagent): `backend/application/singleagent`
- [App authoring](https://github.com/coze-dev/coze-studio/tree/main/backend/application/app): `backend/application/app`

### Agent execution

- [Agent flow](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/agent/singleagent/internal/agentflow): `backend/domain/agent/singleagent/internal/agentflow`
- [Conversation service](https://github.com/coze-dev/coze-studio/tree/main/backend/application/conversation): `backend/application/conversation`
- [Agent run service](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/conversation/agentrun/service): `backend/domain/conversation/agentrun/service`

### Agent resources

- [Model management](https://github.com/coze-dev/coze-studio/tree/main/backend/application/modelmgr): `backend/application/modelmgr`
- [Prompt resources](https://github.com/coze-dev/coze-studio/tree/main/backend/application/prompt): `backend/application/prompt`
- [Plugin resources](https://github.com/coze-dev/coze-studio/tree/main/backend/application/plugin): `backend/application/plugin`
- [Knowledge resources](https://github.com/coze-dev/coze-studio/tree/main/backend/application/knowledge): `backend/application/knowledge`
- [Database and memory](https://github.com/coze-dev/coze-studio/tree/main/backend/application/memory): `backend/application/memory`

### Domain services

- [Conversation state](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/conversation/conversation): `backend/domain/conversation/conversation`
- [Message state](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/conversation/message): `backend/domain/conversation/message`
- [Knowledge domain](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/knowledge): `backend/domain/knowledge`
- [Memory domain](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/memory): `backend/domain/memory`
- [Workflow domain](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/workflow): `backend/domain/workflow`
- [Agent domain](https://github.com/coze-dev/coze-studio/tree/main/backend/domain/agent/singleagent): `backend/domain/agent/singleagent`

### Other components

- **Developer**
- **Model providers**

## Connections

- Developer → Workflow canvas: authors visually
- Developer → Coze API router: calls OpenAPI
- Workflow canvas → Workflow authoring: configures workflows
- Coze API router → API handlers: dispatches requests
- API handlers → Agent authoring: invokes authoring
- API handlers → Workflow authoring: invokes workflow
- API handlers → App authoring: invokes app
- API handlers → Conversation service: starts conversations
- Agent authoring → Agent domain: manages agents
- Workflow authoring → Workflow domain: manages workflows
- App authoring → Agent domain: configures agents
- Agent authoring → Workflow authoring: configures workflow
- Agent authoring → Knowledge resources: configures knowledge
- Agent authoring → Plugin resources: configures plugins
- Agent authoring → Prompt resources: configures prompts
- Agent authoring → Database and memory: configures memory
- Model management → Model providers: integrates models
- Knowledge resources → Knowledge domain: manages knowledge
- Database and memory → Memory domain: manages memory
- Conversation service → Agent run service: runs agent
- Agent run service → Agent flow: executes flow
- Agent run service → Conversation state: stores conversation
- Agent run service → Message state: stores messages
