LangGraph-based customer service system

By integrating NLP modules with enterprise business systems through a LangGraph-based customer service system, intelligent business processing capabilities have been achieved. This solves the problem of increased manual costs for user inquiries in existing technologies, improves user experience, and completes an end-to-end business loop.

CN121903618APending Publication Date: 2026-04-21GUIYANG LONGMA COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUIYANG LONGMA COMM TECH CO LTD
Filing Date
2025-12-18
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies lack process modeling and business processing capabilities, resulting in increased manual costs for user inquiries due to the lack of intelligence, the inability to complete end-to-end business loops, and a limited user experience.

Method used

The customer service system based on LangGraph integrates an NLP module, a LangGraph process engine, a knowledge base management module, and enterprise business systems. Through layered decoupling and plug-in extension, it realizes the function of a language interaction hub, with capabilities such as intent recognition, dialogue state tracking, and accurate response generation, and supports adaptation to multiple industry scenarios.

Benefits of technology

It has achieved intelligent business processing capabilities, reduced manual intervention, improved user experience, reduced operating costs, and completed an end-to-end business loop.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121903618A_ABST
    Figure CN121903618A_ABST
Patent Text Reader

Abstract

The invention provides a LangGraph-based customer service system, which comprises an NLP module used for realizing a language interaction center function, and the NLP module has the following functions: receiving natural language input of a user side, the natural language input comprising character input and voice-to-character input; a LangGraph process engine, a knowledge base management module and an enterprise business system are linked; converting the user fuzzy natural language into a structured instruction which can be executed by a platform; dynamically judging a dialogue trend in combination with a LangGraph process node rule; and generating a natural language reply conforming to enterprise specifications based on a knowledge base retrieval result and business system data so as to complete user consultation response and business operation execution. The problem that the labor cost is increased due to lack of intelligentization of user consultation problems caused by lack of flow modeling and business handling capabilities in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of AI, and in particular relates to a customer service system based on LangGraph. Background Technology

[0002] The closest solution to this invention is an intelligent question-and-answer robot based on a large language model and incorporating RAG capabilities. Existing solutions generally suffer from the following technical limitations: 1. Limited to question-and-answer: Most systems remain "enhanced chatbots," capable of answering questions but unable to actually perform the business operations required by user requests, such as order processing, work order submission, and system queries; 2. Insufficient business processing capabilities: Existing solutions fail to deeply integrate with internal enterprise business systems (CRM, ERP, work order systems, etc.), resulting in the need to transfer users to human customer service when their needs exceed the scope of question-and-answer; 3. High rate of human intervention: Due to a lack of process modeling and business processing capabilities, the problem resolution rate is low, leading to a large number of users requiring human intervention and increasing enterprise operating costs; 4. Limited user experience: The inability to complete an end-to-end business loop easily causes response delays and user dissatisfaction, even leading to an increase in complaint rates. Summary of the Invention

[0003] The purpose of this embodiment is to provide a customer service system based on LangGraph to solve the problem that the lack of process modeling and business processing capabilities in existing technologies leads to increased labor costs for user inquiries due to the lack of intelligence.

[0004] A LangGraph-based customer service system includes an NLP module for implementing a language interaction hub. The NLP module has the following functions: receiving natural language input from the user, including text input and speech-to-text input; linking the LangGraph process engine, knowledge base management module, and enterprise business system; converting the user's fuzzy natural language into structured instructions executable by the platform; dynamically determining the dialogue direction based on LangGraph process node rules; and generating natural language responses conforming to enterprise standards based on knowledge base retrieval results and business system data to complete user inquiry responses and business operation execution.

[0005] Furthermore, the NLP module features layered decoupling and plug-in extension capabilities, specifically including: a bottom-up construction of a basic capability layer, a core function layer, and an application adaptation layer, with each layer communicating data through standardized interfaces to ensure module reuse and expansion; the basic capability layer has the function of standardizing user input; the core function layer has the core logic processing functions of understanding user intent, managing dialogue state, and generating accurate responses; and the application adaptation layer has the function of adapting to multiple industry scenarios and providing a low-code configuration entry point.

