AI interaction system capable of flexibly adjusting system prompts and interaction method thereof

By setting up physical buttons on AI devices to activate the command release mode, and dynamically generating and managing System Prompts, the problem of users being unable to deeply modify and flexibly guide AI-generated content is solved, achieving a more efficient personalized interactive experience and AI's command understanding capabilities.

CN121008689APending Publication Date: 2025-11-25SHANGHAI KUQIQI INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511066635.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

In existing AI interaction systems, users cannot deeply modify the System Prompt, cannot flexibly guide AI to generate content, and the interaction process is not convenient enough, lacking the ability to understand and respond to user commands.

Method used

By setting physical buttons on AI devices to activate the command issuance mode, and utilizing the input distribution and preprocessing module and the command intent analysis module, the intent and timeliness of user voice commands can be classified and determined, structured System Prompts can be dynamically generated and managed, and the generated content of the large language model can be adjusted.

Benefits of technology

It enhances users' ability to deeply customize AI behavior and personalize the experience, improves the immediacy and convenience of interaction, gives AI a stronger ability to understand instructions and guide content, and makes operation simple and intuitive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121008689A_ABST
    Figure CN121008689A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent interaction equipment, and provides an AI interaction system capable of flexibly adjusting system prompts and an interaction method thereof.The system is composed of AI equipment, a mode switching module, an input distribution and preprocessing module, an instruction intention analysis module, a System Prompt dynamic generation and management module and a model interaction module. After a user triggers an instruction mode through a key, voice input is converted into a text through distribution preprocessing, a modification strategy is generated through intention analysis, the structured System Prompt is dynamically adjusted and applied to multiple rounds of dialogues, and the output tendency of a large language model is guided in real time. According to the method, deep customization of the AI behavior by the user can be realized, the instruction input convenience is improved, the instruction understanding and content guiding capability is enhanced by combining modular processing, while the operation intuition is guaranteed, the AI is endowed with the personalized interaction capability of autonomously adapting to the user intention, and the flexibility and accuracy of dialogue experience are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent interactive device technology, specifically relating to an AI interactive system and its interactive method that allows for flexible adjustment of system prompts. Background Technology

[0002] In recent years, with the rapid improvement of computing power and the accumulation of massive amounts of data, artificial intelligence technologies, represented by Large Language Models (LLMs), have made groundbreaking progress. Large models typically refer to deep learning models with a huge number of parameters (up to billions or even trillions) that are pre-trained on massive amounts of text data. They can learn and understand complex patterns in natural language and demonstrate outstanding performance in various natural language processing (NLP) tasks, such as text generation, machine translation, question answering systems, and summarization. It is worth mentioning that the widespread adoption of large model technology has spurred many innovative applications, with AI hardware driven by large models being a prime example. This type of AI hardware typically integrates the capabilities of large models into physical devices, allowing users to interact with the hardware through dialogue.

[0003] When users interact with large models, a fixed structural paradigm is typically employed. This paradigm usually includes the following key components:

[0004] 1. System Prompt: Sometimes called "Role Setting" or "Instruction," this is text set by the model developer, system administrator, or, in some cases, by the user. The main purpose of this text is to define the context, roles, goals, tone, and output format of the dialogue for the large model. It essentially provides the model with an "operation manual," guiding it on how to understand and respond to user input in subsequent interactions.

[0005] Developer / System Presets: To ensure the controllability, stability, and security of model behavior, some core system prompts are usually fixed and cannot be directly modified or overridden by users when interacting with large models. This section may include general constraints on model behavior, safety guidelines, etc.

[0006] User-configurable aspects (role setting, etc.): In many consumer-facing applications, especially products like AI hardware, the role setting section in system prompts typically allows users to choose from a list of roles to enhance user experience and make the model more engaging. For example, users can set the AI ​​hardware's interactive identity as "a cute little bunny," "Peppa Pig," or "a learned historian." This flexibility allows large models to interact with users in different "personalities," greatly enriching the user experience. When users modify this part of the prompt, the model will adjust its language style, knowledge scope, and behavioral patterns according to the new role setting.

[0007] 2. User Input: This refers to the specific questions, instructions, or dialogue content that the user presents to the large model. This is the medium through which the user interacts with the model. The large model will understand and analyze the user's input, taking into account the context and rules set in the system prompts, and generate corresponding responses.

[0008] 3. Model Output / Response: This is the content generated by the large model based on system prompts and user input. It can be text, code, summary, or other forms of information, depending on the task set by the system prompts and the intent of the user input.

