ecommerce_customer_service_workflow.json
Overview
The ecommerce_customer_service_workflow.json file defines a comprehensive AI-driven workflow template designed for e-commerce customer service. Its primary purpose is to assist e-commerce platforms in handling complex customer needs through automated conversational AI components. These needs include:
Comparing product features and specifications to aid purchase decisions.
Providing product usage guidance and troubleshooting support.
Coordinating and booking home installation services.
The workflow orchestrates multiple specialized AI agents, retrieval components accessing knowledge bases, and categorization nodes to classify user queries and route them to the appropriate handling agents. The system aims to provide a seamless and efficient multi-turn conversational experience that covers a broad spectrum of customer service interactions.
Components and Their Functional Descriptions
This workflow consists of several interconnected components. Each component has a specific role, parameters, and interactions, described below.
1. Begin Component (begin)
Type: Begin Node
Purpose: Entry point of the workflow.
Parameters:
enablePrologue: true — Enables greeting message.mode:"conversational"— Indicates the mode of interaction.prologue: "Hi! I'm your assistant. " — Initial greeting to users.
Usage: Starts the conversation and forwards user input to the Categorize component.
2. Categorize Component (Categorize:NewDonkeysShare)
Type: Categorize Node
Purpose: Classifies incoming user queries into one of three categories, routing them to the appropriate downstream components for specialized handling.
Parameters:
llm_id: "deepseek-v3@Tongyi-Qianwen" — Language model identifier used for classification.message_history_window_size: 1 — Number of previous messages considered.query: "sys.query" — The user query to classify.category_description: Defines categories with descriptions, examples, and routing targets:Book Installation: Handles scheduling/rescheduling installation appointments.
Product Feature Comparison: Assists in comparing multiple product specifications.
Product Usage Guide: Provides product setup, usage, and troubleshooting instructions.
Outputs:
category_name(string) indicating the recognized category.Upstream:
beginDownstream:
Book Installation →
Agent:DeepCoatsDressProduct Feature Comparison →
Retrieval:EightyDaysHappenProduct Usage Guide →
Retrieval:EagerTipsFeel
Usage Example:
User Query: "Can I reschedule my installation appointment?"
Output Category: "Book Installation"
Routed to Installation Booking Agent for further handling.
3. Retrieval Components
These components query specialized knowledge bases to retrieve formalized content relevant to the user query.
a. Feature Comparison Knowledge Base (Retrieval:EightyDaysHappen)
Purpose: Retrieves product specification data for feature comparison.
Parameters:
kb_ids:["65cb5150819b11f08347047c16ec874f"]— Knowledge base ID for product specs.query: "{sys.query}" — User query.top_k: 1024,top_n: 8 — Retrieval limits.similarity_threshold: 0.2 — Minimum similarity for retrieval.keywords_similarity_weight: 0.7 — Weight for keyword similarity.
Output: formalized_content (string) containing retrieved data.
Upstream:
Categorize:NewDonkeysShareDownstream:
Agent:PlentyCandiesRefuse
b. Usage Guide Knowledge Base (Retrieval:EagerTipsFeel)
Purpose: Retrieves product usage guides and troubleshooting information.
Parameters: Similar to Feature Comparison KB but uses knowledge base ID
["a5aaec4a819b11f095f1047c16ec874f"].Output: formalized_content (string).
Upstream:
Categorize:NewDonkeysShareDownstream:
Agent:ShinyCooksCall
4. Agent Components
Agents are AI-driven conversational units that generate responses based on user queries and retrieved content.
a. Feature Comparison Agent (Agent:PlentyCandiesRefuse)
Role: Product specification comparison assistant.
Goal: Help users compare two or more products based on features/specifications.
Instructions: Confirm model names, request missing info, present comparisons neutrally and clearly.
Parameters:
llm_id: "deepseek-v3@Tongyi-Qianwen"max_tokens: 256max_retries: 3message_history_window_size: 12prompts: Includes user query and retrieved schema content.sys_prompt: Detailed prompt defining role and instructions.Penalties and temperature settings tuned for focused output.
Upstream:
Retrieval:EightyDaysHappenDownstream:
Message:KhakiSymbolsMarryOutput: content (string) — Comparison result.
Usage Example:
Input: User query and specification data for Model X and Model Y.
Output: Structured comparison highlighting key differences.
b. Usage Guide Agent (Agent:ShinyCooksCall)
Role: Product usage guide assistant.
Goal: Provide setup, operation, and maintenance instructions.
Instructions: Provide step-by-step guidance, answer feature questions, offer troubleshooting tips.
Parameters: Similar to Feature Comparison Agent but uses usage guide schema.
Upstream:
Retrieval:EagerTipsFeelDownstream:
Message:KhakiSymbolsMarryOutput: content (string) — Usage guidance.
Usage Example:
Input: User question about how to set up the product.
Output: Clear, actionable setup steps.
c. Installation Booking Agent (Agent:DeepCoatsDress)
Role: Installation booking assistant.
Goal: Collect contact number, preferred installation time, and address.
Instructions:
Check which details are provided.
Request missing info without repeating known details.
Confirm all details and inform user about technician follow-up.
Parameters: Similar LLM and token settings, with a multi-turn message history window size of 6.
Upstream:
Categorize:NewDonkeysShareDownstream:
Message:KhakiSymbolsMarryOutput: content (string) — Confirmation and booking details.
Usage Example:
Multi-turn dialogue collecting installation details.
Final confirmation message sent to user.
5. Message Component (Message:KhakiSymbolsMarry)
Type: Message Node
Purpose: Aggregates outputs from all three agents into a single user response.
Parameters:
content: Concatenation of the outputs from Feature Comparison Agent, Usage Guide Agent, and Installation Booking Agent.
Upstream: All three agents
Downstream: None (end of workflow)
Usage: Delivers the final combined message to the user.
Implementation Details and Algorithms
Classification Algorithm: The Categorize node uses a fine-tuned language model (deepseek-v3@Tongyi-Qianwen) to classify user queries into categories based on semantic understanding and predefined examples, ensuring accurate routing.
Knowledge Retrieval: Retrieval nodes perform semantic similarity searches over large knowledge bases containing product specs and user guides, using thresholds and similarity weights to filter results.
Conversational AI Agents: Each agent uses a controlled prompt engineering approach with system prompts defining roles, goals, instructions, and constraints. Multi-turn context is maintained with configurable message history windows and retry logic to handle errors.
Output Aggregation: The Message node composes a coherent response by concatenating outputs from all agents, ensuring a unified reply.
Interaction with Other System Parts
User Interface: The workflow integrates with a conversational UI that captures user queries and displays multi-turn conversations.
Knowledge Bases: External KBs are referenced via KB IDs for product features/specs and usage guides, requiring backend support for semantic search APIs.
AI Language Models: The workflow depends on the deepseek-v3@Tongyi-Qianwen large language model for both classification and generation tasks.
Data Persistence: The Installation Booking Agent collects user details that likely interface with CRM or scheduling systems (not shown in this file).
System Globals: The workflow uses system-level variables like sys.query (user input),
sys.conversation_turns, and sys.user_id for conversational state management.
Visual Diagram: Workflow Flowchart
flowchart TD
Begin(["Begin\n(start)"])
Categorize["Categorize\n(Event Classification)"]
RetrievalFeature["Retrieval\n(Feature Comparison KB)"]
RetrievalUsage["Retrieval\n(Usage Guide KB)"]
AgentFeature["Agent\n(Feature Comparison)"]
AgentUsage["Agent\n(Usage Guide)"]
AgentBooking["Agent\n(Installation Booking)"]
Message["Message\n(Final Response)"]
Begin --> Categorize
Categorize -- "Product Feature Comparison" --> RetrievalFeature
Categorize -- "Product Usage Guide" --> RetrievalUsage
Categorize -- "Book Installation" --> AgentBooking
RetrievalFeature --> AgentFeature
RetrievalUsage --> AgentUsage
AgentFeature --> Message
AgentUsage --> Message
AgentBooking --> Message
Summary of Key Workflow Steps
User Query Input: Conversation starts at
Beginnode with greeting.Query Classification:
Categorizenode classifies the query into one of three categories.Knowledge Retrieval: For feature comparison and usage guide queries, relevant knowledge base content is retrieved.
Agent Processing: Specialized agents process the classified query, using retrieved data where applicable, to generate responses.
Installation Booking: For booking requests, the agent collects and confirms appointment details through multi-turn dialogue.
Response Aggregation: The
Messagenode combines agents' outputs and sends the final response back to the user.
Additional Notes
The workflow is multilingual, with titles and descriptions included in English and Chinese.
The system is designed for extensibility; additional categories or agents can be added by expanding the Categorize node.
Prompt engineering is central to the agents' performance, with detailed system prompts guiding AI behavior.
The workflow references a dataset hosted at:
https://huggingface.co/datasets/InfiniFlow/Ecommerce-Customer-Service-Workflow
This documentation provides a detailed understanding of the ecommerce customer service workflow, enabling developers and system architects to maintain, extend, or integrate this template within larger e-commerce support systems.