[0006] Furthermore, the basic capability layer includes a unit with text preprocessing capabilities. Specific functions of this unit include: filtering noise data from user-input text, including special characters, meaningless interjections, and repeated characters, using regular expression matching to achieve noise filtering; segmenting the text using an industry terminology dictionary to prevent industry terms from being split; and uniformly converting English input to lowercase and traditional Chinese to simplified Chinese to achieve text format uniformity and provide standardized input for subsequent intent recognition and retrieval.

[0007] Furthermore, the basic capability layer also includes a unit with speech-to-text adaptation capabilities. The specific functions of this unit include: connecting to multiple third-party ASR interfaces and selecting the currently used ASR interface through a configuration file; receiving voice files uploaded by users and automatically converting them into the voice format required by the ASR interface; performing semantic error correction on the ASR recognition results and implementing fuzzy matching correction based on an industry high-frequency word library to output accurate speech-to-text text.

[0008] Furthermore, the basic capability layer also includes a unit with terminology management functions. The specific functions of this unit include: implementing multi-tenant terminology isolation management based on enterprise tenant ID, including storing industry-specific terms defined by different enterprises; automatically extracting high-frequency terms from business documents when adding or modifying them in the knowledge base management module; pushing the extracted high-frequency terms to the enterprise for review, and updating them to the terminology database after approval, providing terminology support for text preprocessing, intent recognition, and retrieval.

[0009] Furthermore, the core functional layer includes a unit with intent recognition capabilities. Specific functions of this unit include: employing a hybrid recognition method combining rule-based recognition and LLM recognition; rapidly identifying high-frequency, standardized user intents through keyword matching and rule bases; classifying and extracting slots for fuzzy and complex user intents using LLM; determining the confidence level of the intent recognition results; triggering multiple rounds of follow-up questions when the confidence level falls below a set threshold; detecting whether the required slots for the intent are missing; and automatically generating follow-up question scripts if missing slots exist, until complete slot data is obtained, providing a basis for LangGraph process navigation.

[0010] Furthermore, the core functional layer also includes a unit with dialogue state tracking capabilities. This unit's specific functions include: defining the dialogue state using JSON format, which includes a session identifier, user identifier, agent identifier, current intent, slot data, current process node, historical dialogue rounds, and session expiration time; storing the dialogue state in a cache database; updating the current intent and slot data based on intent recognition results after each dialogue round, updating the current process node based on the LangGraph process engine node execution results, and recording historical dialogue rounds; and loading the historical dialogue state when a user interrupts the session and re-initiates a request, reusing the already filled slot data if the session has not expired, and continuing the process from the current process node.

[0011] Furthermore, the core functional layer includes a unit with RAG enhancement capabilities. This unit's specific functions include: generating precise search queries based on the current intent and slot data in the dialogue state; calling a vectorized model to convert the search queries into vectors, calculating cosine similarity with the vectorized data in the knowledge base, and filtering results whose similarity meets a threshold; filtering the results by combining the knowledge base update time and associated agent identifiers, and re-sorting them according to similarity and update time weights; and inputting a portion of the sorted results as contextual knowledge into the LLM to generate precise responses that integrate knowledge base information, thus avoiding the illusion of the LLM.

[0012] Furthermore, the core functional layer includes a unit with response generation capabilities. Specific functions of this unit include: providing scenario-based response templates based on the current intent and current process node, including enterprise-customized template styles; for complex scenarios, combining historical dialogue rounds and RAG search results to call LLM to generate personalized responses, and controlling response length to adapt to different terminals; including multimodal output such as text and rich text, where the rich text includes order information tables, logistics progress image links, and business processing links to adapt to different dialogue scenario requirements.

[0013] Furthermore, the application adaptation layer has industry adaptation and intent configuration functions, including: providing a web-based visual interface through the industry corpus configuration center, allowing enterprises to upload industry-specific corpora in Excel and TXT formats and annotate them, using the corpora to update the intent recognition rule base and fine-tune the LLM; providing general intent templates categorized by industry through the intent template library, allowing enterprises to configure custom intent names, trigger keywords and required slots based on the templates, customize slot types, required attributes and validation rules, and configure the priority of different intents to adapt to business scenarios in multiple industries.

