Search

CN-122004864-A - Continuous cognition construction method and system of mental health intelligent agent

CN122004864ACN 122004864 ACN122004864 ACN 122004864ACN-122004864-A

Abstract

The application relates to the technical field of mental health and discloses a continuous cognition construction method and system of a mental health agent. The method comprises the steps of extracting portrait features from current period dialogue data according to preset trigger frequency and combining the portrait features with psychological portrait data of preset dimensionality to achieve gradual updating, carrying out risk classification and split-flow storage on new semantic segment data to generate historical memory data, carrying out recall right judgment on limited recall semantic segments based on preset recall rules to determine a recall semantic segment range, obtaining candidate semantic segments under a retrieval mechanism of hot storage priority and cold storage rollback, carrying out multidimensional scoring and maximum marginal correlation reordering through configurable weight parameters to obtain target semantic segments, and constructing continuous cognitive results of a psychological health intelligent body on target users based on the updated psychological portrait data and the target semantic segments. The method improves the accuracy, safety and consistency of the continuous cognition of the mental health intelligent agent.

Inventors

  • ZHU NINGXIN
  • LI CHEN

Assignees

  • 深圳市健成星云科技有限公司

Dates

Publication Date
20260512
Application Date
20260416

Claims (10)

  1. 1. A method for continuous cognitive construction of a mental health agent, comprising: Extracting portrait characteristic data in parallel from the current period dialogue data of a target user according to a preset trigger frequency, merging the extraction result to psychological portrait data with preset dimensionality according to a preset merging strategy, and progressively updating the psychological portrait data; Performing risk classification on new semantic segment data extracted from the current period dialogue data according to a preset risk classification rule, and performing split-flow storage on the new semantic segment data with different risk classes according to a preset writing rule to generate historical memory data; Executing recall authority judgment on the semantic segment data limited to be recalled in the historical memory data based on a preset recall rule, and determining a semantic segment data range which can be recalled according to an authority judgment result, wherein the preset recall rule comprises keyword hit judgment and semantic similarity judgment based on a preset semantic similarity threshold; according to the recallable semantic segment data range, memory retrieval is carried out from the historical memory data to obtain candidate semantic segment data, the memory retrieval is firstly carried out based on a hot storage path, and when the hot storage path is not hit, the memory retrieval is carried out back to a cold storage path; Performing multidimensional scoring and maximum marginal correlation reordering on the candidate semantic segment data through configurable weight parameters so as to screen and obtain target semantic segment data; And constructing a continuous cognitive result of the mental health intelligent agent on the target user based on the updated mental portrait data and the target semantic segment data.
  2. 2. The continuous cognitive constructing method of a mental health agent according to claim 1, wherein the step of extracting portraits feature data in parallel from the current periodic dialogue data of the target user according to a preset trigger frequency, merging the extracted results to mental portraits data of a preset dimension according to a preset merging strategy, so as to progressively update the mental portraits data comprises: When the dialogue turn corresponding to the current period dialogue data reaches a first preset trigger turn, extracting event-level portrait feature data from the current period dialogue data; When the dialogue turn corresponding to the current period dialogue data reaches a second preset trigger turn, extracting event-level portrait characteristic data and dynamic-level portrait characteristic data from the current period dialogue data; When the dialogue turn corresponding to the current period dialogue data reaches a third preset trigger turn, extracting event-level portrait characteristic data, dynamic-level portrait characteristic data and stable-level portrait characteristic data from the current period dialogue data; and merging the event-level portrait characteristic data, the dynamic-level portrait characteristic data and the stable-level portrait characteristic data into the psychological portrait data according to the preset merging strategy.
  3. 3. The continuous cognitive constructing method of a mental health agent as claimed in claim 1, wherein before the step of risk classifying new semantic segment data extracted from the current period dialogue data according to a preset risk classification rule, further comprising: When the dialogue turn corresponding to the current period dialogue data reaches a preset milestone turn, extracting new semantic fragment data from the current period dialogue data; The new semantic segment data comprises title information, content information, abstract information, context information, risk level information and information level information; the new semantic segment data is reserved and judged, and when the judgment result is skipped and the current period dialogue data contains first person preference expression, a preference memory special path is triggered to write the new semantic segment data into preference memory; and generating a semantic feature vector for semantic similarity retrieval according to the abstract information, and storing the new semantic segment data and the semantic feature vector into a vector database.
  4. 4. The continuous cognitive constructing method of a mental health agent according to claim 1, wherein the step of performing risk classification on new semantic segment data extracted from the current period dialogue data according to a preset risk classification rule and performing split-flow storage on the new semantic segment data of different risk classes according to a preset writing rule to generate history memory data comprises the steps of: according to the preset risk classification rule, performing risk classification judgment on the new semantic segment data to divide the new semantic segment data into first risk classification semantic segment data, second risk classification semantic segment data and third risk classification semantic segment data; Writing the first risk level semantic segment data and the second risk level semantic segment data into a hot memory list according to the preset writing rule, wherein the hot memory list is in default participation in memory recall; Writing the third risk level semantic segment data into an independent secondary injury list according to the preset writing rule, wherein the independent secondary injury list is not participated in memory recall by default; the historic memory data is generated based on the thermal memory list and the independent secondary injury list.
  5. 5. The continuous cognitive constructing method of a mental health agent according to claim 1, wherein the step of performing recall authority determination on the semantic segment data limited to recall in the history memory data based on a preset recall rule, and determining a range of semantic segment data that can be recalled according to the authority determination result, wherein the preset recall rule includes keyword hit determination and semantic similarity determination based on a preset semantic similarity threshold, comprises: Based on the current memory recall request, carrying out keyword hit judgment on the semantic segment data of the limited recall to obtain first semantic segment data hit by keywords; Carrying out semantic similarity judgment on the semantic segment data of the limited recall of the missed keywords to generate a memory recall request vector corresponding to the current memory recall request; performing similarity comparison on the memory recall request vector and a predefined trauma inquiry template vector to obtain second semantic segment data with semantic similarity not smaller than the preset semantic similarity threshold; And determining the recall semantic fragment data range according to the first semantic fragment data and the second semantic fragment data.
  6. 6. The method of claim 5, wherein after the step of similarity comparing the memory recall request vector with a predefined trauma challenge template vector, further comprising: when the similarity comparison miss semantic fragment data of the limited recall exists, inputting a current memory recall request into a large language model to carry out intention judgment, and obtaining an intention judgment result; And when the intention judgment result represents that the current memory recall request contains a preset wound overtaking intention, adding the similarity comparison missed semantic fragment data limited to the recall semantic fragment data range capable of being recalled.
  7. 7. The continuous cognitive constructing method of a mental health agent as claimed in claim 6, wherein after the step of inputting the current memory recall request into the large language model to perform intention judgment, further comprising: When the intention judgment result is not hit, the semantic fragment data which is added into the limited recall of the semantic fragment data range capable of being recalled exists in the previous round of memory recall, and the time interval between the current memory recall request and the previous round of memory recall request is not more than the preset session window duration, carrying out short inquiry judgment on the current memory recall request; And when the current memory recall request meets a preset short inquiry condition, adding the semantic fragment data limited to recall into a semantic fragment data range which corresponds to the current memory recall request and can be recalled.
  8. 8. The continuous cognitive constructing method of a mental health agent according to claim 1, wherein the step of performing memory search from the history memory data according to the recallable semantic segment data range to obtain candidate semantic segment data, wherein the memory search is performed based on a hot storage path first, and is performed by reverting to a cold storage path when the hot storage path is not hit, comprises the steps of: Configuring the hot storage path as a hot memory list based on an ordered set, wherein the list capacity of the hot memory list is a preset number, semantic segment data ordered according to heat is stored in the hot memory list, and corresponding recall times, latest recall time and heat weight ordering information are recorded; Configuring the cold storage path as a vector database, wherein the vector database stores full-quantity semantic fragment data, corresponding high-dimensional semantic feature vectors, quality grading information and risk grade marking information; Inquiring the hot memory list according to the current memory recall request, and judging whether hit occurs according to a preset hot hit judging condition; When the preset hot hit judgment condition is hit, returning hit semantic segment data as the candidate semantic segment data, and asynchronously updating recall times, latest recall time and heat weight sequencing information corresponding to the hit semantic segment data; When the preset hot hit judgment condition is not hit, generating a recall search vector corresponding to the current memory recall request, and executing approximate nearest neighbor vector search on the total semantic segment data in the vector database based on the recall search vector to obtain a preset number of candidate semantic segment data.
  9. 9. The method for continuous cognitive constructing a mental health agent according to claim 1, wherein the step of performing multidimensional scoring and maximum marginal correlation reordering on the candidate semantic segment data by using configurable weight parameters to screen and obtain target semantic segment data comprises the following steps: respectively determining a relevance score, a time freshness score, a quality score, a risk score and an information density score corresponding to each candidate semantic segment data; And carrying out weighted calculation on the relevance score, the time freshness score, the quality score, the risk score and the information density score according to the configurable weight parameter to obtain a multi-dimensional comprehensive score corresponding to each candidate semantic segment data, wherein the calculation formula of the multi-dimensional comprehensive score is as follows: Wherein score represents the multi-dimensional composite score, w_rel represents the configurable weight parameter of the relevance score, w_ recency represents the configurable weight parameter of the temporal freshness score, w_quality represents the configurable weight parameter of the quality score, w_risk represents the configurable weight parameter of the risk score, w_info represents the configurable weight parameter of the information density score, rel represents the relevance score, recency represents the temporal freshness score, quality represents the quality score, wr represents the risk score, wi represents the information density score; based on the multidimensional comprehensive scores corresponding to the candidate semantic segment data and the similarity between the candidate semantic segment data, carrying out maximum marginal correlation reordering on the candidate semantic segment data; And determining a preset number of target semantic fragment data according to the reordering result.
  10. 10. A continuous cognitive construction system for mental health agents, comprising: The portrait progressive updating module is used for extracting portrait characteristic data in parallel from the current period dialogue data of the target user according to a preset trigger frequency, merging the extraction result to psychological portrait data with preset dimensionality according to a preset merging strategy, and progressively updating the psychological portrait data; The semantic segment shunt storage module is used for carrying out risk classification on new semantic segment data extracted from the current period dialogue data according to a preset risk classification rule, and carrying out shunt storage on the new semantic segment data with different risk classes according to a preset writing rule so as to generate history memory data; The recall right judging module is used for executing recall right judgment on the semantic segment data limited to recall in the historical memory data based on a preset recall rule, and determining the range of the semantic segment data which can be recalled according to a right judging result, wherein the preset recall rule comprises keyword hit judgment and semantic similarity judgment based on a preset semantic similarity threshold; the memory retrieval module is used for performing memory retrieval from the history memory data according to the recallable semantic fragment data range to obtain candidate semantic fragment data, wherein the memory retrieval is firstly performed based on a hot storage path, and is performed back to a cold storage path when the hot storage path is missed; the sorting and screening module is used for carrying out multidimensional scoring and maximum marginal correlation reordering on the candidate semantic segment data through configurable weight parameters so as to screen and obtain target semantic segment data; and the continuous cognition construction module is used for constructing a continuous cognition result of the mental health agent on the target user based on the updated mental portrait data and the target semantic segment data.