[0009] In actual interaction, the entire process can be summarized as follows: system prompts (including fixed and user-configurable parts) set the model's behavior—user input provides specific needs—the model generates a response based on both. For example, in an AI hardware application, a user might set the AI ​​character bound to the device as "Peppa Pig" (this is the user-configurable SystemPrompt part), while the fixed part of the system prompts constrains the model to comply with safety rules. When the user says to the AI ​​hardware, "Peppa Pig, tell me a bedtime story," the large model will generate a story suitable for bedtime listening in Peppa Pig's tone and style.

[0010] Currently, interactive systems based on large models have been widely used in various scenarios. Their core lies in guiding the large model through system prompts and generating corresponding model outputs by combining user input.

[0011] Interaction schemes based on fixed or limited configurable system prompts: In many large-scale applications, system prompts are typically preset by the developers. Some applications offer limited modification permissions, such as allowing users to set the role of the AI.

[0012] Implementation: Developers define a core System Prompt to ensure the AI's basic behavior and safety. For user-configurable aspects such as role settings, a preset list of roles (e.g., "Peppa Pig," "Astronaut") is typically provided. Users can select from the list using accompanying software (e.g., a mobile app) or describe a role using very limited custom text input. The AI ​​incorporates the user's selection or brief description as part of the System Prompt, influencing its interaction style.

[0013] Interaction process: When a user interacts with the AI ​​hardware, for example, by saying "Tell me a bedtime story", if the user has set the AI ​​character to "Peppa Pig", the large model will generate a story in Peppa Pig's tone and style based on this setting and the System Prompt preset by the developer.

[0014] While the aforementioned existing technical solutions offer some basic capabilities in terms of interaction and personalization of large models, they still have significant limitations, which are precisely the limitations that this patent application aims to address:

[0015] With limited modification permissions, users cannot deeply modify the System Prompt to meet their own in-depth and personalized dialogue needs. Existing solutions typically only allow modification of superficial System Prompt settings such as role settings, while the core guidance logic and behavior patterns are opaque to users and cannot be changed, making it difficult to meet users' more complex and detailed personalized needs.

[0016] With limited modification permissions, users cannot operate in real-time during dialogue with the AI ​​hardware. Instead, they must search for the corresponding functions in the accompanying software and can only select from a list of provided character settings, rather than customizing them on the spot. This separate operation method is inconvenient and limits the flexibility of users to dynamically adjust the AI's behavior in specific dialogue scenarios. Users cannot quickly and directly influence the AI's dialogue strategy based on their immediate needs.

[0017] The AI ​​cannot flexibly guide the content it generates. It simply responds to the generated content according to the current System Prompt settings. The AI ​​treats user input as dialogue content rather than understanding the intent of the command. For example, if a user wants to input a command to guide the AI's subsequent content generation, such as "Tell the child to rest their eyes after watching TV for a while," the current AI often interprets this as a regular conversation, asking if it should tell the child, rather than recognizing it as a command that the AI ​​needs to execute at an appropriate time. The AI ​​lacks the ability to distinguish between "commanding intent" and "dialogue intent" in user input, especially in guiding subsequent content generation. Summary of the Invention

[0018] The purpose of this invention is to overcome the existing defects and provide an AI interaction system and interaction method with flexible adjustable system prompts.

[0019] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0020] The first objective of this invention is to provide an AI interaction system with flexibly adjustable system prompts, comprising:

[0021] AI devices communicate with cloud AI servers to collect voice input information, transmit the information to the cloud AI server for processing, and then receive the processed information and play it back in response.

[0022] The mode switching module, located on the surface of the AI ​​device, includes one or more physical buttons for activating the command issuance mode. In the command issuance mode, the voice input by the user is configured to modify the System Prompt or set a behavior guide.

[0023] The input distribution and preprocessing module receives voice data packets from AI devices, distributes user input to different processing threads according to the pattern markers in the voice data packets, and converts voice data in the command mode into command text through speech recognition.

[0024] The instruction intent analysis module receives instruction text from the input distribution and preprocessing module, performs intent classification, extracts key parameters and determines timeliness, and generates a modification strategy for the System Prompt.

[0025] The System Prompt dynamic generation and management module is used to convert fuzzy text System Prompts into structured System Prompts, dynamically modify the structured System Prompts according to the System Prompt modification strategy, and apply the modified System Prompts to subsequent multi-round interactions to adjust the tendency of the content generated by the large language model.

[0026] The model interaction and response generation module is used to package the updated System Prompt and the user's dialogue input and send them to the large language model to generate response content. After converting the response content into voice data, it is sent to the AI ​​device for voice reply.

[0027] Furthermore, the instruction intent analysis module includes:

[0028] The intent classification unit is used to divide instruction text into different semantic categories using a large model;

[0029] The key parameter extraction unit is used to extract structured information from the instruction text;

[0030] The timeliness determination unit is used to identify and determine the timeliness information contained in the instruction text.

[0031] Furthermore, the semantic categories in the intent classification unit include:

[0032] Character / style modification category, which provides instructions to adjust the dialogue style or specify a particular role for the system;

[0033] Behavior rule setting class, which presets conditions for users to trigger rules, requiring the system to perform specified operations in specific scenarios;

[0034] Knowledge / fact injection classes provide users with instructions that require the system to remember and apply personalized information;

[0035] Short-term scenario instructions are specific instructions for the current or near-term situation, and are time-sensitive and scenario-limited.

[0036] Furthermore, the timeliness determination unit infers the timeliness of instructions that do not contain time words based on the instruction content. If it cannot infer the timeliness, it adopts a default strategy.

[0037] Furthermore, the structured System Prompt adopts a hierarchical storage structure, including:

[0038] The core identity layer stores basic role definitions;

[0039] The behavior rule layer stores long-term rules and temporary rules with expiration times;

[0040] The scenario instruction layer stores the mapping relationship between trigger conditions and short-term instructions.

[0041] The second objective of this invention is to provide an AI interaction method that allows for flexible adjustment of system prompts, comprising:

[0042] The system detects the trigger operation of the mode switching button and switches to command mode based on the trigger operation.

[0043] Acquire user voice commands and generate voice data packets with added pattern tags;

[0044] Based on the pattern markers in the voice data packets, user input is distributed to different processing threads, and voice data in the command mode is converted into command text through speech recognition;

[0045] The system classifies the instruction text by intent, extracts key parameters, and determines its timeliness, generating a modification strategy for the System Prompt.

[0046] The system prompt of fuzzy text is converted into a structured system prompt. The structured system prompt is dynamically modified according to the modification strategy of the system prompt. The modified system prompt is then applied to subsequent multi-turn dialogue interactions to adjust the tendency of the content generated by the large language model.

[0047] Based on the updated System Prompt and the user's dialogue input, the data is packaged and sent to a large language model to generate response content;

[0048] The response text generated by the large language model is converted into speech data and sent to the AI ​​device, which then plays the speech response.

[0049] Furthermore, the modified System Prompt is applied to subsequent multi-round dialogue interactions, and the System Prompt is managed according to the validity period of the instruction, automatically cleared after triggering execution or removed after the expiration time.

[0050] Another object of the present invention is to provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the AI ​​interaction method for flexibly adjusting system prompts as described in the second object of the present invention.

[0051] Another object of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the AI ​​interaction method for flexibly adjusting system prompts as described in the second object of the present invention.

[0052] Another object of the present invention is to provide a server comprising at least one processor and a memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the processor to cause the at least one processor to perform the AI ​​interaction method for flexibly adjusting system prompts as described in the second object of the present invention.

[0053] In combination with the above technical solutions, the beneficial effects of the present invention compared with the prior art are as follows:

[0054] Enhance users' ability to deeply customize AI behavior and provide a personalized experience: Allow users to directly modify more aspects of the System Prompt through simple voice commands, enabling AI devices to autonomously determine how to apply these modifications (scope and duration of impact), thereby achieving a more deeply personalized dialogue that aligns with user intent.

[0055] Enhance the immediacy and convenience of interaction: Through dedicated physical buttons and voice commands, users can quickly and easily issue commands to the AI ​​to modify the System Prompt at any time during the conversation, without interrupting the conversation or switching to other application interfaces.

[0056] Empowering AI with enhanced command understanding and content guidance capabilities: By utilizing the input distribution and preprocessing module and the command intent analysis module, AI can distinguish between users' conversational input and command input, understand the user's intention to guide subsequent content, and adjust its own behavior accordingly (by modifying the System Prompt), such as delivering specific information or adopting a specific communication style in a specific context.

[0057] Simple and intuitive to operate, with clear command intent: Activating specific command modes through physical buttons helps users clearly convey their intention to modify the System Prompt or guide subsequent behavior to the AI ​​device. Attached Figure Description

[0058] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0059] Figure 1 This is a schematic diagram of the structure of an AI interaction system with flexibly adjustable system prompts provided in an embodiment of the present invention;

[0060] Figure 2 This is a flowchart of the interaction method provided in the embodiments of the present invention. Detailed Implementation

[0061] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0062] Example 1:

[0063] like Figure 1 The image shows an embodiment of the AI ​​interaction system with flexibly adjustable system prompts provided by the present invention, comprising:

[0064] AI devices communicate with cloud AI servers to collect voice input information, transmit the information to the cloud AI server for processing, and then receive the processed information and play it back in response.

[0065] The mode switching module, located on the surface of the AI ​​device, includes one or more physical buttons for activating the command issuance mode. In the command issuance mode, the voice input by the user is configured to modify the System Prompt or set a behavior guide.

[0066] The input distribution and preprocessing module receives voice data packets from AI devices, distributes user input to different processing threads according to the pattern markers in the voice data packets, and converts voice data in the command mode into command text through speech recognition.

[0067] The instruction intent analysis module receives instruction text from the input distribution and preprocessing module, performs intent classification, extracts key parameters and determines timeliness, and generates a modification strategy for the System Prompt.

[0068] The System Prompt dynamic generation and management module is used to convert fuzzy text System Prompts into structured System Prompts, dynamically modify the structured System Prompts according to the System Prompt modification strategy, and apply the modified System Prompts to subsequent multi-round interactions to adjust the tendency of the content generated by the large language model.

[0069] The model interaction and response generation module is used to package the updated System Prompt and the user's dialogue input and send them to the large language model to generate response content. After converting the response content into voice data, it is sent to the AI ​​device for voice reply.

[0070] Specifically, this embodiment of the invention uses physical buttons to switch between "continuous dialogue mode" and "command issuance mode," allowing users to easily modify parts of the System Prompt to guide the bias and style of subsequent AI-generated content. Furthermore, the AI ​​can autonomously determine the applicability and timeliness of such modifications. The AI ​​device includes at least:

[0071] Microphone: Used to pick up the user's voice input.

[0072] Speaker: Used to play AI's voice responses.

[0073] Processor: Executes the core logic of the device, including pattern recognition, data processing, and collaboration with cloud AI.

[0074] Memory: Stores program code and temporary data.

[0075] Mode switching button: One or more physical buttons are used to activate "Issue Command Mode", in which user-inputted voice will be treated as commands to modify the System Prompt or set behavior guidance.

[0076] Network interface: Used to communicate with cloud AI servers.

[0077] It should be noted that the System Prompt in the fuzzy text mode is the voice content entered by the user in the issue command mode.

[0078] This invention provides a special interaction mode activated by specific physical button operations (distinct from conventional interactive buttons). This mode allows users to directly instruct the AI ​​to modify parts of their System Prompt or set the overall content generation strategy, style, or focus for a series of subsequent "continuous dialogues" via voice input. The input distribution and preprocessing module enables the AI ​​to differentiate between command intent and dialogue intent. It can distinguish whether the user's input is an instruction aimed at modifying AI behavior or ordinary dialogue content based on the input mode (command mode activated by physical buttons vs. conventional dialogue mode), and perform differentiated processing to ensure that the AI ​​can accurately respond to the user's intent to modify the System Prompt. Users do not need to rely on external software configuration and can instantly and conveniently modify the System Prompt through physical buttons and voice commands during natural dialogue with the AI ​​hardware to meet their deep, personalized, and immediate needs, achieving a convenient, real-time in-dialogue System Prompt modification mechanism. By employing a command mode activated by a dedicated physical button, convenient real-time operation within the dialogue, and AI's ability to distinguish between commands and dialogue intent, this technology addresses the problems of "limited modification permissions, preventing users from deeply modifying the System Prompt" and "the inability for users to operate in real-time during dialogue with AI hardware even with limited modification permissions." It provides a clear, convenient, and direct physical interaction method, enabling users to instantly express their intent to modify the System Prompt, which the AI ​​accurately receives and distinguishes. This enhances the user's ability to deeply customize AI behavior and improves the convenience and immediacy of personalized experiences; the operation is simple and intuitive, and the command intent is clear.

[0079] AI's understanding of user commands and its autonomous modification and application of System Prompt: The system (especially cloud-based AI) can understand that voice commands input in "command mode" are not simply dialogue content, but rather requests to modify the AI's own behavior or System Prompt. AI possesses the ability to autonomously judge how to modify corresponding parts of System Prompt (such as role, tone, specific rules, response logic, etc.) according to user commands, and determines whether the modification is short-term or long-term.

[0080] The continuous impact and dynamic management of System Prompt after instruction modification on subsequent multi-turn dialogues: System Prompt (or its equivalent behavioral guidance parameter) modified by user instructions can be applied to multiple rounds of interaction in subsequent "continuous dialogue mode", systematically adjusting the tendency of LLM generated content until the instruction expires according to its own timeliness (AI judgment or user setting), is actively cleared by the user, or is overwritten by a new instruction.