[0014] This invention provides a LangGraph-based customer service system that solves the problem that the lack of process modeling and business processing capabilities in existing technologies leads to increased manual costs for user inquiries due to a lack of intelligence.

[0015] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0016] Figure 1 This is a system framework diagram of a LangGraph-based customer service system provided in an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.

[0018] This invention provides a customer service system based on LangGraph (see...) Figure 1 ),include:

[0019] The NLP module serves as the platform's "language interaction hub," receiving natural language input (text and speech-to-text) from the user and linking with the LangGraph process engine, knowledge base management module, and enterprise business systems (CRM / ERP) at the bottom. Its roles include:

[0020] Intent Translator: Translates users' ambiguous natural language (such as "Why hasn't my goods arrived yet") into structured instructions that the platform can execute (such as "Trigger the logistics tracking process and check the logistics status of order OD20240520001").

[0021] Dialogue Decision Maker: Based on the rules of LangGraph process nodes, dynamically determine the direction of the dialogue (e.g., after the user replies "order number OD123", the decision jumps to the "order information query node");

[0022] Content Generator: Based on knowledge base search results and business system data, generate responses that conform to enterprise standards and are easy to understand (e.g., combining logistics API data and knowledge base timeliness rules to generate "Your order is expected to arrive on May 22").

[0023] In practice, the NLP module adopts a "layered decoupling plus plug-in extension" architecture, divided from bottom to top into a basic capability layer, a core function layer, and an application adaptation layer. Each layer communicates through standardized interfaces, ensuring the module's reusability and scalability. The specific implementation architecture is as follows:

[0024] Application adaptation layer: includes an industry corpus configuration center and intent template library, used to adapt to multiple industry scenarios, providing a low-code configuration entry point. Specific implementation modules include knowledge base management module and intelligent agent configuration module.

[0025] Core Function Layer: It includes an intent recognition unit, a dialogue state tracking unit, a RAG enhancement unit, and a response generation unit, which are used to implement the core logic of "understanding - decision - making - generation". The specific implementation modules include large language models (LLMs) and the LangGraph process engine;

[0026] Basic Capability Layer: It includes a text preprocessing unit, a speech - to - text (ASR) adaptation unit, and a term dictionary unit, which are used to provide standardized input processing for the core functions. Specifically, when implementing, it includes using third - party ASR interfaces (such as Baidu Smart Cloud and Alibaba Cloud).

[0027] The specific technical implementation of the key modules includes:

[0028] (I) Basic Capability Layer: Standardized Input Processing;

[0029] The core goal of the basic capability layer is to convert "unstructured user input" into "standardized text data" and provide high - quality input for the core function layer. The specific sub - module design in this embodiment is as follows:

[0030] I. Text Preprocessing Unit:

[0031] Core Function: Clean the noise data in the user - input text, unify the format, and ensure the accuracy of subsequent intent recognition and retrieval;

[0032] Specific Technical Implementation:

[0033] 1. Noise Filtering: Remove special characters (such as "@#¥%"), meaningless modal particles (such as "嗯, 啊, 哦"), and repeated characters (such as "好好好好" -> "好"), and use regular expressions (such as `[^a-zA-Z0-9\u4e00-\u9fa5,。!?]`) for matching and filtering;

[0034] 2. Word Segmentation: Combine with industry - specific term dictionaries (such as "7 - day no - reason" in e - commerce and "volte call" in communications), and use jieba word segmentation (custom dictionary mode) to avoid splitting terms (such as "7 - day no - reason" is not split into "7 days / no / reason");

[0035] 3. Case / Simplified - Traditional Unification: Convert English input to lowercase uniformly (such as "ORDER" -> "order"), and convert traditional Chinese to simplified Chinese (such as "訂單" -> "订单") to adapt to subsequent retrieval and model input requirements;

[0036] Output Result Format: Standardized text (such as when the user inputs "我的ORDER OD123啥时候到啊??", after preprocessing, it becomes "我的order od123啥时候到").

