A human-computer interaction system based on an open source large model
By using an open-source large-scale human-computer interaction system, which utilizes context capture algorithms and semantic embedding models to identify intent, and combines dynamic token caching and interface unification mechanisms, the system solves the accuracy gap and interface binding problems of independent large-scale models, and achieves efficient and reliable human-computer interaction and intelligent agent management.
Patent Information
- Application Number
- CN202510819248.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Independently built large language models lag behind mainstream internet companies in terms of accuracy, and the problem of strong interface binding is difficult to solve.
Through a human-computer interaction system based on an open-source large model, the system uses a context interception algorithm and a semantic embedding classification model to identify intent. It combines a dynamic token caching mechanism and a labeled variable injection rule to unify heterogeneous platform interfaces. It uses an exponential backoff retry algorithm and a JSON path extraction function for response processing and maintains the dialogue state through a context closed-loop update and binding relationship mapping mechanism.
It achieves high-precision intent recognition and agent binding, unifies multi-platform interface access, ensures consistency of response semantics and state memory across round contexts, and improves the task understanding ability and response relevance of downstream large models.
Smart Images

Figure CN120706560B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of artificial intelligence, in particular to a man-machine interaction system based on an open source large model. BACKGROUND
[0002] At present, artificial intelligence develops rapidly, and each company builds an independent artificial intelligence large model to meet daily business needs. However, due to factors such as knowledge base, training effect or technology, the independent large language model may have a certain gap in accuracy compared with the large model of the current mainstream Internet company. Therefore, how to use the mature large model of a third-party platform as an intelligent supplement of the business system has become a pain point problem for many software development teams.
[0003] In order to solve this problem and avoid the problem of strong binding to the interface of a large model company, the method and device realize the interface configuration function of the third-party company through a flexible configuration mode, including account management, token management, space management, knowledge base management, agent management, interface management, order management, token management and other modules. These configuration functions realize the integration effect of the third intelligent platform to meet the deficiency of the local large model, and finally realize the man-machine interaction system. Therefore, a man-machine interaction system based on an open source large model is designed. SUMMARY
[0004] The application aims to provide a man-machine interaction system based on an open source large model to solve the problem that the independent large language model may have a gap in accuracy compared with the large model of the current mainstream Internet company due to factors such as knowledge base, training effect or technology.
[0005] To achieve the above-mentioned purpose, the application aims to provide a man-machine interaction system based on an open source large model, which comprises a user request unit. The user request unit receives user multi-round dialogue input based on a context interception algorithm and an intention recognition mechanism, generates context prompt words and target agent identifiers, and is used for extracting context content and determining the intention attribution.
[0006] A platform scheduling unit is configured. The platform scheduling unit dynamically configures platform authentication parameters according to the target agent identifier based on a dynamic token caching mechanism combined with a labeled variable injection rule, unifies the API structure of heterogeneous platforms and generates a standardized interface request.
[0007] A response processing unit is configured. The response processing unit receives the standardized request generated by the platform scheduling unit based on an exponential backoff retry algorithm and a JSON path extraction function, extracts target fields from a multi-layer nested structure, converts them into structured answers, and is used for realizing consistent extraction and standard output of data semantics.
[0008] The knowledge management and state maintenance unit updates each round of question and answer to the historical context based on a context closed-loop updating mechanism and a binding relationship mapping mechanism, constructs a continuously evolving dialogue state chain, and feeds back the updated context to the user request unit for constructing the next round of prompt words.
[0009] As a further improvement of the technical solution, the user request unit includes a user request receiving and preprocessing module and an agent selection and intent routing module.
[0010] The user request receiving and preprocessing module receives the user request u t and historical context information to construct a context prompt word P t for improving the accuracy of subsequent intent recognition.
[0011] Specifically, the last n rounds of dialogue are spliced into a context prompt word P t using a sliding window.
[0012] The agent selection and intent routing module converts the context prompt word P t input by the user into a semantic embedding vector x based on a semantic embedding and classification model, and finally outputs the target agent identifier b t .
[0013] As a further improvement of the technical solution, the semantic embedding and classification model outputs the target agent identifier b t involving the following specific steps:
[0014] Based on the language embedding model φ, the context prompt word P t is mapped to generate a semantic embedding vector x, and a classifier σ(Wx) is introduced to infer the semantic vector through a weight matrix W to obtain the intent category The corresponding target agent identifier b t is generated by the mapping function ψ.
[0015] As a further improvement of the technical solution, the platform scheduling unit includes a platform parameter scheduling module and an interface specification assembly module.
[0016] The platform parameter scheduling module analyzes the platform identifier p based on a dynamic token caching mechanism and according to the target agent identifier b t .
[0017] The buffer system extracts the platform token token p .
[0018] The interface specification assembly module injects the context prompt word P t and the platform token token p , and generates a standard API request structure by adapting the interface template through the tagged variable injection rule
[0019] As a further improvement of the technical solution, the standard API request structure is generated The specific steps involved are:
[0020] According to the platform identifier p, a cache key k is generated, and the platform token token p is stored to The tag #k is injected into the HTTP request header;
[0021] The context prompt word P t is bound as a fixed value to the parameter query of the API request body;
[0022] Based on the selected platform interface template and the variable mapping set , the cache value is injected into the template parameter using the tagged variable injection rule to construct a standard API request structure
[0023] As a further improvement of the technical solution, the response processing unit includes an interface execution and response module and a JSON response parsing module;
[0024] The interface execution and response module receives the standard API request structure generated by the interface assembly module initiates an HTTP request, and performs a retry operation using an exponential backoff retry algorithm when the request fails, until the platform response result R is returned, and outputs the original JSON response R;
[0025] The JSON response parsing module performs step-by-step field extraction based on the original JSON response R using a JSON path extraction function according to a predefined field path to obtain the final parsed value and as a structured answer, and returns a default value if the field path is missing.
[0026] As a further improvement of the technical solution, the knowledge management and state maintenance unit includes a response output module, a knowledge base management module, and an agent management module;
[0027] The response output module receives the structured answer based on the context closed-loop update mechanism, concatenates the current user request u t and the structured answer as a question and answer pair, and stores and updates the current question and answer pair into the historical context information
[0028] Updated historical context information Feedback is sent to the user request unit to generate the next round of prompts.
[0029] As a further improvement to this technical solution, the knowledge base management module retrieves the knowledge fragments most relevant to the semantics of the current user request based on the semantic vector matching mechanism, and integrates the retrieved knowledge fragments with the current prompt words by introducing a context-enhanced splicing strategy to construct enhanced prompt words, which are used to improve the task understanding ability and knowledge relevance of the downstream large model response generation, and at the same time improve the model's context understanding ability in vertical domain tasks.
[0030] The agent management module establishes the target agent identifier b based on a binding relationship mapping mechanism. t The mapping relationship with the knowledge base ID is output, and the binding relationship data is used to guide the intent routing module to call the corresponding knowledge context, so as to realize the association binding mechanism between the knowledge base and the agent.
[0031] As a further improvement to this technical solution, the specific steps involved in the knowledge base management module are as follows:
[0032] Preprocess the local knowledge document D to construct the embedding set K;
[0033] The user request receiving and preprocessing module generates the context prompt word P. t back;
[0034] By calculating the semantic vector q of the user request t Similarity calculation is performed with the embedding set K, and the most relevant knowledge fragment k is selected. * And the most relevant knowledge fragment k * With contextual cue word P t Combined to form enhanced prompts Enhanced prompts As input to the platform scheduling unit and response processing unit, it is used to improve the knowledge relevance of downstream response generation;
[0035] At the same time, enhance the prompt words. Based on the updated historical context of the response output module Extracting short-term and long-term clues h t They jointly participated in similarity retrieval.
[0036] As a further improvement to this technical solution, based on the aforementioned binding relationship mapping mechanism, a target intelligent agent identifier b is established. t The specific steps involved in mapping the relationship with the knowledge base ID are as follows:
[0037] The local knowledge document set is submitted to a third-party platform, preprocessing and index construction are completed through a knowledge base uploading interface, and a knowledge base identifier KBID is received t ;
[0038] The target intelligent agent identifier b t is mapped and bound with the knowledge base identifier KBID t , and a mapping relationship is generated
[0039] The mapping result is persisted in a system knowledge index database
[0040] When a user requests, the target intelligent agent identifier b t is parsed out through an intent routing module , and the corresponding knowledge base ID is retrieved according to the mapping function.
[0041] Compared with the prior art, the beneficial effects of the present application are:
[0042] 1. In a human-computer interaction system based on an open source large model, based on a context interception algorithm and a semantic embedding classification model, a user's multi-round dialogue is converted into a semantic prompt word, automatic target intelligent agent identifier mapping and intent attribution reasoning are completed, and high-precision request intent recognition and intelligent agent dynamic binding are realized.
[0043] At the same time, combined with a dynamic token caching mechanism and a labeled variable injection rule, a unified heterogeneous large model platform interface structure is constructed, a reusable standard API request template is constructed, and efficient scheduling and dynamic permission configuration of multi-platform access are realized.
[0044] 2. In a human-computer interaction system based on an open source large model, based on an exponential backoff retry algorithm and a JSON path extraction function, an automatic fault-tolerant request is retransmitted and a target field is accurately extracted from a nested response structure, and consistent extraction and standardized conversion of response semantics are realized.
[0045] And by introducing a context closed-loop update mechanism and a question and answer pair splicing strategy, an evolving dialogue chain is continuously constructed, structured results are dynamically fed back to an input module, and state memory and semantic coherence maintenance of cross-round context are realized.
[0046] 3. In a human-computer interaction system based on an open source large model, based on semantic vector matching and context enhancement splicing strategy, the most relevant knowledge fragments are retrieved from the bound knowledge base, and enhanced prompts are generated by fusing the current prompts, which significantly improves the understanding ability of downstream large models to tasks and the response relevance.
[0047] Further, through the structured cache system and template variable injection rules, safe mapping and runtime binding of the interface template and platform token are realized, and the system has good maintainability, scalability and security control ability. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1 The overall flowchart of the present application is shown.
[0049] The meanings of the various reference numbers in the figure are as follows:
[0050] 1, user request unit; 11, user request receiving and preprocessing module; 12, agent selection and intention routing module;
[0051] 2, platform scheduling unit; 21, platform parameter scheduling module; 22, interface specification assembly module;
[0052] 3, response processing unit; 31, interface execution and response module; 32, JSON response analysis module;
[0053] 4, knowledge management and state maintenance unit; 41, response output module; 42, knowledge base management module; 43, agent management module. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0055] Embodiment: Please refer to Figure 1 As shown, a human-computer interaction system based on an open source large model is provided, which includes a user request unit 1. The user request unit 1 receives user multi-round dialogue input based on a context interception algorithm and an intention recognition mechanism, generates a context prompt word and a target agent identifier, and is used to extract context content and determine its intention attribution.
[0056] The user request unit 1 includes a user request receiving and preprocessing module 11 and an agent selection and intention routing module 12.
[0057] The user request receiving and preprocessing module 11 receives a user request u t and historical context information to construct a context prompt word P t for improving the accuracy of subsequent intention recognition.
[0058] Specifically, the sliding window is used to intercept the last n rounds of dialogue to splice as the context prompt P t ;
[0059] The agent selection and intent routing module 12 converts the context prompt P t input by the user into a semantic embedding vector x based on a semantic embedding and classification model, and finally outputs a target agent identifier b t (wherein the target agent represents an intelligent service node (a model dedicated to a certain type of task; such as question answering, search, recommendation) selected according to the intent of the user request, responsible for accepting, understanding and processing the request of this round of dialogue, realizing dynamic calling of function modules and unified management of interfaces, the selection of the target agent is completed through the semantic embedding and classification model, which is the routing result after intent recognition, and the corresponding resources (such as authentication tokens, interface templates, knowledge base IDs, etc.) are dynamically scheduled based on the target agent identifier.
[0060] Further, the semantic embedding and classification model outputs a target agent identifier b t The specific steps involved are:
[0061] Based on the language embedding model φ, the context prompt P t is mapped to generate a semantic embedding vector x, and a classifier σ(Wx) is introduced to infer the semantic vector through a weight matrix W to obtain an intent category The corresponding target agent identifier b t is generated through the mapping function ψ.
[0062] In this embodiment,
[0063] The semantic embedding vector x = φ(P t );
[0064] The intent category is calculated through the classifier σ(Wx)
[0065] The target agent identifier is mapped through the mapping function ψ
[0066] In the formula, P t is the context prompt, which is spliced from the last n rounds of dialogue; φ(·) represents a language embedding model (such as a BERT model), which is used to map input text to a low-dimensional semantic embedding vector; x is a semantic embedding vector, representing the corresponding semantic embedding vector of the current context prompt P t , with a dimension of d; and W ∈ R m×d is the weight matrix of the intent classifier, where m is the number of intent categories and d is the embedding vector dimension; ψ(·) represents an intent-to-agent mapping function that maps the intent category to the corresponding target agent identifier; b trepresents the target agent identifier corresponding to the current request.
[0067] The open-source large model-based human-computer interaction system further includes a platform scheduling unit 2, which dynamically configures platform authentication parameters according to the target agent identifier based on a dynamic token caching mechanism combined with a labeled variable injection rule, unifies the API structures of heterogeneous platforms, and generates a standardized interface request;
[0068] Further, the platform scheduling unit 2 includes a platform parameter scheduling module 21 and an interface specification assembly module 22.
[0069] The platform parameter scheduling module 21 dynamically configures platform authentication parameters according to the target agent identifier b t parsing the platform identifier p;
[0070] Using a buffering system extracting the platform token token p :
[0071]
[0072] In the formula, represents a platform token buffering system for caching access tokens and authentication parameters of multiple third-party platforms; p token represents a token key corresponding to the target platform identifier p, used to retrieve the access token of the corresponding platform from the buffering system; token p represents the access token of the target platform p, used for subsequent API request authentication and permission verification; p represents the target agent identifier b t corresponding platform identifier, obtained by the platform parameter scheduling module;
[0073] The interface specification assembly module 22 adapts the interface template according to the context prompt word P t and the platform token token p , generates a standard API request structure
[0074] In this embodiment, the standard API request structure The specific steps involved are as follows:
[0075] According to the platform identifier p, a cache key k is generated, and the platform token token p is stored in The label #k is injected into the HTTP request header, where the generation of the cache key k satisfies: k = p+_token, p represents the platform, and _token represents a predefined suffix.
[0076] The context prompt word P tThe parameter `query` is bound as a fixed value to the API request body.
[0077] Based on the selected platform interface template and variable mapping set (where k) i This represents the field label key name in the template, v i This represents a label variable for a field in the template, in placeholder form, x j This represents each actual value to be injected (which includes runtime variables such as the access token value corresponding to the cache key, context prompt, target platform identifier, user ID, task parameters, and timestamp). This represents the set of all variable values to be injected (used to replace placeholders in the template). Using tagged variable injection rules, cached values (or fixed values) are injected into the template parameters to construct a standard API request structure.
[0078] In this embodiment, the interface specification assembly module 22 dynamically generates a complete API request structure based on a preset interface template and parameter reference variables. The rules for injecting tagged variables are as follows:
[0079] Buffer system Process interface templates one by one Each parameter item in the table consists of a key and a value.
[0080] When the parameter value v is detected i When it starts with a hash symbol (#) (e.g., #user) id The system recognizes it as a variable reference to the string following the hash symbol (#) (e.g., user). id () is the variable name;
[0081] Perform whitelist verification. (like The process will then be aborted and a safety exception will be returned, where x represents the original input variable name (extracted from the template parameter value). This represents the variable name whitelist, a pre-configured set of legal variable name whitelists used to limit the range of cached variables that are allowed to be accessed (it is dynamically configured through the management interface).
[0082] For identified variable references, from the caching system The function retrieves the actual value corresponding to the variable name.
[0083] Replace the variable reference placeholder in the template with the actual value found in the query (if the template value is #account and the cached account corresponds to A12345, then replace it with A12345);
[0084] When a parameter value does not begin with a hash symbol, it is considered a fixed constant and its original value is retained.
[0085] After the above processing, all parameter values are either replaced with actual variable values or retained as original constant values, ultimately generating a standard API request structure.
[0086] The human-computer interaction system based on the open-source large model also includes a response processing unit 3. The response processing unit 3 receives the standardized requests generated by the platform scheduling unit 2 based on the exponential backoff retry algorithm and the JSON path extraction function, and extracts the target fields from the multi-level nested structure, converts them into structured answers, and uses them to achieve consistent extraction of data semantics and standard output.
[0087] The response processing unit 3 includes an interface execution and response module 31 and a JSON response parsing module 32.
[0088] Specifically, the interface execution and response module 31 receives the standard API request structure generated by the interface assembly module. Initiate an HTTP request and, if the request fails, use an exponential backoff retry algorithm to perform a retry operation until a platform response result R is returned or the maximum number of retries N is reached, and output the original JSON response R;
[0089] In this embodiment, when the large model interface scheduled by platform scheduling unit 2 experiences an exception or response delay during the call process, the system introduces a retry mechanism based on the exponential backoff retry algorithm to ensure call stability; after successfully obtaining the response, the response content is parsed using a JSON path extraction function. Specifically, the exponential backoff retry algorithm is as follows:
[0090] If the initial waiting time is Δt0 and the maximum number of retries is N, then the delay for the i-th retrieval is Δt. i =Δt0·2 i ;
[0091] In the formula, i = 0, 1, 2, ..., N; Δt i This represents the delay for the i-th iteration;
[0092] If the call succeeds, the process terminates; otherwise, it retryes until the limit is reached.
[0093] The JSON response parsing module 32, based on the original JSON response R, uses a JSON path extraction function to extract the path based on the predefined field path p = [k1, ..., k m Perform step-by-step field extraction to obtain the final parsed value. And As a structured answer, if a field path is missing, a default value is returned. The JSON response parsing module 32 outputs the structured answer through the JSON path extraction function. for realizing the standardized output of response data;
[0094] In this embodiment, the JSON path extraction function is used to extract the JSON field value layer by layer according to the predefined JSON field path. Extraction of multi-layer nested JSON fields:
[0095]
[0096] In the formula, R represents the original JSON response object (usually a nested dictionary structure); represents a predefined JSON field path for extracting nested field values layer by layer; k m represents the m-th layer field key name, and represents the field name of the m-th layer in the nested level of JSON; represents the JSON path extraction function, which is used to extract the target value from the nested JSON structure according to the path accesses each layer of fields in turn until the target value is returned;
[0097] If the path does not exist, a default value (such as null or an empty string) is returned;
[0098] Based on the exponential backoff retry algorithm and the JSON path extraction function, the standardized request generated by the platform scheduling unit 2 is received, and the target field is extracted from the multi-layer nested structure and converted into a structured answer, which is used to realize the consistent extraction and standard output of data semantics. The multi-layer nested structure refers to the standardized JSON response body returned by the platform API interface, which contains multiple nested field levels. Specifically, it refers to the multi-layer hierarchical semantic result returned by the large model interface requested by the platform scheduling unit 2, which contains nested intent objects, entity labels, and answer candidate sets.
[0099] The open source large model-based human-computer interaction system further includes a knowledge management and state maintenance unit 4, which updates each round of question and answer to the historical context based on a context closed-loop update mechanism and a binding relationship mapping mechanism, constructs a continuously evolving dialogue state chain, and feeds back the updated context to the user request unit 1 for constructing the next round of prompt words.
[0100] The knowledge management and state maintenance unit 4 includes a response output module 41, a knowledge base management module 42, and an intelligent agent management module 43.
[0101] Specifically, the response output module 41 receives the structured answer based on the context closed-loop update mechanism, the current user request u t and the structured answer are concatenated into a question and answer pair The current question and answer pair is stored and the historical context information is updated
[0102] Updated historical context information Feedback is sent to user request unit 1 to generate prompts for the next round, supporting subsequent multiple rounds of dialogue and updating historical context information. Feedback is sent to the user request receiving and preprocessing module 11 to construct a closed loop of dialogue state, so as to build a continuously evolving dialogue state chain and maintain the coherence of contextual semantics.
[0103] Furthermore, the knowledge base management module 42 retrieves the knowledge fragments most relevant to the current user request semantics based on the semantic vector matching mechanism, and integrates the retrieved knowledge fragments with the current prompt words by introducing a context-enhanced splicing strategy to construct enhanced prompt words, which are used to improve the task understanding ability and knowledge relevance of the downstream large model response generation, and at the same time improve the model's context understanding ability in vertical domain tasks.
[0104] The agent management module 43 establishes a target agent identifier b based on a binding relationship mapping mechanism. t The mapping relationship with the knowledge base ID is output, and the binding relationship data is output (the binding relationship data refers to the data structure generated by the agent management module 43 that establishes the mapping relationship between the target agent identifier and the knowledge base identifier. It is essentially a key-value pair mapping table used to persistently store the association relationship between the agent and the knowledge base in the system). The agent management module 43 is used to guide the intent routing module 12 to call the corresponding knowledge context to realize the association binding mechanism between the knowledge base and the agent.
[0105] The logic for generating and binding knowledge base IDs is as follows:
[0106] Submit local knowledge document collections to third-party platforms via knowledge base upload interfaces (such as OpenAI) for vectorization, index building (by calling their open knowledge base upload interfaces to remotely register knowledge documents and build vector indexes) and hosting;
[0107] After the third-party platform successfully processes and creates the knowledge index, it returns a unique knowledge base identifier, namely the knowledge base ID.
[0108] The returned knowledge base ID is compared with the target agent identifier b, which is either preset or dynamically generated in the system. t Perform mapping and binding (by calling the knowledge base upload interface to synchronize the local knowledge base to the third-party platform and receiving the knowledge base identifier (i.e., knowledge base ID) returned by it, realize the mapping and binding between the agent and the knowledge base, and provide the source index of knowledge fragments for subsequent semantic enhancement prompt word generation).
[0109] Furthermore, the specific steps involved in the knowledge base management module 42 are as follows:
[0110] Preprocessing (including segmentation, vectorization) is performed on the local knowledge document D to construct an embedding set K;
[0111] Specifically, the local knowledge document D is segmented into several segments, and a knowledge embedding model (such as BERT) is used for vectorization to obtain the embedding set K;
[0112] The user request receiving and preprocessing module 11 generates a context prompt word P t ;
[0113] The similarity between the semantic vector q t =φ Q (u t ) of the user request and the embedding set K is calculated (the historical question and answer clues are introduced as auxiliary context when calculating the semantic vector similarity), the most relevant knowledge segment k * is selected, and the most relevant knowledge segment k * is concatenated with the context prompt word P t to form an enhanced prompt word The enhanced prompt word is used as the input of the platform scheduling unit 2 and the response processing unit 3 to improve the knowledge relevance of downstream response generation;
[0114] Specifically, the natural language request u t issued by the user at time t is semantically vectorized by the request encoder: q t =φ Q (u t ), where φ Q (·) represents the encoder for the request statement; u t represents the natural language request issued by the user at time t; q t represents the semantic vector of the user request, which is the semantic vector representation of the user request u t processed by the encoder at time t;
[0115] Further, the similarity between the semantic vector q t =φ Q (u t ) of the user request and the embedding set K is calculated by the cosine similarity algorithm.
[0116] The most relevant knowledge segment k is selected, where k * represents the most relevant knowledge segment (the best matching segment) selected from the knowledge base; argmax represents the parameter that makes the target function maximum (i.e., the most relevant segment); and d i ∈D, d irepresents the i-th knowledge document fragment from the knowledge base D, where D is the set of all knowledge fragments; φ D (d i ) represents the semantic vector (representation vector of the knowledge fragment) obtained after inputting the document fragment d i into the embedding model;
[0117] The essence of the context-enhanced splicing strategy is to splice the most relevant knowledge fragment k * and the context prompt word P t to form an enhanced prompt word
[0118] Wherein, the enhanced prompt word
[0119] In the formula, k * represents the most relevant knowledge fragment extracted from the bound knowledge base by the knowledge base management module; represents an enhanced prompt word used to improve the understanding ability of the large model for the current task;
[0120] At the same time, the enhanced prompt word is extracted from the updated historical context of the response output module 41 long-short-term prompt clues h t , and participates in similarity retrieval jointly.
[0121] In this embodiment, based on the binding relationship mapping mechanism, the mapping relationship between the target agent identifier b t and the knowledge base ID involves the following specific steps:
[0122] Submit the local knowledge document set to the third-party platform, complete preprocessing and index construction through the knowledge base upload interface, and receive the knowledge base identifier KBID t returned by the platform;
[0123] Map the target agent identifier b t and the knowledge base identifier KBID t to generate a mapping relationship represents the target agent identifier b t is converted into the corresponding knowledge base unique identifier KBID t through the mapping function ;
[0124] The mapping function
[0125] In the formula, represents the set of binding relationships maintained by the system (store all valid mappings), is the set of agent identifiers (finite discrete set), represents the knowledge base ID set (finite discrete set); k i represents the target knowledge base ID; represents null (invalid mapping return value, when the target agent identifier b t is not bound to a knowledge base, and
[0126] persist the mapping result to the system knowledge index database;
[0127] When the user requests, the target agent identifier b t is parsed out by the intent routing module 12, and the corresponding knowledge base ID is retrieved according to the mapping function ;
[0128] The knowledge base identifier KBID t is used by the knowledge base management module 42 to retrieve the most relevant knowledge fragment k * , and the context prompt word P t to construct the enhanced prompt word for the downstream module to call, which is used to guide the downstream platform scheduling and response generation, and the response result is written to the historical context information by the response output module and fed back to the user request unit 1 to support the next round of interaction, realizing the closed-loop evolution and continuous update of the knowledge context in the multi-round dialogue;
[0129] In this embodiment, there are multiple agents, such as weather query agent, news agent and smart contract agent;
[0130] The smart contract agent identifier is contract agent , which is bound to the knowledge base ID
[0131] When the intent routing module identifies contract agent , the corresponding knowledge base is automatically retrieved to obtain relevant knowledge for semantic enhancement;
[0132] The dynamic association between the agent and the knowledge base is realized, ensuring the modularization and precise calling of the multi-agent system knowledge management.
[0133] The basic principles, main features and advantages of the present application are shown and described above. Those skilled in the art should understand that the present application is not limited by the above embodiments, and the above embodiments and descriptions in the specification are only preferred examples of the present application and are not intended to limit the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the claimed present application.
Claims
1. An open-source large model-based human-computer interaction system, characterized in that: Comprising A user request unit (1) receives user multi-round dialogue input based on a context interception algorithm and an intent recognition mechanism, generates a context prompt word and a target agent identifier, and is used to extract context content and determine its intent attribution; A platform scheduling unit (2) dynamically configures platform authentication parameters according to the target agent identifier based on a dynamic token caching mechanism combined with a labeled variable injection rule, unifies the API structure of heterogeneous platforms and generates a standardized interface request; A response processing unit (3) receives the standardized request generated by the platform scheduling unit (2) based on an exponential backoff retry algorithm and a JSON path extraction function, extracts the target field from the multi-layer nested structure, and converts it into a structured answer; A knowledge management and state maintenance unit (4) updates each round of question and answer to the historical context based on a context closed loop update mechanism and a binding relationship mapping mechanism, constructs a continuously evolving dialogue state chain, and feeds back the updated context to the user request unit (1) for constructing the next round of prompt words.
2. The open-source large model-based human-computer interaction system according to claim 1, characterized in that: The user request unit (1) includes a user request receiving and preprocessing module (11) and an agent selection and intent routing module (12); wherein the user request receiving and pre-processing module (11) receives the user request u based on a contextual truncation algorithm t with historical contextual information constructing a contextual cue P t ; The intelligent agent selection and intent routing module (12) converts the context cue P t into a semantic embedding vector x, and finally outputs the target intelligent agent identification b t .
3. The open-source large model-based human-computer interaction system according to claim 2, characterized in that: The semantic embedding is input into a classification model to output a target agent identifier b t The specific steps involved are: Based on the language embedding model, the context prompt word P t The mapping generates a semantic embedding vector x, and introduces a classifier σ(Wx) to infer the semantic vector through a weight matrix W to obtain an intent category The corresponding target agent identifier b is generated through the mapping function ψ t .
4. The open-source large model based human-computer interaction system according to claim 1, characterized in that: The platform scheduling unit (2) includes a platform parameter scheduling module (21) and an interface specification assembly module (22); The platform parameter scheduling module (21) is configured to schedule the platform parameters based on a dynamic token caching mechanism and according to a target agent identifier b t Resolve the platform identifier p; Employing a buffer system Extracting a platform token token p ; The interface specification assembly module (22) adapts the interface template according to the context cue P t and the platform token token p by tagging variable injection rules, generating a standard API request structure 5. The open-source large model-based human-computer interaction system according to claim 4, characterized in that: Generating a standard API request structure The specific steps involved are: Generate cache key k from platform identifier p, store platform token token p to Inject tag #k into HTTP request header; Contextual cue word P t a parameter query bound to the API request body as a fixed value; Based on the selected platform interface template and variable mapping set Injecting the cache value into the template parameter by using the tagged variable injection rule to construct a standard API request structure 6. The open-source large model based human-computer interaction system according to claim 1, characterized in that: The response processing unit (3) includes an interface execution and response module (31) and a JSON response analysis module (32); The interface executes the standard API request structure generated by the interface assembly module with the response module (31) Initiate an HTTP request, and perform a retry operation using an exponential backoff retry algorithm when the request fails until a platform response result R is returned, and output the original JSON response R; The JSON response parsing module (32) performs step-by-step field extraction according to a predefined field path based on the original JSON response R, using a JSON path extraction function, to obtain a final parsed value and returns a default value as a structured answer if the field path is missing.
7. The open-source large model based human-computer interaction system according to claim 1, characterized in that: The knowledge management and state maintenance unit (4) includes a response output module (41), a knowledge base management module (42), and an agent management module (43); Wherein, the response output module (41) receives structured answers Based on the context closed loop updating mechanism, the current user request u t With structured answers Spliced into question and answer pairs, the current question and answer pair is stored and the historical context information is updated updated historical context information The feedback to the user request unit (1) is used to generate the next round of cues.
8. The open-source large model-based human-computer interaction system according to claim 7, characterized in that: The knowledge base management module (42) retrieves the most relevant knowledge fragments based on a semantic vector matching mechanism, and fuses the retrieved knowledge fragments with the current prompt word by introducing a context enhancement splicing strategy to construct an enhanced prompt word; The intelligent agent management module (43) establishes the target intelligent agent identifier b t The mapping relationship with the knowledge base ID, and outputs the binding relationship data.
9. The open-source large model based human-computer interaction system according to claim 7, characterized in that: The specific steps involved in the knowledge base management module (42) are: Preprocess the local knowledge document D to construct an embedding set K; At the user request receiving and pre-processing module (11) generates the contextual cue P t later; By calculating the user request semantic vector q t Similarity calculation is performed with the embedded set K, and the most relevant knowledge fragment k is selected * The most relevant knowledge fragment k * Is combined with the context prompt word P t To form an enhanced prompt word At the same time, the prompt word is enhanced According to the updated history context of the response output module (41) The long and short term prompt clues h are extracted t Jointly participate in similarity retrieval.
10. The open-source large model based human-computer interaction system according to claim 7, characterized in that: Based on the binding relationship mapping mechanism, the target agent identifier b is established t The mapping relationship with the knowledge base ID involves the following specific steps: submitting the local knowledge document set to a third-party platform, completing preprocessing and index construction through a knowledge base uploading interface, and receiving a knowledge base identifier KBID returned by the platform t ; Identify the target agent b t With the knowledge base identifier KBID t Mapping binding is performed to generate a mapping relationship Persist the mapping result in the system knowledge index database; When the user requests, the target agent identifier b is parsed by the intention routing module (12) t , and the corresponding knowledge base ID is retrieved according to the mapping function .
Citation Information
Patent Citations
Large model deployment method, device and equipment for heterogeneous platform and program product
CN119415277A
Generation and operation of artificial intelligence based conversation systems
US20210407504A1