Description

Continuous cognition construction method and system of mental health intelligent agent Technical Field The application relates to the technical field of mental health, in particular to a continuous cognition construction method and system of a mental health agent. Background The existing mental health agent technology still has the defects in the aspects of user portrait and history memory processing. On the one hand, the representation capability of the user portrait is limited, the emotional state, the problem progress and the cognitive characteristic change of the user are difficult to continuously reflect along with the multi-round interaction process, the deep psychological characteristics are insufficiently reflected, the understanding of the user state is easy to stay at an earlier stage or a shallower layer, for example, the user state is changed from continuous anxiety to relatively mild, and the image result still keeps the early characteristics. On the other hand, the history memory is insufficient in distinguishing degree between different property contents in the subsequent processing process, and partial sensitive contents are possibly re-introduced in subsequent interaction, for example, early negative experiences are re-mentioned in common communication, and thus the relevance and the safety of the subsequent interaction contents are affected. Disclosure of Invention The technical problem solved by the embodiment of the application is that the existing mental health intelligent agent has insufficient continuous cognition construction capability for users. In order to solve the technical problems, a first technical scheme adopted by the embodiment of the application is to provide a continuous cognition construction method of a mental health intelligent agent, which comprises the steps of extracting portrait characteristic data in parallel from current periodic dialogue data of a target user according to a preset trigger frequency, merging an extraction result to psychological portrait data of a preset dimension according to a preset merging strategy to progressively update the psychological portrait data, carrying out risk classification on new semantic fragment data extracted from the current periodic dialogue data according to a preset risk classification rule, carrying out split-flow storage on the new semantic fragment data of different risk grades according to a preset write rule to generate historical memory data, executing recall right judgment on semantic fragment data limited by the historical memory data based on a preset recall rule, determining a recall semantic fragment data range according to a right judgment result, wherein the preset recall rule comprises keyword hit judgment and semantic similarity judgment based on a preset semantic similarity threshold, carrying out risk classification on the new semantic fragment data extracted from the current periodic dialogue data according to a preset risk classification rule, carrying out split-flow storage on the new semantic fragment data of different risk grades according to a preset write rule, carrying out constraint on the new semantic fragment data of the current periodic dialogue data, carrying out constraint recall right judgment on the semantic fragment data, carrying out recall right judgment on the current constraint on the current periodic dialogue data, and carrying out constraint on the current constraint state of the current dialogue data of the target user, and carrying out constraint state on the new semantic fragment data, and carrying out constraint state classification on the new constraint state on the new semantic fragment data. In order to solve the technical problems, a second technical scheme adopted by the embodiment of the application is to provide a continuous cognition construction system of a mental health intelligent body, which comprises an portrayal progressive update module, a semantic segment shunt storage module, a recall authority judgment module, a constraint memory module and a constraint memory module, wherein the portrayal progressive update module is used for parallelly extracting portrayal feature data from current periodic dialogue data of a target user according to preset trigger frequency, merging an extraction result into psychological portrayal data of preset dimensions according to preset merging strategies to progressively update the psychological portrayal data, the semantic segment shunt storage module is used for carrying out risk classification on new semantic segment data extracted from the current periodic dialogue data according to preset risk classification rules, carrying out shunt storage on the new semantic segment data with different risk grades according to preset write-in rules to generate historical memory data, the recall authority judgment module is used for executing recall authority judgment on semantic segment data limited by recall in the historical memory data ac