[0037] II. Automatic Speech-to-Text (ASR) Adaptor Unit;

[0038] It is used to connect to third-party ASR interfaces to convert user voice input into text, and is suitable for scenarios such as telephone customer service and voice assistants.

[0039] The specific implementation includes:

[0040] 1. Multi-interface adaptation: Includes Baidu AI Cloud, Alibaba Cloud, and iFlytek ASR interfaces. Select the currently used interface through the configuration file (`asr_config.json`). Example configuration:

[0041]

[0042] 2. Voice format processing: Receive voice files (such as wav, mp3) uploaded by users, automatically convert them to the format required by the ASR interface (such as pcm), and use FFmpeg to perform format transcoding;

[0043] 3. Error correction and optimization: Semantic error correction is performed on the ASR recognition results (e.g., “ordered” -> “order”, “refund” -> “refund” -> “refund”), and fuzzy matching correction is performed based on the industry’s high-frequency word library (e.g., high-frequency e-commerce after-sales words “refund”, “logistics”, “order”).

[0044] Output result format: Corrected speech-to-text (e.g., user voice "When will my order arrive?" -> ASR recognition "When will my order arrive?" -> Corrected "When will my order arrive?").

[0045] III. Terminology Dictionary Unit

[0046] Used to maintain an industry-specific terminology database, providing terminology support for word segmentation, intent recognition, and retrieval, and avoiding "terminology misunderstandings";

[0047] The specific implementation includes:

[0048] 1. Multi-tenant terminology isolation: A terminology library is maintained based on `tenant_id` (enterprise tenant ID). Different enterprises can define their own terms (e.g., e-commerce enterprises can add "7-day no-reason return policy, shipping insurance", and telecommunications enterprises can add "data package, plan change"), which are stored in the `term_dictionary` table, with the following structure:

[0049]

[0050] 2. Automatic Terminology Update: When the knowledge base management module adds / modifies business documents (such as adding "618 Temporary Refund Policy" to e-commerce), it automatically extracts high-frequency terms from the documents (such as "618 Exclusive Refund"), pushes them to the terminology dictionary unit, and adds them to the terminology database after review;

[0051] Output: A tenant-specific terminology list for use by the text preprocessing and intent recognition units.

[0052] (II) Core Functional Layer: The core logic of "understanding-decision-generation";