[0081] This invention addresses the problems in existing technologies, namely, limited modification permissions preventing users from deeply modifying the System Prompt to meet their personalized dialogue needs, and the inability to flexibly guide AI-generated content, with AI treating user input as dialogue content rather than understanding the intent of the command. By enabling AI to understand user commands and autonomously modify and apply the System Prompt, as well as the continuous impact and dynamic management of the modified System Prompt on subsequent multi-turn dialogues, this invention solves these issues. By empowering AI with the ability to understand user commands and autonomously determine how to modify the System Prompt (including the scope and timeliness of modifications), AI can truly adjust its core behavioral patterns according to the user's deeper needs and flexibly guide subsequent content. This achieves deep customization and personalized guidance of AI behavior by the user; enhances AI's command understanding and content guidance capabilities, enabling it to respond to more complex personalized needs; and allows AI to autonomously determine the short-term or long-term nature of modifications based on commands, improving the intelligence and flexibility of the interaction.

[0082] It should be noted that the button operation method in the embodiments of the present invention can be as follows: (1) In addition to pressing and holding to speak, the button can be clicked to enter the "issue command mode". The device confirms entry into the mode through voice prompts (such as "Please say your guidance command"). After the user finishes speaking the command, he / she can say "end command" or the device will automatically exit through silent detection. (2) It can be activated by long-pressing or double-clicking a specific combination key or a rarely used dedicated key. (3) Apps / mini-programs / web pages can be used as a supplement or alternative input method to the "command mode", but the core lies in the AI's understanding of the command and the autonomous modification capability of SystemPrompt.

[0083] When setting the hierarchy and scope of commands, different levels of commands can be designed. For example, users can explicitly declare "temporary commands" (applying for a few minutes or several rounds of dialogue) and "permanent commands" (applying until manually cleared or overwritten). If the user does not declare any, the AI ​​will determine the appropriate level. If the device supports multiple users, commands can be bound to specific users or set to apply globally to all users.

[0084] Command Visualization and Editing (for devices with screens): After activating "Issue Command Mode," if the device has a screen, the voice-converted command text and the AI-understood System Prompt modification intent (e.g., "I will modify your conversation style to 'witty and humorous' for 1 hour. Confirm?") can be displayed for user confirmation or fine-tuning. The screen can display a summary of the currently effective System Prompt modifications and provide options to clear or modify it.

[0085] Diversified feedback mechanisms: In addition to sound or light, AI can use a short voice message to confirm that it has understood and adopted the instruction, and explain the scope of its understanding and the approximate timeframe for modification, such as: "Okay, in the next chat with Xiaoming, I will be more patient and encourage him more, and remind him to rest his eyes when he mentions watching TV. I will keep this setting for Xiaoming until the end of today."

[0086] Combining with AI's own learning capabilities: AI can learn the types of commands and preferences that users frequently issue, and in the future, it can proactively ask users whether they need to enable similar System Prompt modification strategies in similar situations, or recommend that users set certain high-frequency short-term commands to be valid for a long time after multiple uses.

[0087] Preferably, the instruction intent analysis module in this embodiment of the invention includes:

[0088] The intent classification unit is used to divide instruction text into different semantic categories using a large model;

[0089] The key parameter extraction unit is used to extract structured information from the instruction text;

[0090] The timeliness determination unit is used to identify and determine the timeliness information contained in the instruction text.

[0091] Preferably, the semantic categories in the intent classification unit in this embodiment of the invention include:

[0092] Character / style modification category, which provides instructions to adjust the dialogue style or specify a particular role for the system;

[0093] Behavior rule setting class, which presets conditions for users to trigger rules, requiring the system to perform specified operations in specific scenarios;

[0094] Knowledge / fact injection classes provide users with instructions that require the system to remember and apply personalized information;

[0095] Short-term scenario instructions are specific instructions for the current or near-term situation, and are time-sensitive and scenario-limited.

[0096] Preferably, in this embodiment of the invention, the timeliness determination unit performs timeliness inference based on the instruction content for instructions that do not contain time words; if it cannot infer timeliness, it adopts a default strategy.

[0097] Preferably, the structured System Prompt in this embodiment of the invention adopts a hierarchical storage structure, including:

[0098] The core identity layer stores basic role definitions;

[0099] The behavior rule layer stores long-term rules and temporary rules with expiration times;

[0100] The scenario instruction layer stores the mapping relationship between trigger conditions and short-term instructions.

[0101] The technical solutions of the embodiments of the present invention will be further explained below with reference to specific working modes and process examples.

[0102] A. Continuous Dialogue Mode:

[0103] 1. The device is in continuous dialogue mode by default, and users interact with the device in a regular manner through natural voice.

