Demo URL: https://lke.cloud.tencent.com/webim_exp/#/chat/FAIMcM
To explore practical applications of Tencent Cloud’s Large Model Knowledge Engine (LKE), a sales training assistant was developed to help sales representatives refine thier communication strategies through simulated customer interactions. The system leverages LKE’s workflow capabilities to create dynamic, feedback-driven practice sessions.
Core Workflow Design
The assistant operates in a structured workflow mode, ensuring consistent behavior and adherence to predefined rules. The process begins when a user initiates a session. At this point, the system generates a synthetic customer profile with randomized attributes—age group, gender, personality traits, and target vehicle model—using a code node.
import random
def main(params: dict) -> dict:
age_groups = ['young', 'middle-aged', 'senior']
genders = ['male', 'female']
temperaments = [
'impatient', 'irritable', 'calm', 'tolerant', 'composed',
'stubborn', 'sensitive', 'impulsive', 'reserved', 'optimistic',
'self-disciplined', 'aloof', 'anxious', 'envious', 'introverted', 'extroverted'
]
models = ['BMW X5', 'BMW 3 Series', 'BMW X7', 'BMW M5']
return {
'age_group': random.choice(age_groups),
'gender': random.choice(genders),
'temperament': random.choice(temperaments),
'target_model': random.choice(models)
}
These generated attributes are passed as input variables to subsequent nodes in the workflow.
Simulated Customer Interaction
Using the synthetic profile, a large language model (LLM)—configured with DeepSeek-R1 for deep reasoning—generates an initial two-turn dialogue between a sales consultant and the simulated customer. The final line is always phrased as a customer query or statement, prompting the user (acting as the salesperson) to respond.
Example prompt template:
Generate a realistic car inquiry conversation based on the following customer profile:
- Age group: {age_group}
- Gender: {gender}
- Temperament: {temperament}
- Target model: {target_model}Format:
Consultant: [Opening message]
Customer: [Response or question]
The LLM uses dynamic input variables injected from the code node to ensure contextual relevance. Without proper variable binding, responses would lack personalization and realism.
Real-Time Feedback & Termination Logic
During the conversation, the system continuously evaluates the salesperson’s responses. If the LLM detects disengagement cues—such as overly aggressive pitches, irrelevant answers, or failure to address objections—it may automatically terminate the call and generate a performance review.
Users can also manually end the session by typing "end." In either case, a post-call analysis is produced using the full chat history, accessed via the system variable SYS.ChatHistory.
Note: SYS.ChatHistory is provided as a JSON-formatted string (not a native array), representing the entire dialogue. For long conversations, token limits must be considered. The platform internally manages history as an array but exposes it as a serialized string for workflow compatibility.
Reusable Workflow Architecture
The entire flow is designed as a modular component. While parameterized workflows cannot be directly invoked by assistants (due to missing input resolution), they can be embedded into parent workflows where upstream nodes supply required parameters. This enables reuse across different training scenarios—e.g., real estate, insurance, or tech support—by swapping customer profiles and domain-specific prompts.
User Guidance & Experience
A concise welcome message sets clear expectasions, explaining how to start, interact, and end sessions. Light use of emojis or friendly phrasing improves engagement without compromising clarity. Visual elements like images can be included in response nodes, though Markdown formatting is disabled when images are present.
Demonstration Outcome
In testing, deliberately unhelpful or disengaged replies from the user triggered early termination, followed by actionable feedback such as: "Avoid interrupting the customer," or "Clarify financing options earlier in the conversation." This closed-loop design enables iterative skill development through deliberate practice and reflection.