[0053] The core functional layer is the "brain" of the NLP module. Based on the standardized input of the basic capability layer, it realizes user intent understanding, dialogue state tracking, and accurate content generation. The specific sub-module design is as follows: Intent recognition unit: accurately understands user needs, is used to identify the intent of user input (such as "query order", "apply for refund", "transfer to human", and extract key slot data (such as order number, refund amount) to provide a basis for LangGraph process jump;

[0054] Technical implementation details include:

[0055] 1. "Rule + LLM" hybrid recognition scheme:

[0056] Rule recognition (priority): For high-frequency, standardized intents (such as "query order", where the user input contains keywords such as "order number" and "OD"), keyword matching (such as the regular expression `OD\d{8}` matching the order number) + rule base (such as "input containing 'order' + 'to' -> intent = logistics query") is used to quickly identify intents and reduce LLM call costs;

[0057] LLM Recognition (Supplement): For ambiguous and complex intents (such as "I haven't received my goods and want a refund"), LLM (such as Tongyi Qianwen, GPT-3.5) is used for intent classification and slot extraction. Prompt engineering is employed to optimize recognition accuracy. Example Prompt:

[0058] Task: Identify the intent and slot data of e-commerce after-sales users.

[0059] Intent list: order inquiry, refund request, logistics tracking, transfer to human operator, other.

[0060] Slot definition: Order number (e.g., OD20240520001), refund amount (e.g., 100 yuan), logistics tracking number (e.g., SF123456).

[0061] User input: {Standardized text}

[0062] Output format: {"intent":"intent label","slots":{"slot name":"slot value"}}

[0063] 2. Intent credibility judgment: The default confidence level of intent identified by rules is 1.0 (deterministic matching). The confidence level of intent identified by LLM is returned (e.g., 0.92). When the confidence level is ≥0.8, the result is output directly. When it is <0.8, "multi-round follow-up questions" are triggered (e.g., "Do you want to check the order status or apply for a refund?").

[0064] 3. Slot completion: If the required slot is missing (e.g., the "refund application" intent is missing "order number"), follow-up questions will be automatically generated (e.g., "Please provide the order number for which you need a refund") until complete slot data is obtained;

[0065] Output format: Intent tag-slot data (e.g., `{"intent":"Request a refund","slots":{"order_no":"OD20240520001","refund_reason":"Product quality issue"}}`), is passed to the LangGraph workflow engine and dialogue state tracking unit.

[0066] Dialogue State Tracking (DST) Unit: Dynamically manages dialogue context; records "user intent, slot data, and process node position" throughout the entire dialogue process, providing contextual support for multi-turn dialogues and process recovery, and avoiding repeated user input;

[0067] Technical implementation details include:

[0068] 1. The conversation state is defined using JSON format and stored in Redis (key: `session:{session_id}`), including the following core fields:

[0069]

[0070]

[0071] 2. State update logic:

[0072] After each round of dialogue, `current_intent`, `filled_slots`, and `missing_slots` are updated based on the results of the intent recognition unit.

[0073] Update `current_flow_node` based on the node execution results of the LangGraph flow engine;

[0074] Record user input and agent responses, and append them to `history_turns`;

[0075] 3. State recovery mechanism: After a user interrupts the session and re-initiates a request (carrying `session_id`), the unit loads the historical session state from Redis. If it has not expired, it directly reuses `filled_slots` (e.g., if the user has already entered the order number, there is no need to ask again) and continues the process from `current_flow_node`.

[0076] Output: Real-time updated dialogue state, available for use by the LangGraph workflow engine (node ​​navigation) and response generation unit (context association).

[0077] RAG Enhancement Unit: Combines with the enterprise knowledge base to improve the accuracy of answers. It is used to semantically match user input with the enterprise's exclusive knowledge base (such as after-sales FAQ, business rules), retrieve relevant knowledge fragments, provide "authoritative basis" for LLM to generate responses, and avoid model "illusion".

[0078] The specific implementation technologies include:

[0079] 1. Knowledge base retrieval process:

[0080] S1: Query generation. Based on the `current_intent` and `filled_slots` in the dialogue state, generate a precise query (e.g., intent = logistics tracking, slot = order number OD20240520001 -> query = "logistics tracking rules for order OD20240520001, logistics timeliness in the Jiangsu, Zhejiang and Shanghai region").

[0081] S2: Vector Retrieval. A vectorization model (such as Sentence-BERT) is used to convert the query into an embedding vector. Cosine similarity is calculated between this vector and the embedding field in the knowledge base's vectorization table (Table 2). Five ranking similarity results are then selected (similarity threshold ≥ 0.7; results below the threshold are considered irrelevant knowledge).

[0082] S3: Knowledge Filtering and Sorting. Combining the `cmetadata` field (such as knowledge base update time, associated agent ID), filter out expired and irrelevant knowledge (such as only retaining logistics rules updated after 2024), and re-sort according to "similarity + update time" (similarity weight 0.7, update time weight 0.3);

[0083] 2. Knowledge and LLM Integration for Response Generation: The three ranking search results are used as "contextual knowledge" and fed into the LLM function to generate responses. A Prompt is used to optimize and avoid knowledge omissions. Example Prompt:

[0084] Task: Based on the following contextual knowledge, answer users' questions about e-commerce after-sales logistics. You must strictly adhere to the knowledge content and not add irrelevant information.

[0085] Contextual knowledge: {3 ranking search results, such as "Delivery within 1-2 days for Jiangsu, Zhejiang and Shanghai areas, and 3-5 days for remote areas; order OD20240520001 was shipped from Hangzhou and its destination is Shanghai"}

[0086] User question: {User input}

[0087] Output requirements: Natural language response, including the logistics timeline and current status of the specific order (if applicable).

[0088] Output result format: precise response integrated with knowledge base (e.g., "Your order OD20240520001 was shipped from Hangzhou to Shanghai, which is in the Jiangsu, Zhejiang and Shanghai area. The logistics time is 1-2 days, and the current status is 'in transit'").

[0089] 4. Response Generation Unit: Natural language output adapted to the scenario;

[0090] It is used to generate natural, standardized responses that conform to the company's style based on the dialogue scenario (such as multi-round follow-up questions, business result notification, and prompting to transfer to human agent), and supports multimodal output (text and rich text);

[0091] Specific technical implementations include:

[0092] Contextualized Response Templates: Based on `current_intent` and `current_flow_node`, contextualized templates are provided. Enterprises can customize the template style through the intelligent agent configuration module (e.g., e-commerce after-sales service uses "Hi~", and telecommunications customer service uses "Hello,"). Example template:

[0093] Template for asking about missing slots: "{style_prefix} Please provide the {missing_slot} you need so that we can process it for you quickly~" (e.g., "Dear~ Please provide the order number for which you need to request a refund so that we can process it for you quickly~");

[0094] Business result notification template: "{style_prefix}Your {intent} request has been submitted, {business_info}, expected to be completed within {time_range}" (e.g., "Dear customer, your refund application has been submitted, order number OD20240520001, expected to arrive in 1-3 business days");

[0095] The template for transferring to a human operator is: "{style_prefix} The current issue requires human assistance. You have been matched with an after-sales agent. The estimated wait time is {wait_time} minutes. Please wait patiently."

[0096] 2. LLM Personalized Generation: For complex scenarios (such as user complaints about "refunds not arriving in time"), based on the `history_turns` of the dialogue state and RAG search results, LLM is called to generate personalized responses, avoiding the rigid feel of templates, while controlling the length of responses (e.g., ≤200 characters on mobile devices and ≤300 characters on PC devices).

[0097] 3. Multimodal output adaptation: Supports text and rich text (such as order information tables, logistics progress image links) output, for example:

[0098] Tracking reply: Text + logistics progress image link ("Your order logistics progress: [image link], current location: Hangzhou transit center");

[0099] Single query reply: Text + order information table ("Your order information is as follows:") Order number OD20240520001 state Shipped ”);