[0104] 2. The device's microphone detects the user's voice using VAD (Voice Activity Detection) technology and captures voice data.

[0105] 3. The device uploads the captured voice data to the cloud AI server via a network interface.

[0106] 4. The cloud-based AI server performs ASR (Audio Recognition) to convert speech into text.

[0107] 5. LLM (Large Language Model) generates response text based on the recognized text, the current dialogue context, and the currently active SystemPrompt (which may include modifications previously set by the user through the "Issue Command Mode").

[0108] 6. The TTS (Text-to-Speech) module converts the LLM-generated response text into speech.

[0109] 7. The cloud-based AI server sends the synthesized voice data to the AI ​​device.

[0110] 8. The AI ​​device plays AI's voice response through a speaker.

[0111] B. Command Issuance Mode:

[0112] 1. Input Distribution and Preprocessing Module:

[0113] Function: Receives data packets uploaded from AI devices. Distributes user input data to different processing pipelines based on "pattern markers" (e.g., "dialogue" or "command") in the data packets. Performs ASR (Automatic Speech Recognition) to convert speech in "command mode" to text.

[0114] This is the technical prerequisite for distinguishing between "dialogue intent" and "instruction intent".

[0115] 2. Command Intent Analysis Module: Corresponds to "AI Autonomous Judgment".

[0116] The instruction intent analysis module receives the instruction text and performs a series of analyses (intent classification, key parameter extraction, and timeliness determination) to "autonomously determine" how to modify the System Prompt.

[0117] a) Intent Classification: Large modeling techniques are used to categorize instructions into different classes. For example:

[0118] Character / style modification: "Ask me like Socrates," "Speak in a humorous tone."

[0119] Behavioral rules: "If I mention 'park,' remind me to bring a water bottle."

[0120] Knowledge / fact injection type: "Remember my dog's name is 'Wangcai'."

[0121] Short-term scenario instructions: "Tell the children that they should rest their eyes after watching TV for a while."

[0122] b) Key parameter extraction: Extract structured information from instructions.

[0123] Example: For the instruction "In the next half hour, please ask me questions in the Socratic way," the following can be extracted:

[0124] style: 'Socratic questioning'

[0125] duration: '30 minutes' (duration)

[0126] condition: 'all questions' (trigger condition)

[0127] c) Timeliness determination:

[0128] Explicit judgment: Recognize time words such as "the next half hour", "permanently", and "within today".

[0129] Implicit inference: If no time word is provided, inference is made based on the instruction content. For example, "Tell the child to rest their eyes" is usually considered a short-term, contextual instruction; "Remember my dog's name is Wangcai" is considered a long-term memory instruction. If inference cannot be made, a default strategy (such as "Valid for this session") can be used.

[0130] The instruction intent analysis module ultimately generates a structured "System Prompt Modification Policy", such as a JSON object: {"type":"style_modification","params":{"style":"Socratic","duration":1800},"priority":1}

[0131] 3. System Prompt Dynamic Generation and Management Module:

[0132] Maintain a structured, layered System Prompt template. It receives modification strategies from the "Instruction Intent Analysis Module" and dynamically modifies the template.

[0133] Structured Prompt Example:

[0134] <systemprompt>

[0135] <coreidentity> You are a helpful AI assistant.< / coreidentity>

[0136] <roleplay>

[0137] <character> default< / character>

[0138] <style>默认< / style>

[0139] < / roleplay>

[0140] <behavioralrules>

[0141] <!-- Long-term rule-->

[0142] <Rule id="1"> If a user mentions a pet dog, they will call it 'Wangcai'.

[0143] <!--Temporary rule, with an expiration date-->

[0144] <Rule id="temp_01"expiry="2023-10-27T15:00:00Z"> If a user mentions 'park', remind them to 'bring a water bottle'.

[0145] < / behavioralrules>

[0146] <temporarycontext>

[0147] <!-- Situational Short-Term Instructions-->

[0148] <instruction> When talking to a child about watching TV, insert a reminder to "take a break for your eyes".< / instruction>

[0149] < / temporarycontext>

[0150] < / systemprompt>

[0151] content_copydownload

[0152] Use code w with caution.Xml

[0153] The System Prompt dynamic generation and management module transforms a vague piece of text into a programmable and manageable structured data, making precise and dynamic modification possible.

[0154] 4. Model Interaction and Response Generation Module:

[0155] Each time a user engages in a “continuous dialogue”, this module retrieves the latest version of SystemPrompt from the “management module”, packages it together with the user’s dialogue input, and sends it to the Large Language Model (LLM) to generate a response.

