Intelligent customer service knowledge base construction method and system based on independent station content
By using an automated pipeline to pull page content from independent websites, stripping tags to generate documents, and storing them quantitatively in a database, the problems of high construction costs, content disconnect, and multi-language maintenance of intelligent customer service knowledge bases have been solved, achieving automated construction and multi-language support of the knowledge base.
Patent Information
- Application Number
- CN202611411565.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-11-27
AI Technical Summary
Existing intelligent customer service knowledge bases suffer from high construction costs, disconnect from website content, lack of synchronization guarantee mechanisms, and significantly increased maintenance costs for multiple languages.
The system retrieves page content from independent websites through an automated pipeline, removes tags to generate documents, vectorizes them and stores them in a database, and performs failure detection and multi-level search responses, supporting multiple languages.
It enables automated construction and maintenance of the knowledge base, ensuring content consistency, reducing labor costs, and improving data integrity and the efficiency of multilingual responses.
Smart Images

Figure CN123180301A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and e-commerce technology, and in particular to a method and system for constructing an intelligent customer service knowledge base based on independent website content. Background Technology
[0002] With the development of cross-border e-commerce, a large number of foreign trade enterprises are showcasing their products and services to overseas customers through independent websites (self-built e-commerce websites). To respond to visitor inquiries in a timely manner, intelligent customer service systems are widely used in independent website scenarios, and the quality of their responses largely depends on the completeness and accuracy of their knowledge base.
[0003] In existing technologies, intelligent customer service knowledge bases typically rely on manual construction: company personnel manually compile product information, company introductions, transaction policies, etc., and enter them item by item into the customer service system's knowledge base, or write fixed question-and-answer pairs. This method has the following drawbacks: (1) High cost of building a knowledge base. The independent websites of foreign trade enterprises usually contain dozens to thousands of product pages and multiple information columns. Manually sorting and entering information page by page is inefficient and difficult to maintain continuously; (2) The knowledge base is disconnected from the website content. After the independent website content is updated, the knowledge base cannot be updated synchronously, resulting in inconsistencies between customer service answers and the actual information on the website, such as outdated product parameters and incorrect contact information, which affects the conversion of inquiries; (3) Lack of reliable synchronization guarantee mechanism. Existing automatic synchronization solutions lack data integrity verification during batch data entry. Anomalies such as page content retrieval failure, duplicate data entry, and partial data entry failure are difficult to detect, resulting in some knowledge gaps that are unknown to operations personnel. (4) The maintenance cost increases exponentially in multilingual scenarios. When dealing with visitors from multiple countries, if knowledge bases are built separately for each language, the maintenance workload increases exponentially.
[0004] Therefore, there is a need for an intelligent customer service knowledge base construction solution that can automatically build a knowledge base from independent website content, ensure synchronization integrity and accuracy, and support multilingual responses. Summary of the Invention
[0005] The technical problem to be solved by this invention is: how to reduce the construction and maintenance cost of intelligent customer service knowledge base, ensure the consistency and integrity of the knowledge base and independent website content, and support multilingual answers with a single language knowledge base in multilingual scenarios.
[0006] To address the aforementioned technical problems, the first aspect of this invention provides a method for automatically constructing an intelligent customer service knowledge base based on independent website content, comprising: retrieving page content of corresponding categories from an independent website associated with the intelligent customer service system according to preset category types, wherein the category types include products, news, about us, contact us, and industry knowledge; stripping markup language tags from the page content to extract plain text content and generating learning documents; generating learning tasks for each learning document and storing them in a task queue; scheduling the task queue according to a preset period, executing the learning tasks sequentially according to the queue order, and switching to parallel execution when the number of tasks to be executed exceeds a preset threshold; each learning task... For each document to be learned, during execution, the corresponding document is vectorized one by one and stored in the vector database, and failure detection is performed, including comparing the actual number of documents entered into the database with the total number returned by the data source. If the two are inconsistent, it is determined as incomplete entry into the database. Timeout exceptions, error exceptions, and uniqueness conflict exceptions are captured. If there are documents to be learned that have not been successfully entered into the learning task, the task is determined to be failed. The error information of the failed task is recorded for re-execution. Documents that have been successfully entered into the vector database are retained. Documents that have been successfully entered into the vector database are marked as embedded. Documents that have not been embedded are not included in the search and answer. In response to visitor questions, answers are retrieved and generated according to the preset knowledge source priority.
[0007] Optionally, upon initial activation, a full fetch is performed in response to an update fetch operation. Subsequently, incremental synchronization and relearning are automatically triggered in response to the addition, deletion, or modification of documents on the independent website.
[0008] Optionally, the task queue includes two task types: document retrieval tasks and AI learning tasks, forming a two-stage pipeline.
[0009] Optionally, the task status of each learning task includes three states: in progress, success, and failure. For failed learning tasks, the task type, document type, number of retries, and error information are recorded for review and re-execution.
[0010] Optionally, English text is stored in the vector database, and corresponding language content is generated based on the visitor's language when responding.
[0011] Optionally, the knowledge source priority is as follows: AI database content is written into prompt words, followed by similarity search of the speech database, and finally vector similarity search of the document database.
[0012] Optionally, in response to the document initialization operation, the page content of the independent website is retrieved again, and the re-retrieved page content is used to overwrite the corresponding learned documents; and, a batch reset entry for failed tasks is provided, in response to the batch reset operation, all failed tasks are added back to the task queue.
[0013] A second aspect of the present invention provides a system for automatically constructing an intelligent customer service knowledge base based on independent website content, including a document retrieval module, a document processing module, a task scheduling module, a vector storage module, a failure detection module, and a retrieval and answer module, each module being used to implement the above method.
[0014] Compared with the prior art, the present invention has the following beneficial effects: (1) Automated knowledge base construction: The knowledge base is constructed through an automated pipeline of categorized page retrieval, tag stripping and vectorized data entry, eliminating the need for manual page-by-page organization and data entry. Furthermore, the addition, deletion and modification of documents on the independent website automatically triggers incremental synchronization and relearning, ensuring that the content of the knowledge base is consistent with the actual content of the independent website. (2) Data integrity and quality assurance: By comparing the actual number of data entries with the total number returned by the data source and capturing stored procedure anomalies, the hidden anomaly of partial data entry failure is transformed into an explicit, detectable, and retryable failure state, thus preventing incomplete data from being used as complete knowledge for retrieval. (3) Knowledge retention for failed tasks: When a learning task fails, the documents that have been successfully stored in the vector database in the task are retained in the embedded state without being rolled back, so as to avoid the loss of effective knowledge already stored in the database; the documents that have not been successfully stored are marked as not embedded and do not participate in the retrieval answer, so as to prevent incomplete knowledge from entering the answer and causing incorrect answers. (4) Balancing write stability and throughput: Learning tasks are executed serially according to the queue order to reduce the risk of conflict when writing to the vector database concurrently and ensure write stability; when the backlog of tasks exceeds the threshold, it switches to parallel execution to improve the overall throughput of batch tasks. (5) Multilingual support with controllable costs: The vector database is stored in a single English language. When answering, the corresponding language content is generated according to the language used by the visitor, avoiding the storage and maintenance costs caused by repeatedly building databases by language. (6) Multi-level retrieval reduces retrieval overhead: When generating answers, the content of the AI database is written into prompt words, the dialogue database is prioritized for similarity retrieval, and the document database is only used for vector similarity retrieval when no match is found. When the dialogue database is matched, there is no need to access the vector database, reducing the number of vector retrievals, and taking into account the consistency of corporate image, the accuracy of high-frequency questions and the coverage of long-tail questions. Attached Figure Description
[0015] Figure 1 A flowchart illustrating the method for automatically constructing an intelligent customer service knowledge base based on independent website content, as provided in this embodiment of the invention;
[0016] Figure 2 The structural framework of the intelligent customer service knowledge base construction system provided in the embodiments of the present invention;
[0017] Figure 3This is a schematic diagram of the interface for monitoring the status of learning tasks and handling failures, provided in an embodiment of the present invention. Detailed Implementation
[0018] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0019] Example 1: Automatic knowledge base construction method.
[0020] like Figure 1 As shown in the figure, this embodiment provides a method for automatically building an intelligent customer service knowledge base based on independent website content, which is applied to an intelligent customer service system. This system is associated with the independent website of a foreign trade enterprise, and specifically includes the following steps: Step S1: Page Content Retrieval. Page content for the corresponding category is retrieved from the independent website according to preset category types. Category types include: Product, News, About Us, Contact Us, and Knowledge. The retrieved content includes the HTML source content of the page; for example, under the Product category, the complete HTML content of each product details page is retrieved. In this embodiment, when the intelligent customer service system is first activated, the operations staff triggers an update retrieval operation to retrieve all page content from the independent website for the first time. Subsequently, when documents are added, deleted, or modified on the independent website, the system automatically detects the changes and triggers incremental synchronization of the corresponding documents without manual intervention.
[0021] Step S2, Documentation Processing. The HTML tags of the retrieved page content are stripped, retaining only the text content to generate a learning document. A corresponding learning document is generated for each page, and the document is associated with its category type, source page title, and address. Furthermore, in response to the document initialization operation, the page content of the independent website is retrieved again, and the corresponding learned document is overwritten with the re-retrieved page content. This is used for data correction when inconsistencies are found between the document and the independent website content. If the operators have customized and modified some content in the document, the initial overwrite will reset it with the site data; therefore, this operation is guided to be performed with caution using a confirmation prompt.
[0022] Step S3: Task queue generation. The task queue includes two types of tasks: document retrieval tasks, used to retrieve page content from the independent website; and AI learning tasks, used to vectorize the retrieved text content and store it in a vector database. The AI learning task is triggered after the corresponding document retrieval task is successfully executed. If the document retrieval task fails to locate the independent website's information during execution, the task is considered to have failed and error information such as "site not found" is recorded.
[0023] Step S4, Task Scheduling. The system schedules the task queue according to a preset period (one hour in this embodiment). The learning tasks in the task queue are executed serially one by one according to the queue order. That is, the learning tasks of all customer sites and the learning tasks within the same customer site are processed serially. When there are many tasks to be executed and they are not completed within a single scheduling period, the remaining tasks are switched to parallel execution after the start of the next scheduling period to ensure the overall throughput.
[0024] Step S5: Vectorization and Status Labeling. For each AI learning task, the English text of the document to be learned is vectorized and stored in the vector database. Documents successfully stored in the vector database are marked as embedded; documents that fail to be stored due to errors are marked as not embedded. Documents not marked as embedded will not participate in the intelligent customer service's retrieval and response.
[0025] Step S6, Failure Detection. Each learning task corresponds to at least one document to be learned. For example, a batch embedding under a certain category corresponds to 100 documents. When executing a learning task, the corresponding documents to be learned are vectorized one by one and stored in the vector database. Failure detection is performed during the execution process, including: (a) Incomplete storage detection: compare the actual number of entries stored with the total number returned by the data source interface. If the two are inconsistent, it is determined that the storage is incomplete. For example, if the source returns a total of 632 entries for a certain product category, and the actual number of entries stored is 718, the inconsistency indicates incomplete storage; (b) Anomaly detection: capture timeout anomalies, error anomalies, and unique key conflict anomalies (such as duplicate addition of the same problem key value) during the vectorization storage process. All of the above anomalies are classified as unsuccessful storage; (c) Document change detection: when a document is detected to have been modified, mark the document as modified and relearn it, triggering the document to be relearned. When a learning task contains documents that failed to be successfully stored, the entire task is considered a failure and set to a failed state. The task type, document type, task status, number of retries, and error information are recorded. At this time, the documents successfully stored in the task are retained in the vector database and marked as embedded, while the documents that failed to be stored are marked as not embedded. For example, if a learning task corresponds to 100 documents, and 90 are successfully stored, while the rest failed due to timeouts, errors, or uniqueness conflicts, the task is considered an embedding failure, and the 90 already stored documents are retained. A single-task retry operation re-adds the corresponding task to the queue, and a reset operation for all failed tasks re-adds all failed tasks to the queue in batches. Task status includes three types: in progress, successful, and failed.
[0026] Step S7, Multi-level retrieval and answering. Responding to visitor questions, answers are generated according to preset knowledge source priorities: Level 1, AI database, including AI persona, company advantages, and transaction / shipping information. This content is written as prompts for each question, serving as background constraints for the answer; Level 2, script database, where a similarity search is performed on each question. The script database includes public and private script databases, with standard question formats and script content participating in learning. When a match is found, an answer is generated based on the script content; Level 3, document database, i.e., vector database. When the script database cannot provide a response, a vector similarity search is performed, and an answer is generated based on the retrieved document content.
[0027] The vector database stores only English text. When responding, the visitor's language is determined based on their browser language and the language of their message. AI then translates the content generated from the English search results into the corresponding language, thus supporting multilingual responses with a single-language knowledge base.
[0028] Step S8, Contact Information Disclosure Control. The disclosure status of contact information (such as phone number, email, instant messaging account) in the AI database is controlled by an on / off switch, which controls whether it participates in learning and whether it is displayed in the answers, in order to meet the enterprise's management needs for the scope of contact information disclosure.
[0029] Example 2: Knowledge Base Construction System.
[0030] like Figure 2 As shown, this embodiment provides a system for automatically building an intelligent customer service knowledge base based on independent website content, including: a document retrieval module 101, used to retrieve page content of corresponding columns from the independent website according to preset column types; a document processing module 102, used to remove HTML tags, extract plain text, and generate learning documents; a task scheduling module 103, used to generate learning tasks and store them in a task queue, schedule them according to a preset period, and execute the learning tasks serially according to the queue order (serially between different customer sites and within the same customer site), and switch to parallel execution when the task backlog exceeds a threshold; a vector storage module 104, used to vectorize the learning documents and store them in a vector database 300, and mark them as embedded or not embedded; a failure detection module 105, used to perform incomplete database entry detection, uniqueness conflict detection, and document change detection, and record the error information of failed tasks for retry; and a retrieval and answer module 106, used to respond to visitor questions, retrieve and generate multilingual answers according to the priority of the AI database, the script database, and the document database. The specific working process of the above modules is the same as the corresponding steps in Embodiment 1, and will not be repeated here.
[0031] like Figure 3As shown, the system provides a task status monitoring interface, displaying task type (AI learning / document retrieval), document type (faq, product, contact, news, knowledge, about-us, etc.), task status (success / failure / in progress), number of retries, and error information. It also provides entry points for single task retry and batch reset of failed tasks, enabling operations personnel to intuitively grasp the progress of knowledge base construction and abnormal situations.
[0032] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for automatically constructing an intelligent customer service knowledge base based on independent website content, characterized in that, include: According to the preset column types, the system retrieves the page content of the corresponding column from the independent website associated with the intelligent customer service system. The column types include products, news, about us, contact us and industry knowledge. The markup language tags in the page content are stripped to extract the plain text content and generate a learning document corresponding to the independent website. A learning task is generated for each document to be learned and stored in a task queue. The learning task is used to instruct the corresponding document to be learned to be vectorized and stored in a vector database. The task queue is scheduled according to a preset period, and the learning tasks are executed serially one by one according to the queue order. When the number of tasks to be executed exceeds a preset threshold, parallel execution is switched. Each learning task corresponds to at least one document to be learned. During the execution of each learning task, the corresponding document to be learned is vectorized one by one and stored in the vector database. Failure detection is performed, including: comparing the actual number of entries into the database with the total number returned by the data source. If the two are inconsistent, it is determined that the entries are not fully entered into the database. Capture the vectorization storage process. Timeout exceptions, error reports, and uniqueness conflict exceptions are handled. When a learning task contains a document that fails to be successfully stored in the vector database, the learning task is deemed a failure, the corresponding error information is recorded, and the task is marked as failed for re-execution. Documents that have been successfully stored in the vector database are retained and marked as embedded, while documents that failed to be stored are marked as not embedded. Documents that have been successfully stored in the vector database are marked as embedded, and documents not marked as embedded do not participate in the intelligent customer service's retrieval and response. In response to a visitor's question, a search is performed according to a preset knowledge source priority, and an answer is generated based on the search results.
2. The method according to claim 1, characterized in that, The step of retrieving page content from the independent website according to the preset column type includes: when the intelligent customer service system is first activated, retrieving the full page content from the independent website in response to the update acquisition operation; and after the first retrieval, in response to the addition, deletion or modification of documents on the independent website, automatically triggering the incremental synchronization of the corresponding documents, and re-executing the learning task for the changed documents.
3. The method according to claim 1, characterized in that, The task queue includes two types of tasks: document retrieval tasks and AI learning tasks. The document retrieval task is used to retrieve page content from the independent website, and the AI learning task is used to process the retrieved page content, vectorize it, and store it in the vector database. The AI learning task is triggered after the corresponding document retrieval task is successfully executed.
4. The method according to claim 3, characterized in that, The failure detection also includes: if the site information of the independent site is not located when the document retrieval task is executed, the document retrieval task is determined to have failed; each task records the number of retries, and in response to the retry operation, the corresponding task is added back to the task queue for execution.
5. The method according to claim 1, characterized in that, The step of executing learning tasks sequentially according to the queue order includes: executing learning tasks sequentially between different customer sites, and also executing learning tasks within the same customer site sequentially.
6. The method according to claim 1, characterized in that, Each learning task has three states: in progress, successful, and failed. For failed learning tasks, the task type, document type, number of retries, and error information are recorded for review and re-execution.
7. The method according to claim 1, characterized in that, The text stored in the vector database is in English; the step of generating a response based on the search results includes: translating the search results obtained from the English text into the corresponding language according to the language used by the visitor, wherein the language used by the visitor is determined according to the visitor's browser language and the language of the message sent by the visitor.
8. The method according to claim 1, characterized in that, The preset knowledge source priority includes three levels: AI database, script database, and document database. When generating an answer, the enterprise information content in the AI database is written into the prompt words. The script database is used for similarity search first, and if a match is found, an answer is generated based on the content of the script database. If no match is found, the document database, i.e., the vector database, is used for vector similarity search, and an answer is generated based on the content of the retrieved document.
9. The method according to claim 8, characterized in that, The enterprise information in the AI database includes AI persona, enterprise advantages, and transaction and delivery information; the script database includes a public script database and a private script database, and the scripts in the script database participate in the learning of the intelligent customer service after being added.
10. The method according to claim 1, characterized in that, Also includes: In response to the document initialization operation, the page content of the independent website is fetched again and the fetched results are overwritten with the corresponding learned documents; Additionally, it provides a batch reset entry for failed tasks, and in response to the batch reset operation, adds all failed tasks back to the task queue.
11. The method according to claim 8, characterized in that, The disclosure status of contact information in the AI database is controlled by a switch, which controls whether the contact information participates in learning and whether it is displayed in the answers.
12. A system for automatically constructing an intelligent customer service knowledge base based on independent website content, characterized in that, include: The document retrieval module is used to retrieve page content of corresponding columns from the independent website associated with the intelligent customer service system according to preset column types. The column types include products, news, about us, contact us and industry knowledge. The document processing module is used to strip the markup language tags from the page content, extract the plain text content, and generate a document to be learned. The task scheduling module is used to generate learning tasks for each document to be learned and store them in a task queue, schedule the task queue according to a preset period, execute the learning tasks one by one in the queue order, and switch to parallel execution when the number of tasks to be executed exceeds a preset threshold; the vector storage module is used to vectorize each document to be learned and store it in a vector database, and mark the embedded state or the non-embedded state. The failure detection module is used to compare the actual number of entries into the database with the total number returned by the data source. If the two are inconsistent, it is determined that the entries are incomplete. It captures timeout exceptions, error exceptions, and uniqueness conflict exceptions. When there are unsuccessfully stored documents in the learning task, the learning task is determined to be a failure, and the error information is recorded for re-execution. The successfully stored documents are retained in the vector database. The search and answer module is used to respond to visitors' questions by searching according to the preset knowledge source priority and generating answers based on the search results. Documents not marked as embedded are not included in the search.
