# rongqiong/smart_customer architecture

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

- Interactive diagram: https://gitdiagram.com/rongqiong/smart_customer
- Repository: https://github.com/rongqiong/smart_customer
- Video tour (about a minute): https://gitdiagram.com/rongqiong/smart_customer/video

## Overview

customer-work is a production-oriented AI customer-service platform with a separate administration system. Its main workflow accepts a customer message, restores session state, routes it through an agent and business tools, then responds or hands the conversation to a human through a ticket. The README also documents model and knowledge configuration, channel integrations, scheduling, governance, and quality feedback. Core workflow links follow the README; sampled source confirms session handling, ticket transitions, knowledge retrieval, and selected admin calls. Several documented subsystems have no source files in the supplied tree, so their paths are null.

Main entry points: [`customer-work-starter/src/main/java/com/richard/fyoung/customerwork/service/CustomerServiceService.java`](https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/service/CustomerServiceService.java) (Session service), [`customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/runtime/KnowledgeRetrievalService.java`](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/runtime/KnowledgeRetrievalService.java) (Knowledge retrieval), [`customer-work-starter/src/main/java/com/richard/fyoung/customerwork/ticket/TicketService.java`](https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/ticket/TicketService.java) (Human handoff tickets), [`customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/agent/service/AgentService.java`](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/agent/service/AgentService.java) (Agent and runtime config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation runtime"]
  node_ingress["App ingress"]
  node_session["Session service"]
  node_agent["Agent orchestration"]
  node_middleware["Agent middleware"]
  node_memory[("Session and memory")]
  node_knowledge["Knowledge retrieval"]
  node_knowledge_service["Knowledge search"]
  node_model["Model providers"]
  node_business_tools["Business tools"]
  node_business_systems[("Business backends")]
  node_response["AI response"]
end

subgraph group_collaboration["Human collaboration"]
  node_ticket["Human handoff tickets<br/>[TicketService.java]"]
  node_seat["Agent workbench"]
  node_approval["Human approval"]
  node_summary["Conversation summary"]
end

subgraph group_admin["Admin configuration"]
  node_admin_api["Admin API"]
  node_admin_config["Agent and runtime config<br/>[AgentService.java]"]
  node_channels["Channel bindings"]
  node_skills_mcp["Skills and MCP<br/>[SkillService.java]"]
  node_scheduler["Scheduled tasks"]
end

subgraph group_governance["Governance and operations"]
  node_auth["Admin authentication<br/>[AuthService.java]"]
  node_ldap["Enterprise LDAP"]
  node_rate_content["Rate and content controls"]
  node_sql["SQL query console"]
  node_database[("Configured data stores")]
end

subgraph group_feedback["Quality feedback"]
  node_quality["Quality review"]
  node_feedback_data[("Feedback and FactLog")]
end

node_customer(("Customer and channels"))
node_admin_user(("Admin operator"))

node_customer -->|"sends messages"| node_ingress
node_ingress -->|"dispatches"| node_session
node_session -->|"invokes"| node_agent
node_session -->|"restores and stores"| node_memory
node_agent -->|"runs through"| node_middleware
node_agent -->|"requests retrieval"| node_knowledge
node_knowledge -->|"searches"| node_knowledge_service
node_knowledge -->|"loads bindings"| node_database
node_agent -->|"calls"| node_model
node_agent -->|"dispatches tools"| node_business_tools
node_business_tools -->|"uses backends"| node_business_systems
node_agent -->|"produces"| node_response
node_business_tools -->|"requests approval"| node_approval
node_business_tools -->|"requests handoff"| node_ticket
node_ticket -->|"notifies"| node_seat
node_seat -->|"updates"| node_ticket
node_summary -->|"reads chat history"| node_database
node_admin_user -->|"manages"| node_admin_api
node_admin_api -->|"authenticates"| node_auth
node_auth -.->|"binds optionally"| node_ldap
node_admin_api -->|"configures agents"| node_admin_config
node_admin_api -->|"configures bindings"| node_channels
node_admin_api -->|"manages integrations"| node_skills_mcp
node_admin_api -->|"manages schedules"| node_scheduler
node_channels -.->|"publishes runtime config"| node_ingress
node_admin_config -.->|"configures runtime"| node_model
node_admin_api -->|"maintains rules"| node_rate_content
node_admin_api -->|"queries configured data"| node_sql
node_sql -->|"executes queries"| node_database
node_quality -->|"records findings"| node_feedback_data
node_customer -.->|"rates responses"| node_feedback_data

click node_session "https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/service/CustomerServiceService.java"
click node_knowledge "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/runtime/KnowledgeRetrievalService.java"
click node_knowledge_service "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/client/KnowledgeSearchClient.java"
click node_model "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/model/runtime/AdminModelFactory.java"
click node_ticket "https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/ticket/TicketService.java"
click node_summary "https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/assist/ConversationSummaryService.java"
click node_admin_config "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/agent/service/AgentService.java"
click node_channels "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/channel/service/ChannelBindingService.java"
click node_skills_mcp "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/skill/service/SkillService.java"
click node_scheduler "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/scheduledtask/service/ScheduledTaskService.java"
click node_auth "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/auth/service/AuthService.java"
click node_rate_content "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/contentguard/service/SensitiveWordService.java"
click node_sql "https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/sqlconfig/engine/SqlQueryService.java"

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_ingress,node_session,node_agent,node_middleware,node_memory,node_knowledge,node_knowledge_service,node_model,node_business_tools,node_business_systems,node_response toneBlue
class node_ticket,node_seat,node_approval,node_summary toneAmber
class node_admin_api,node_admin_config,node_channels,node_skills_mcp,node_scheduler toneMint
class node_auth,node_ldap,node_rate_content,node_sql,node_database toneRose
class node_quality,node_feedback_data,node_customer,node_admin_user toneIndigo
```

## Components

### Conversation runtime

- **App ingress**
- [Session service](https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/service/CustomerServiceService.java): `customer-work-starter/src/main/java/com/richard/fyoung/customerwork/service/CustomerServiceService.java`
- **Agent orchestration**
- **Agent middleware**
- **Session and memory**
- [Knowledge retrieval](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/runtime/KnowledgeRetrievalService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/runtime/KnowledgeRetrievalService.java`
- [Knowledge search](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/client/KnowledgeSearchClient.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/knowledgebase/client/KnowledgeSearchClient.java`
- [Model providers](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/model/runtime/AdminModelFactory.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/model/runtime/AdminModelFactory.java`
- **Business tools**
- **Business backends**
- **AI response**

### Human collaboration

- [Human handoff tickets](https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/ticket/TicketService.java): `customer-work-starter/src/main/java/com/richard/fyoung/customerwork/ticket/TicketService.java`
- **Agent workbench**
- **Human approval**
- [Conversation summary](https://github.com/rongqiong/smart_customer/blob/main/customer-work-starter/src/main/java/com/richard/fyoung/customerwork/assist/ConversationSummaryService.java): `customer-work-starter/src/main/java/com/richard/fyoung/customerwork/assist/ConversationSummaryService.java`

### Admin configuration

- **Admin API**
- [Agent and runtime config](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/agent/service/AgentService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/agent/service/AgentService.java`
- [Channel bindings](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/channel/service/ChannelBindingService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/channel/service/ChannelBindingService.java`
- [Skills and MCP](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/skill/service/SkillService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/skill/service/SkillService.java`
- [Scheduled tasks](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/scheduledtask/service/ScheduledTaskService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/aiconfig/scheduledtask/service/ScheduledTaskService.java`

### Governance and operations

- [Admin authentication](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/auth/service/AuthService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/auth/service/AuthService.java`
- **Enterprise LDAP**
- [Rate and content controls](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/contentguard/service/SensitiveWordService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/contentguard/service/SensitiveWordService.java`
- [SQL query console](https://github.com/rongqiong/smart_customer/blob/main/customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/sqlconfig/engine/SqlQueryService.java): `customer-admin-server/src/main/java/com/richard/fyoung/customeradmin/sqlconfig/engine/SqlQueryService.java`
- **Configured data stores**

### Quality feedback

- **Quality review**
- **Feedback and FactLog**

### Other components

- **Customer and channels**
- **Admin operator**

## Connections

- Customer and channels → App ingress: sends messages
- App ingress → Session service: dispatches
- Session service → Agent orchestration: invokes
- Session service → Session and memory: restores and stores
- Agent orchestration → Agent middleware: runs through
- Agent orchestration → Knowledge retrieval: requests retrieval
- Knowledge retrieval → Knowledge search: searches
- Knowledge retrieval → Configured data stores: loads bindings
- Agent orchestration → Model providers: calls
- Agent orchestration → Business tools: dispatches tools
- Business tools → Business backends: uses backends
- Agent orchestration → AI response: produces
- Business tools → Human approval: requests approval
- Business tools → Human handoff tickets: requests handoff
- Human handoff tickets → Agent workbench: notifies
- Agent workbench → Human handoff tickets: updates
- Conversation summary → Configured data stores: reads chat history
- Admin operator → Admin API: manages
- Admin API → Admin authentication: authenticates
- Admin authentication → Enterprise LDAP: binds optionally
- Admin API → Agent and runtime config: configures agents
- Admin API → Channel bindings: configures bindings
- Admin API → Skills and MCP: manages integrations
- Admin API → Scheduled tasks: manages schedules
- Channel bindings → App ingress: publishes runtime config
- Agent and runtime config → Model providers: configures runtime
- Admin API → Rate and content controls: maintains rules
- Admin API → SQL query console: queries configured data
- SQL query console → Configured data stores: executes queries
- Quality review → Feedback and FactLog: records findings
- Customer and channels → Feedback and FactLog: rates responses