[0156] Example 2:

[0157] like Figure 2 As shown in the figure, this embodiment of the invention provides an AI interaction method that allows for flexible adjustment of system prompts, specifically including the following steps:

[0158] S1: Detect the trigger operation of the mode switching button, and switch to command mode according to the trigger operation;

[0159] S2: Obtain user voice commands and generate voice data packets with added pattern tags;

[0160] S3: Based on the pattern markers in the voice data packets, the user input is distributed to different processing threads, and the voice data in the command mode is converted into command text through speech recognition;

[0161] S4: Perform intent classification, key parameter extraction, and timeliness determination on the instruction text to generate a modification strategy for System Prompt;

[0162] S5: Convert the fuzzy text System Prompt into a structured System Prompt, dynamically modify the structured System Prompt according to the System Prompt modification strategy, and apply the modified System Prompt to subsequent multi-turn dialogue interactions to adjust the tendency of the content generated by the large language model.

[0163] S6: Based on the updated System Prompt and the user's dialogue input, package and send it to the large language model to generate response content;

[0164] S7: Convert the response text generated by the large language model into speech data and send it to the AI ​​device, which then plays the speech response.

[0165] Preferably, in this embodiment of the invention, the modified System Prompt is applied to subsequent multi-turn dialogue interactions, and the System Prompt is managed according to the timeliness of the instruction, automatically cleared after triggering execution or removed after the expiration time.

[0166] The embodiments of the present invention will be further described below with reference to specific examples.

[0167] 1. Mode activation and command acquisition:

[0168] When a user presses the "mode switch button" on the AI ​​interaction device, the device's internal state switches to "issue command mode".

[0169] The device firmware adds a "command mode" metadata tag (e.g., flag: 'command') to the voice data packets that are about to be uploaded.

[0170] The microphone picks up user voice commands, such as: "Tell the children to rest their eyes after watching TV for a while."

[0171] 2. Command Upload and Cloud Distribution:

[0172] The device sends voice data packets marked with "command mode" to the cloud AI server via the network interface.

[0173] The cloud-based input distribution and preprocessing module receives data, identifies the "command pattern" marker, sends the data to the "command processing pipeline," and calls the ASR service to convert speech into text: "Tell the children that they need to rest their eyes after watching TV for a while."

[0174] 3. Instruction Analysis and Strategy Generation:

[0175] The instruction intent analysis module receives the above text and performs analysis:

[0176] Intent Classification: Identified as "Short-term Contextual Instruction Class".

[0177] Parameter extraction: Extract target:'kids', context:'watching TV', action:'remind rest your eyes'.

[0178] Timeliness determination: Implicit inference is "situationally short-term effective", that is, it is triggered once when a specific context is met or is effective in a short period of time.

[0179] Based on the analysis results, the module generates a structured modification strategy, for example: {"type":"temporary_context_injection","params":{"target":"children","context":"watching TV","instruction":"rest your eyes"}}.

[0180] 4. Dynamic modification and application of System Prompt:

[0181] The System Prompt dynamic generation and management module receives this policy.

[0182] This module parses the policy and dynamically writes a new instruction into the structured System Prompt it manages. <temporarycontext>part.

[0183] This module may return a confirmation message to the user's device (such as "Okay, I will remind the child"), which is then played back after being converted into speech by TTS.

[0184] 5. Apply the modified instructions in subsequent dialogues:

[0185] When the user releases the button, the device returns to "continuous conversation mode".

[0186] When subsequent conversations between the user and the AI ​​(for example, the user says, "AI, chat with the kid, he just finished watching a cartoon") are uploaded to the cloud, the model interaction and response generation module will obtain a SystemPrompt that already contains the new instructions.

[0187] Because the context of the conversation (chatting with a child, just finished watching TV) matched the context. <temporarycontext>The trigger condition in the LLM will naturally incorporate the information point "take a break from watching TV for a while" when generating a response.

[0188] 6. Instruction lifecycle management:

[0189] Once triggered, the System Prompt management module can mark the scenario instruction as completed and remove it. Alternatively, it can be automatically cleared after the expiration date according to a preset policy (such as "valid for 2 hours"), ensuring system cleanliness.

[0190] Example 3: This embodiment of the invention provides an electronic device, including a processor and a memory storing a computer program. When the processor executes the computer program, it implements the AI ​​interaction method with flexibly adjustable system prompts provided in Example 2 of the invention.

[0191] Example 4: This embodiment of the invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the AI ​​interaction method with flexibly adjustable system prompts provided in Example 2 of the invention.