[0100] The results include: contextualized, multimodal agent responses, which are transmitted to the user terminal and the conversation recording module.

[0101] (III) Application Adaptation Layer: Low-code Configuration and Industry Customization;

[0102] The core goal of the application adaptation layer is to lower the barrier to entry for enterprises, support "zero-code / low-code" configuration of NLP module parameters, and adapt to the needs of different industries and business scenarios. The specific sub-module design is as follows:

[0103] Industry Corpus Configuration Center

[0104] It is used to provide a web-based visual interface, allowing enterprises to upload industry-specific corpora (such as e-commerce after-sales dialogue samples, communication package consultation samples) to optimize the accuracy of intent recognition and response generation;

[0105] Technical implementation details include:

[0106] 1. Corpus Upload and Annotation: Supports uploading corpora in Excel and TXT formats. Corpus fields include "user input, intent tags, slot data, and standard responses." The system provides annotation tools (such as manually selecting intent tags and filling in slot values). Example corpus:

[0107]

[0108] 2. Corpus Training and Update: After enterprises upload corpora, the system automatically uses the corpora to update the rule base of the intent recognition unit (such as adding a rule for "Where is it?" -> logistics tracking intent) and LLM fine-tuning (using Few-ShotPrompt for a small amount of corpus, and triggering a model fine-tuning task for a large amount of corpus).

[0109] Intent template library;

[0110] It is used to provide general intent templates (such as query, application, consultation, transfer to human agent), and enterprises can quickly create custom intents based on the templates without developing from scratch;

[0111] The technical implementation includes:

[0112] 1. Template Classification and Selection: Templates are provided according to industry classification (e.g., e-commerce templates include "order inquiry, refund application, after-sales complaint", and telecommunications templates include "package inquiry, data recharge, fault reporting"). After selecting a template, enterprises only need to configure "intent name, trigger keyword, and required slots".

[0113] 2. Custom slot configuration: Supports enterprises to add custom slots for intents (such as adding a "Product ID" slot to the "Request Refund" intent in e-commerce), and configure slot type (such as text, number, date), whether it is required, and validation rules (such as order number must match the `OD\d{8}` format);

