Intelligent question answering system and method based on dynamic context awareness and incremental loading
The intelligent question-answering system, which utilizes dynamic context awareness and incremental loading, solves the problem of poor user experience in existing technologies, achieves smooth interface display and logical coherence in multi-round question-answering, and improves the naturalness and ease of use of user interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-04-03
AI Technical Summary
Existing intelligent question-answering systems suffer from problems such as weak context management capabilities, low efficiency in loading historical records, insufficient support for streaming responses, and unfriendly interface interactions in the field of contract review, resulting in a poor user experience.
The intelligent question-answering system, which employs dynamic context awareness and incremental loading, generates answers segment by segment through streaming response technology. Combined with dynamic context management and incremental historical loading, it achieves smooth interface display and logical coherence in multi-round question-answering.
It achieves an efficient and smooth user experience, reduces waiting anxiety, improves the naturalness and ease of use of the interaction, and ensures rapid response to long conversation histories and logical coherence of multi-turn Q&A.
Smart Images

Figure CN121786148A_ABST
Abstract
Description
Technical Field
[0001] This invention discloses an intelligent question-answering system and method based on dynamic context awareness and incremental loading, which relates to the fields of artificial intelligence and natural language processing technology. Background Technology
[0002] In recent years, intelligent question-answering systems based on natural language processing have been introduced into the field of contract review, enabling users to quickly extract key information and answer contract-related questions. However, existing intelligent question-answering systems have the following problems:
[0003] Weak context management capabilities: Most systems only support single-turn question and answer, and cannot effectively maintain the context of multi-turn dialogues, resulting in poor question-and-answer coherence.
[0004] Low efficiency in loading history records: Loading all history records at once will put a lot of pressure on the front-end rendering, slow down the response, and affect the user experience.
[0005] Insufficient support for streaming responses: Some systems return all answers at once, requiring users to wait a long time, making it impossible to "generate and display simultaneously".
[0006] The user interface is unfriendly: it lacks features such as intelligent prompts, quick questions, and real-time scrolling, making it inconvenient for users to operate.
[0007] Stiff interactive experience: Most systems adopt a request-response model, where users have to wait for the model to generate an answer before they can see the content. The waiting time is long and the experience is not smooth. Summary of the Invention
[0008] This invention addresses the problems of existing technologies by providing an intelligent question-answering system and method based on dynamic context awareness and incremental loading. It solves problems such as response delay, context loss, poor historical loading performance, and unfriendly interaction in existing technologies, thereby achieving an efficient, smooth, and intelligent contract review assistance experience.
[0009] The specific solution proposed in this invention is as follows:
[0010] This invention also provides an intelligent question-answering method based on dynamic context awareness and incremental loading, creating an intelligent question-answering system based on dynamic context awareness and incremental loading. The system includes a front-end interaction module, a back-end service processing module, a context awareness and management module, and a dialogue history management module.
[0011] The front-end interaction module receives user input or quick questions regarding the target contract, encapsulates the user's input, and sends a request to the back-end service processing module via SSE.
[0012] The backend service processing module receives the request and initializes the context for the new session or associates it with the recent context through the context awareness and management module. It then calls the large language model API to generate the answer segment by segment using the model. The answer content is gradually returned to the backend service processing module in the form of a stream. The backend service processing module then pushes the answer content to the frontend interaction module through an SSE connection.
[0013] The front-end interaction module's fetchEventSource library listens for answer content in block format and continuously concatenates it with variables that receive streaming data. The MarkdownIt library is used to convert Markdown text to HTML in real time and render it to the page. The interface automatically scrolls to the bottom to display the latest content.
[0014] Once the answer has been generated, the backend service processing module sends a termination signal, and the frontend interaction module, upon receiving the termination signal, closes the current SSE connection.
[0015] The question and answer records are stored in the database by the dialogue history management module.
[0016] Furthermore, in the aforementioned intelligent question-answering method based on dynamic context awareness and incremental loading, the front-end interaction module provides an interface to display the contract name and initial guidance prompts, guiding users to click on the initial guidance prompt questions or enter questions in the input box.
[0017] Furthermore, in the aforementioned intelligent question-answering method based on dynamic context awareness and incremental loading, the front-end interaction module receives follow-up questions from the user and sends a request to the back-end service processing module. The back-end service processing module incorporates the previous round of question-answering into the context through the context awareness and management module and sends it to the large language model, which then continues to generate answers segment by segment.
[0018] Furthermore, in the aforementioned intelligent question-answering method based on dynamic context awareness and incremental loading, the front-end interaction module provides an interface for users to scroll up and browse the conversation. When scrolling to the top, a scrolling event is triggered, the front-end interaction module calculates the offset, requests the conversation history management module to load 10 earlier historical records, and seamlessly inserts them at the beginning of the current history list.
[0019] Furthermore, in the intelligent question-answering method based on dynamic context awareness and incremental loading, if a new session is generated, the front-end interaction module sends a request to the back-end, the context awareness and management module clears the context cache of the current dialogue, the front-end interaction module resets the interface, displays the initial guidance prompt, and starts a new round of independent sessions.
[0020] This invention also provides an intelligent question-answering system based on dynamic context awareness and incremental loading, including a front-end interaction module, a back-end service processing module, a context awareness and management module, and a dialogue history management module.
[0021] The front-end interaction module receives user input or quick questions regarding the target contract, encapsulates the user's input, and sends a request to the back-end service processing module via SSE.
[0022] The backend service processing module receives the request and initializes the context for the new session or associates it with the recent context through the context awareness and management module. It then calls the large language model API to generate the answer segment by segment using the model. The answer content is gradually returned to the backend service processing module in the form of a stream. The backend service processing module then pushes the answer content to the frontend interaction module through an SSE connection.
[0023] The front-end interaction module's fetchEventSource library listens for answer content in block format and continuously concatenates it with variables that receive streaming data. The MarkdownIt library is used to convert Markdown text to HTML in real time and render it to the page. The interface automatically scrolls to the bottom to display the latest content.
[0024] Once the answer has been generated, the backend service processing module sends a termination signal, and the frontend interaction module, upon receiving the termination signal, closes the current SSE connection.
[0025] The question and answer records are stored in the database by the dialogue history management module.
[0026] Furthermore, in the aforementioned intelligent question-answering system based on dynamic context awareness and incremental loading, the front-end interaction module provides an interface displaying the contract name and initial guidance prompts, guiding users to click on the initial guidance prompt questions or enter questions in the input box.
[0027] Furthermore, in the aforementioned intelligent question-answering system based on dynamic context awareness and incremental loading, the front-end interaction module receives follow-up questions from the user and sends a request to the back-end service processing module. The back-end service processing module incorporates the previous round of question-answering into the context through the context awareness and management module and sends it to the large language model, which then continues to generate answers segment by segment.
[0028] Furthermore, in the aforementioned intelligent question-answering system based on dynamic context awareness and incremental loading, the front-end interaction module provides an interface for users to scroll up and browse the conversation. When scrolling to the top, a scrolling event is triggered, the front-end interaction module calculates the offset, requests the conversation history management module to load 10 earlier historical records, and seamlessly inserts them at the beginning of the current history list.
[0029] Furthermore, in the intelligent question-answering system based on dynamic context awareness and incremental loading, if a new session is generated, the front-end interaction module sends a request to the back-end, the context awareness and management module clears the context cache of the current dialogue, the front-end interaction module resets the interface, displays the initial guidance prompt, and starts a new round of independent sessions.
[0030] The advantages of the method of the present invention are:
[0031] Achieving a smooth user experience: Through Streaming Response (SSE) technology, answers are output in real time, word by word, greatly reducing user anxiety while waiting and improving the smoothness and naturalness of the interaction.
[0032] Ensuring the coherence of the dialogue: By adopting a dynamic context management mechanism, the system can "remember" the content of recent dialogues, making the logic between multiple rounds of question and answer coherent and enabling the model to generate more accurate questions and answers based on the complete context.
[0033] High-performance data processing: The incremental history loading mechanism avoids the pressure on front-end performance and network bandwidth caused by loading a large amount of data at once, ensuring that the interface remains responsive even when faced with contracts with long dialogue histories.
[0034] Lowering the barrier to entry for users: By providing preset contract questions as a quick entry point for asking questions, the system effectively guides users and inspires them to ask questions. It is especially suitable for non-professional users to get started quickly, thus improving the ease of use and practicality of the system.
[0035] Enhanced interactive intelligence: Users have control over the answer generation process and can stop it at any time, enhancing the initiative and flexibility of the interaction. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0038] Example 1
[0039] This invention also provides an intelligent question-answering method based on dynamic context awareness and incremental loading, creating an intelligent question-answering system based on dynamic context awareness and incremental loading. The system includes a front-end interaction module, a back-end service processing module, a context awareness and management module, and a dialogue history management module.
[0040] The front-end interactive module can use a dynamic session container: using virtual scrolling technology, it only renders the history of conversations in the visible area, reducing content footprint by 80%.
[0041] It uses a streaming rendering engine based on the Markdown-it plugin to parse fragment data pushed by SSE in real time and supports incremental rendering of tables, lists and code blocks;
[0042] Using an interrupt controller, interrupt requests are made through the AbortController API. After an interrupt, the "history completion" process is automatically triggered to avoid data loss.
[0043] The backend service processing module mainly uses a contract parsing engine, which is based on a pre-trained natural language processing model to identify entities in the contract, such as parties, time limits, and logical relationships between clauses.
[0044] Use a streaming response generator to convert the parsed results into structured text such as Markdown tables, segment them by sentence boundaries, and push them out in packets.
[0045] Using session state management, an independent session snapshot is maintained for each contract ID, storing generated content, user breakpoints, and follow-up context, and supporting resume download.
[0046] At the data storage layer, a hot-data tiered storage system is implemented: recent conversations are stored in a Redis cache, while historical data is archived to MongoDB to improve query efficiency.
[0047] At the same time, a compressed indexing mechanism can be used: an inverted index can be created for repetitive contract clauses to reduce response time for the same issues.
[0048] The specific process of intelligent question answering is as follows:
[0049] The front-end interaction module provides an interface that displays the contract name and initial guidance prompts, guiding users to click on the initial guidance prompt questions or enter questions in the input boxes.
[0050] The front-end interaction module receives user input or quick questions regarding the target contract, encapsulates the user's input, and sends a request to the back-end service processing module via SSE.
[0051] The backend service processing module receives the request and initializes the context for the new session or associates it with the recent context through the context awareness and management module. It then calls the large language model API to generate the answer segment by segment using the model. The answer content is gradually returned to the backend service processing module in the form of a stream. The backend service processing module then pushes the answer content to the frontend interaction module through an SSE connection.
[0052] The front-end interaction module's fetchEventSource library listens for answer content in block format and continuously concatenates it with variables that receive streaming data. The MarkdownIt library is used to convert Markdown text to HTML in real time and render it to the page. The interface automatically scrolls to the bottom to display the latest content.
[0053] Once the answer has been generated, the backend service processing module sends a termination signal, and the frontend interaction module, upon receiving the termination signal, closes the current SSE connection.
[0054] The question and answer records are stored in the database by the dialogue history management module.
[0055] The front-end interaction module can also receive follow-up questions from users and send requests to the back-end service processing module. The back-end service processing module incorporates the previous round of questions and answers into the context through the context awareness and management module and sends it to the large language model, which then continues to generate answers segment by segment.
[0056] The front-end interaction module provides an interface for users to scroll up and browse the conversation. When scrolling to the top, a scroll event is triggered. The front-end interaction module calculates the offset, requests the conversation history management module to load 10 earlier historical records, and seamlessly inserts them in front of the current history list.
[0057] If a new session is generated, the front-end interaction module sends a request to the back-end, the context awareness and management module clears the context cache of the current conversation, the front-end interaction module resets the interface, displays the initial guidance prompt, and starts a new independent session.
[0058] Example 2
[0059] This invention also provides an intelligent question-answering system based on dynamic context awareness and incremental loading, including a front-end interaction module, a back-end service processing module, a context awareness and management module, and a dialogue history management module.
[0060] The front-end interaction module receives user input or quick questions regarding the target contract, encapsulates the user's input, and sends a request to the back-end service processing module via SSE.
[0061] The backend service processing module receives the request and initializes the context for the new session or associates it with the recent context through the context awareness and management module. It then calls the large language model API to generate the answer segment by segment using the model. The answer content is gradually returned to the backend service processing module in the form of a stream. The backend service processing module then pushes the answer content to the frontend interaction module through an SSE connection.
[0062] The front-end interaction module's fetchEventSource library listens for answer content in block format and continuously concatenates it with variables that receive streaming data. The MarkdownIt library is used to convert Markdown text to HTML in real time and render it to the page. The interface automatically scrolls to the bottom to display the latest content.
[0063] Once the answer has been generated, the backend service processing module sends a termination signal, and the frontend interaction module, upon receiving the termination signal, closes the current SSE connection.
[0064] The question and answer records are stored in the database by the dialogue history management module.
[0065] The information interaction and execution process between the modules in the above system are based on the same concept as the method embodiment of the present invention, and the specific details can be found in the description in the method embodiment of the present invention, and will not be repeated here.
[0066] Similarly, the advantages of the system of the present invention are:
[0067] Achieving a smooth user experience: Through Streaming Response (SSE) technology, answers are output in real time, word by word, greatly reducing user anxiety while waiting and improving the smoothness and naturalness of the interaction.
[0068] Ensuring the coherence of the dialogue: By adopting a dynamic context management mechanism, the system can "remember" the content of recent dialogues, making the logic between multiple rounds of question and answer coherent and enabling the model to generate more accurate questions and answers based on the complete context.
[0069] High-performance data processing: The incremental history loading mechanism avoids the pressure on front-end performance and network bandwidth caused by loading a large amount of data at once, ensuring that the interface remains responsive even when faced with contracts with long dialogue histories.
[0070] Lowering the barrier to entry for users: By providing preset contract questions as a quick entry point for asking questions, the system effectively guides users and inspires them to ask questions. It is especially suitable for non-professional users to get started quickly, thus improving the ease of use and practicality of the system.
[0071] Enhanced interactive intelligence: Users have control over the answer generation process and can stop it at any time, enhancing the initiative and flexibility of the interaction.
[0072] It should be noted that not all steps and modules in the above processes and system structures are mandatory; some steps or modules can be omitted as needed. The execution order of each step is not fixed and can be adjusted as required. The system structures described in the above embodiments can be physical or logical structures. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.
[0073] The above-described embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention. The scope of protection of the present invention is defined by the claims.
Claims
1. An intelligent question-answering method based on dynamic context awareness and incremental loading, characterized by: Create an intelligent question-answering system based on dynamic context awareness and incremental loading. The system includes a front-end interaction module, a back-end service processing module, a context awareness and management module, and a dialogue history management module. The front-end interaction module receives user input or quick questions regarding the target contract, encapsulates the user's input, and sends a request to the back-end service processing module via SSE. The backend service processing module receives the request and initializes the context for the new session or associates it with the recent context through the context awareness and management module. It then calls the large language model API to generate the answer segment by segment using the model. The answer content is gradually returned to the backend service processing module in the form of a stream. The backend service processing module then pushes the answer content to the frontend interaction module through an SSE connection. The front-end interaction module's fetchEventSource library listens for answer content in block format and continuously concatenates it with variables that receive streaming data. The MarkdownIt library is used to convert Markdown text to HTML in real time and render it to the page. The interface automatically scrolls to the bottom to display the latest content. Once the answer has been generated, the backend service processing module sends a termination signal, and the frontend interaction module, upon receiving the termination signal, closes the current SSE connection. The question and answer records are stored in the database by the dialogue history management module.
2. The intelligent question-answering method based on dynamic context awareness and incremental loading as described in claim 1, characterized in that the front end... The interactive module provides an interface that displays the contract name and initial guidance prompts, guiding users to click on the initial guidance prompt questions or enter questions in the input boxes.
3. The intelligent question-answering method based on dynamic context awareness and incremental loading as described in claim 1, characterized in that the front end... The interaction module receives follow-up questions from the user and sends a request to the backend service processing module. The backend service processing module incorporates the previous round of questions and answers into the context through the context awareness and management module and sends it to the large language model. The large language model then continues to generate answers segment by segment.
4. The intelligent question-answering method based on dynamic context awareness and incremental loading as described in claim 1, characterized in that the front end... The interaction module provides an interface for users to scroll up and browse the conversation. When scrolling to the top, a scroll event is triggered. The front-end interaction module calculates the offset, requests the conversation history management module to load 10 earlier historical records, and seamlessly inserts them in front of the current history list.
5. The intelligent question-answering method based on dynamic context awareness and incremental loading according to claim 1, characterized in that: If a new session is generated, the front-end interaction module sends a request to the back-end, the context awareness and management module clears the context cache of the current conversation, the front-end interaction module resets the interface, displays the initial guidance prompt, and starts a new independent session.
6. An intelligent question-answering system based on dynamic context awareness and incremental loading, characterized by: It includes a front-end interaction module, a back-end service processing module, a context awareness and management module, and a dialogue history management module. The front-end interaction module receives user input or quick questions regarding the target contract, encapsulates the user's input, and sends a request to the back-end service processing module via SSE. The backend service processing module receives the request and initializes the context for the new session or associates it with the recent context through the context awareness and management module. It then calls the large language model API to generate the answer segment by segment using the model. The answer content is gradually returned to the backend service processing module in the form of a stream. The backend service processing module then pushes the answer content to the frontend interaction module through an SSE connection. The front-end interaction module's fetchEventSource library listens for answer content in block format and continuously concatenates it with variables that receive streaming data. The MarkdownIt library is used to convert Markdown text to HTML in real time and render it to the page. The interface automatically scrolls to the bottom to display the latest content. Once the answer has been generated, the backend service processing module sends a termination signal, and the frontend interaction module, upon receiving the termination signal, closes the current SSE connection. The question and answer records are stored in the database by the dialogue history management module.
7. The intelligent question-answering system based on dynamic context awareness and incremental loading according to claim 6, characterized in that the front end... The interactive module provides an interface that displays the contract name and initial guidance prompts, guiding users to click on the initial guidance prompt questions or enter questions in the input boxes.
8. The intelligent question-answering system based on dynamic context awareness and incremental loading according to claim 6, characterized in that the front end... The interaction module receives follow-up questions from the user and sends a request to the backend service processing module. The backend service processing module incorporates the previous round of questions and answers into the context through the context awareness and management module and sends it to the large language model. The large language model then continues to generate answers segment by segment.
9. The intelligent question-answering system based on dynamic context awareness and incremental loading according to claim 6, characterized in that the front end... The interaction module provides an interface for users to scroll up and browse the conversation. When scrolling to the top, a scroll event is triggered. The front-end interaction module calculates the offset, requests the conversation history management module to load 10 earlier historical records, and seamlessly inserts them in front of the current history list.
10. The intelligent question-answering system based on dynamic context awareness and incremental loading according to claim 6, characterized in that: If a new session is generated, the front-end interaction module sends a request to the back-end, the context awareness and management module clears the context cache of the current conversation, the front-end interaction module resets the interface, displays the initial guidance prompt, and starts a new independent session.