[0192] Example 5: This embodiment of the invention provides a server, including at least one processor and a memory communicatively connected to the processor. The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the processor to cause the at least one processor to execute the AI ​​interaction method with flexibly adjustable system prompts provided in Example 2 of the invention.

[0193] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in the present invention, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0194] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0195] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / temporarycontext> < / temporarycontext>

Claims

1. An AI interaction system with flexibly adjustable system prompts, characterized in that, The system includes: AI devices communicate with cloud AI servers to collect voice input information, transmit the information to the cloud AI server for processing, and then receive the processed information and play it back in response. The mode switching module, located on the surface of the AI ​​device, includes one or more physical buttons for activating the command issuance mode. In the command issuance mode, the voice input by the user is configured to modify the System Prompt or set a behavior guide. The input distribution and preprocessing module receives voice data packets from AI devices, distributes user input to different processing threads according to the pattern markers in the voice data packets, and converts voice data in the command mode into command text through speech recognition. The instruction intent analysis module receives instruction text from the input distribution and preprocessing module, performs intent classification, extracts key parameters and determines timeliness, and generates a modification strategy for the System Prompt. The System Prompt dynamic generation and management module is used to convert fuzzy text System Prompts into structured System Prompts, dynamically modify the structured System Prompts according to the System Prompt modification strategy, and apply the modified System Prompts to subsequent multi-round interactions to adjust the tendency of the content generated by the large language model. The model interaction and response generation module is used to package the updated System Prompt and the user's dialogue input and send them to the large language model to generate response content. After converting the response content into voice data, it is sent to the AI ​​device for voice reply.

2. The AI ​​interaction system with flexibly adjustable system prompts according to claim 1, characterized in that, The instruction intent analysis module includes: The intent classification unit is used to divide instruction text into different semantic categories using a large model; The key parameter extraction unit is used to extract structured information from the instruction text; The timeliness determination unit is used to identify and determine the timeliness information contained in the instruction text.

3. The AI ​​interaction system with flexibly adjustable system prompts according to claim 2, characterized in that, The semantic categories in the intent classification unit include: Character / style modification category, which provides instructions to adjust the dialogue style or specify a particular role for the system; Behavior rule setting class, which presets conditions for users to trigger rules, requiring the system to perform specified operations in specific scenarios; Knowledge / fact injection classes provide users with instructions that require the system to remember and apply personalized information; Short-term scenario instructions are specific instructions for the current or near-term situation, and are time-sensitive and scenario-limited.

4. The AI ​​interaction system with flexibly adjustable system prompts according to claim 2, characterized in that, The timeliness determination unit infers the timeliness of instructions that do not contain time words based on the instruction content. If it cannot infer the timeliness, it adopts the default strategy.

5. The AI ​​interaction system with flexibly adjustable system prompts according to claim 1, characterized in that, The structured System Prompt adopts a hierarchical storage structure, including: The core identity layer stores basic role definitions; The behavior rule layer stores long-term rules and temporary rules with expiration times; The scenario instruction layer stores the mapping relationship between trigger conditions and short-term instructions.

6. An AI interaction method with flexibly adjustable system prompts, characterized in that, The interaction method includes: The system detects the trigger operation of the mode switching button and switches to command mode based on the trigger operation. Acquire user voice commands and generate voice data packets with added pattern tags; Based on the pattern markers in the voice data packets, user input is distributed to different processing threads, and voice data in the command mode is converted into command text through speech recognition; The system classifies the instruction text by intent, extracts key parameters, and determines its timeliness, generating a modification strategy for the System Prompt. The system prompt of fuzzy text is converted into a structured system prompt. The structured system prompt is dynamically modified according to the modification strategy of the system prompt. The modified system prompt is then applied to subsequent multi-turn dialogue interactions to adjust the tendency of the content generated by the large language model. Based on the updated System Prompt and the user's dialogue input, the data is packaged and sent to a large language model to generate response content; The response text generated by the large language model is converted into speech data and sent to the AI ​​device, which then plays the speech response.

7. The AI ​​interaction method with flexibly adjustable system prompts according to claim 6, characterized in that, The modified System Prompt is applied to subsequent multi-turn dialogue interactions. The System Prompt is managed according to the timeliness of the instruction, and is automatically cleared after being triggered or removed after the expiration time.

8. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the AI ​​interaction method with flexibly adjustable system prompts as described in any one of claims 6 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the AI ​​interaction method with flexibly adjustable system prompts as described in any one of claims 6 to 7.

10. A server, characterized in that: It includes at least one processor and a memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the processor to cause the at least one processor to perform the AI ​​interaction method with flexibly adjustable system prompts as described in any one of claims 6 to 7.