[0114] 3. Intent priority configuration: Supports configuring intent priority (e.g., "transfer to human agent" intent has higher priority than "query order"). When the user input matches multiple intents at the same time (e.g., "I want to check the order, if it doesn't work, transfer to human agent"), the intent with the highest priority is selected for execution.

[0115] IV. Scenario-based adaptation strategy;

[0116] NLP modules need to adapt to the characteristics of different industries and different interaction scenarios. This embodiment takes "e-commerce after-sales service" and "telecommunications customer service" as two typical scenarios to illustrate the adaptation strategy:

[0117] 1. E-commerce after-sales scenario adaptation

[0118] Intent recognition adaptation: Used to add e-commerce exclusive intents such as "after-sales complaint", "exchange application" and "shipping insurance inquiry", and optimize the recognition rules of slots such as "order number" and "product ID" (such as supporting users to input non-standard formats such as "order123" and "item number 456");

[0119] RAG Knowledge Base Adaptation: This is used to focus on including content such as "refund policy", "logistics timeliness" and "after-sales process" in the knowledge base. When searching, it prioritizes matching dimensions such as "order number" and "product type" (e.g., the after-sales timeliness of fresh products is shorter than that of ordinary products, so a distinction needs to be made when searching).

[0120] Reply generation adaptation: Used to adopt a friendly style (such as ending with "Dear~" or "Hey"), and supports inserting rich text content such as order links and after-sales work order progress links to improve user operation convenience.

[0121] 2. Adaptation to communication customer service scenarios;

[0122] Intent recognition adaptation: Used to add communication-specific intents such as "package change", "data usage query", "fault reporting" and "phone bill recharge", and optimize the recognition rules of slots such as "phone number" and "package name" (such as supporting 11-digit phone numbers and terms such as "5G Enjoy Package");

[0123] RAG Knowledge Base Adaptation: This feature is used to collect key information such as "package rates", "data usage rules", and "troubleshooting steps" in the knowledge base. When searching, it prioritizes matching "mobile number location" and "package type" (e.g., different regions have different package rates).

[0124] Reply generation adaptation: Adopts a formal style (such as starting with "Hello", "Please"), supports inserting rich text such as phone bill images and data usage charts, and generates a "Click to Apply" button (such as a quick link for changing your plan).

[0125] This invention provides a LangGraph-based customer service system that solves the problem that the lack of process modeling and business processing capabilities in existing technologies leads to increased manual costs for user inquiries due to a lack of intelligence.

[0126] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A customer service system based on LangGraph, characterized in that, It includes an NLP module for implementing the language interaction hub function. The NLP module has the following functions: receiving natural language input from the user, including text input and speech-to-text input; linking the LangGraph process engine, knowledge base management module and enterprise business system; converting the user's fuzzy natural language into structured instructions that the platform can execute; and dynamically determining the dialogue direction based on LangGraph process node rules. Based on the knowledge base search results and business system data, natural language responses that conform to enterprise standards are generated to complete user inquiry responses and business operation execution.

2. The customer service system based on LangGraph according to claim 1, characterized in that, The NLP module features layered decoupling and plug-in extension capabilities, specifically including: a bottom-up construction of a basic capability layer, a core function layer, and an application adaptation layer. Each layer communicates with the other through standardized interfaces to ensure module reuse and expansion. The basic capability layer has the function of standardizing user input. The core function layer has the core logic processing functions of understanding user intent, managing dialogue state, and generating accurate responses. The application adaptation layer has the function of adapting to multiple industry scenarios and providing a low-code configuration entry point.

3. The LangGraph-based customer service system according to claim 2, characterized in that, The basic capability layer includes a unit with text preprocessing capabilities. Specific functions of this unit include: filtering noise data from user-input text, including special characters, meaningless interjections, and repeated characters, using regular expression matching; segmenting the text using an industry terminology dictionary to prevent industry terms from being split; and converting English input to lowercase and traditional Chinese input to simplified Chinese to achieve unified text formatting and provide standardized input for subsequent intent recognition and retrieval.

