customer_support.json
Overview
The customer_support.json file defines a comprehensive intelligent customer service workflow system. Its primary function is to process user queries by classifying their intent via a large language model (LLM) and directing the requests to specialized agents for tailored responses. This system supports multilingual titles and descriptions (English and Chinese) and is designed to simulate a professional, empathetic, and context-aware customer support experience.
The workflow is structured as a directed graph of interconnected components including:
Begin component: Entry point that initiates the conversation.
Categorize component: Classifies user queries into predefined categories (contact, casual, complain, product-related).
Retrieval component: Fetches relevant product information from a knowledge base.
Agent components: Specialized chatbots (agents) that handle different query categories with unique behaviors and LLM prompts.
Message components: Generate final responses by aggregating agent outputs or providing fixed replies.
This modular design enables flexible, multi-path processing of user intents and ensures that queries are handled by the most appropriate expert agent.
Detailed Component Descriptions
1. Begin Component
Name: begin
Type:
BeginRole: Entry point of the workflow.
Parameters:
enablePrologue (bool): Enables an introductory message.
prologue(string): Initial message to greet users.mode (string): Conversation mode, set to
"conversational".
Functionality: Starts the interaction with a welcoming prompt:
"Hi! I'm an official AI customer service representative. How can I help you?"Downstream: Forwards user input to the Categorize component for intent classification.
2. Categorize Component
Name:
Categorize:DullFriendsThankType:
CategorizeRole: Classifies user queries into four categories using LLM intent classification.
Parameters:
category_description: Defines four categories with descriptions, examples, and routing targets:contact: Queries requesting specific contact info (email, phone, social handles).
casual: Non-product related casual chat.
complain: General complaints or dissatisfaction.
product related: Questions about product usage, features, issues.
llm_id: LLM model identifier (deepseek-chat@DeepSeek).temperature: Controls LLM response randomness (0.1).message_history_window_size: 1 (only recent message considered).outputs:category_nameof type string.query: Bound to system query sys.query.
Functionality: Uses the LLM to assign the user query to one of the four categories.
Downstreams: Routes queries to respective components based on category:
contact→Message:BreezyDonutsHealcasual→Agent:TwelveOwlsWatchcomplain→Agent:DullTownsHopeproduct related→Retrieval:ShyPumasJoke
3. Retrieval Component
Name:
Retrieval:ShyPumasJokeType:
RetrievalRole: Retrieves relevant product document snippets from knowledge bases in response to product-related queries.
Parameters:
query: System query (sys.query).top_k: 1024 (max documents retrieved).top_n: 8 (top documents used).similarity_threshold: 0.2 (minimum similarity to consider).keywords_similarity_weight: 0.7 (weight for keyword similarity in retrieval).empty_response: Empty string if no docs found.outputs: formalized_content - a string containing retrieved content.
Functionality: Fetches product-related information that is then used by a dedicated product agent for answering.
Downstream: Passes retrieved content to Agent:KhakiSunsJudge.
4. Agent Components
Each Agent represents a specialized chatbot with distinct roles, system prompts, and LLM settings.
a) Agent: DullTownsHope ("Soothe mood")
Role: Provides empathetic, emotional support to users who complain or express frustration.
Prompts / Behavior:
Warm, kind, understanding tone.
Focus on empathy rather than solving the problem.
Encourages users positively.
LLM Parameters:
Model:
deepseek-chat@DeepSeek.Temperature: 0.5.
Max tokens: 4096.
Max retries: 3.
Max rounds: 5.
Frequency penalty: 0.3.
Presence penalty: 0.2.
Inputs: User query (sys.query).
Downstream: Sends output to Message:GreatDucksArgue.
b) Agent: KhakiSunsJudge ("Product info")
Role: Acts as a highly professional product information advisor, providing strictly factual and structured answers based on retrieved documents.
Prompts / Behavior:
Answers only from verified product documents.
No assumptions, guesses, or fabricated content.
Requests clarification if query is unclear.
Answers are concise, professional, and formatted.
LLM Parameters:
Model:
deepseek-chat@DeepSeek.Temperature: 0.1.
Max tokens: 256.
Frequency penalty: 0.7.
Presence penalty: 0.4.
Max retries: 3.
Max rounds: 5.
Inputs: User query + retrieved product content (
Retrieval:ShyPumasJoke@formalized_content).Downstream: Sends output to Message:GreatDucksArgue.
c) Agent: TwelveOwlsWatch ("Causal chat")
Role: Engages the user in friendly, casual conversation.
Prompts / Behavior:
Natural, relaxed, positive tone.
Avoids sensitive or negative topics.
May guide conversation with related casual topics.
LLM Parameters:
Model:
deepseek-chat@DeepSeek.Temperature: 0.5.
Max tokens: 4096.
Frequency penalty: 0.3.
Presence penalty: 0.2.
Inputs: User query (sys.query).
Downstream: Sends output to Message:GreatDucksArgue.
5. Message Components
a) Message: BreezyDonutsHeal
Role: Sends fixed responses for contact category queries.
Parameters: A list of canned replies such as:
"Okay, I've already write this down. What else I can do for you?"
"Thanks for your trust! Our expert will contact ASAP. So, anything else I can do for you?"
Downstream: None (endpoint).
Upstream: Receives from
Categorize:DullFriendsThank.
b) Message: GreatDucksArgue ("Response")
Role: Aggregates all agent responses for complain, casual, and product-related queries into a combined final message.
Parameters: Concatenates outputs from all three agents:
{Agent:TwelveOwlsWatch@content}{Agent:DullTownsHope@content}{Agent:KhakiSunsJudge@content}
Downstream: None (endpoint).
Upstream: Receives from all three agent components.
Global Variables
sys.conversation_turns: Tracks number of conversation turns.sys.files: List of files involved (empty by default).sys.query: The current user query string.
sys.user_id: ID of the current user.
Workflow / Execution Flow
Conversation Start: The begin node greets the user and collects their query.
Intent Classification: The
Categorizenode classifies the user's intent into one of four categories.Routing:
If contact, respond with fixed messages (
Message:BreezyDonutsHeal).If casual, forward query to casual chat agent (
Agent:TwelveOwlsWatch).If complain, forward to empathetic agent (
Agent:DullTownsHope).If product related, retrieve relevant documents (
Retrieval:ShyPumasJoke), then forward to product info agent (Agent:KhakiSunsJudge).
Response Generation: Agents generate responses based on their respective roles and LLM prompts.
Response Aggregation: Message:GreatDucksArgue aggregates outputs from the agents for final user output.
End of Turn: The system awaits the next user input or ends the session.
Implementation Details and Algorithms
Intent Classification: Uses an LLM (
deepseek-chat@DeepSeek) with prompt engineering to classify incoming queries into well-defined categories. The categories are clearly described with example queries for better classification accuracy.Product Information Retrieval: Implements a vector-based semantic retrieval system that fetches relevant product documents using similarity scoring with keyword weighting and thresholds. This preprocessed content is passed to the product agent for fact-based answering.
Agent Responses: Each agent has a finely tuned system prompt that shapes the LLM output to match the intended tone and role:
Empathetic assistance for complaints.
Professional, fact-based answers for product queries.
Lighthearted, casual conversation for chit-chat.
Response Aggregation: Multiple agents' outputs are concatenated to provide a comprehensive final user response, accommodating multi-intent or overlapping queries.
Error Handling: Agents have retry limits and delay parameters for robust error recovery.
Interaction with Other System Components
Knowledge Base: The Retrieval component interacts with external product knowledge bases to fetch relevant documents.
LLM Services: All classification and response generation rely on the specified LLM
deepseek-chat@DeepSeek.User Interface Layer: The system expects a frontend or conversational interface to deliver prologue, collect sys.query, and display aggregated responses.
System Globals: Shared variables like sys.query and
sys.conversation_turnsmaintain context across components.
Usage Example
Suppose a user inputs the query:
"How do I install the new model X100 on the wall?"
begin greets and receives the query.
Categorizeclassifies it as product related.Retrievalfetches relevant product documents related to "model X100 installation."Agent:KhakiSunsJudge uses the retrieved info and the query to compose an accurate, factual answer.
The answer is combined with outputs from other agents (empty in this case) in Message:GreatDucksArgue.
The final response is shown to the user.
Visual Diagram: Component Interaction Flowchart
flowchart LR
Begin["Begin\n(Start Conversation)"]
Categorize["Categorize\n(Intent Classification)"]
ContactMsg["Message: BreezyDonutsHeal\n(Contact Replies)"]
CasualAgent["Agent: TwelveOwlsWatch\n(Casual Chat)"]
ComplainsAgent["Agent: DullTownsHope\n(Empathetic Support)"]
Retrieval["Retrieval: ShyPumasJoke\n(Product Info Retrieval)"]
ProductAgent["Agent: KhakiSunsJudge\n(Product Info Advisor)"]
FinalMsg["Message: GreatDucksArgue\n(Response Aggregation)"]
Begin --> Categorize
Categorize -- contact --> ContactMsg
Categorize -- casual --> CasualAgent
Categorize -- complain --> ComplainsAgent
Categorize -- product related --> Retrieval
Retrieval --> ProductAgent
CasualAgent --> FinalMsg
ComplainsAgent --> FinalMsg
ProductAgent --> FinalMsg
Summary
The customer_support.json file describes a modular, LLM-powered intelligent customer support workflow that classifies user intents and routes queries to specialized agents for empathetic, casual, contact-related, or product information responses. The workflow integrates a knowledge retrieval system and multiple finely tuned LLM prompts to ensure accurate, context-aware, and user-friendly interactions.
This file serves as the core orchestration layer for an AI-driven customer service system, enabling scalable and maintainable conversational experiences.