4. The LangGraph-based customer service system according to claim 2, characterized in that, The basic capability layer also includes a unit with speech-to-text adaptation function. The specific functions of this unit include: interfacing with multiple third-party ASR interfaces and selecting the currently used ASR interface through a configuration file; receiving voice files uploaded by users and automatically converting them into the voice format required by the ASR interface; performing semantic error correction on the ASR recognition results and implementing fuzzy matching correction based on an industry high-frequency word library to output accurate speech-to-text text.

5. The LangGraph-based customer service system according to claim 2, characterized in that, The basic capability layer also includes a unit with terminology management functions. The specific functions of this unit include: implementing multi-tenant terminology isolation management based on enterprise tenant ID, including storing industry-specific terms defined by different enterprises; automatically extracting high-frequency terms from business documents when adding or modifying them in the knowledge base management module; pushing the extracted high-frequency terms to the enterprise for review, and updating them to the terminology database after approval, providing terminology support for text preprocessing, intent recognition, and retrieval.

6. The LangGraph-based customer service system according to claim 2, characterized in that, The core functional layer includes a unit with intent recognition capabilities. Specific functions of this unit include: employing a hybrid recognition method combining rule-based recognition and LLM recognition; rapidly identifying high-frequency, standardized user intents through keyword matching and a rule base; classifying and extracting slots for fuzzy and complex user intents using LLM; determining the confidence level of the intent recognition results; triggering multiple rounds of follow-up questions when the confidence level falls below a set threshold; detecting whether the required slots for the intent are missing; and automatically generating follow-up question scripts if missing slots exist, until complete slot data is obtained, providing a basis for LangGraph process navigation.

7. The LangGraph-based customer service system according to claim 2, characterized in that, The core functional layer also includes a unit with dialogue state tracking capabilities. This unit's specific functions include: defining the dialogue state using JSON format, which includes a session identifier, user identifier, agent identifier, current intent, slot data, current process node, historical dialogue rounds, and session expiration time; storing the dialogue state in a cache database; updating the current intent and slot data based on intent recognition results after each dialogue round, updating the current process node based on the LangGraph process engine node execution results, and recording historical dialogue rounds; and loading the historical dialogue state when a user interrupts the session and re-initiates a request, reusing the already filled slot data if the session has not expired, and continuing the process from the current process node.

8. The LangGraph-based customer service system according to claim 2, characterized in that, The core functional layer includes a unit with RAG enhancement capabilities. The specific functions of this unit include: generating precise search queries based on the current intent and slot data in the dialogue state; calling a vectorization model to convert the search queries into vectors, calculating cosine similarity with the vectorized data in the knowledge base, and filtering results whose similarity meets a threshold; filtering the results by combining the knowledge base update time and associated agent identifiers, and reordering them according to similarity and update time weights; and inputting a portion of the sorted results as contextual knowledge into the LLM to generate precise responses that integrate knowledge base information, thus avoiding the illusion of LLM.

9. The LangGraph-based customer service system according to claim 2, characterized in that, The core functional layer includes a unit with response generation capabilities. Specific functions of this unit include: providing scenario-based response templates based on the current intent and current process node, including enterprise-customizable template styles; for complex scenarios, combining historical dialogue rounds and RAG search results to call LLM to generate personalized responses, and controlling the response length to adapt to different terminals; including multimodal output such as text and rich text, where the rich text includes order information tables, logistics progress image links, and business processing links to adapt to different dialogue scenario requirements.

10. The LangGraph-based customer service system according to claim 2, characterized in that, The application adaptation layer has industry adaptation and intent configuration functions, specifically including: providing a web-based visual interface through an industry corpus configuration center, allowing enterprises to upload and annotate industry-specific corpora in Excel and TXT formats, and using the corpora to update the intent recognition rule base and fine-tune the LLM; providing general intent templates categorized by industry through an intent template library, allowing enterprises to configure custom intent names, trigger keywords, and required slots based on the templates, customize slot types, required attributes, and validation rules, and configure the priority of different intents to adapt to business scenarios in multiple industries.