Intelligent agent collaborative multi-source retrieval enhanced generation method and device and medium
By using an agent-coordinated multi-source retrieval-enhanced generation method, the problem of existing technologies being unable to dynamically select knowledge sources and evaluate retrieval results in military scenarios is solved, achieving highly reliable military task generation that is suitable for military simulations and battlefield decision support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN TECH UNIV
- Filing Date
- 2026-01-13
- Publication Date
- 2026-04-21
AI Technical Summary
Existing retrieval-enhanced generation methods cannot meet the needs of professional military scenarios, especially in complex military tasks involving multimodal information, multi-level intents, and cross-knowledge source dependencies. They cannot dynamically select the most suitable knowledge source and lack quality assessment of retrieval results, leading to inaccurate and unreliable generated content.
An agent-cooperative multi-source retrieval enhancement generation method is adopted. The first agent determines whether retrieval is needed, decomposes the task into sub-tasks, and uses vector databases, knowledge graphs and relational databases to extract and select semantic features. The retrieval results are evaluated by combining semantic similarity and military knowledge relevance. A closed-loop generation mechanism is constructed to ensure the reliability of the generated results.
It achieves highly reliable generation of military missions, significantly improves the accuracy and consistency of the generated results, reduces the risk of misleading knowledge and information deviation, and is suitable for military simulations and battlefield decision support.
Smart Images

Figure CN121903006A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of retrieval enhancement generation technology, and in particular to a method, device and medium for intelligent agent collaborative multi-source retrieval enhancement generation. Background Technology
[0002] As large-scale language models are increasingly used in text generation, reasoning analysis, and task planning, the reliability, interpretability, and traceability of model outputs are becoming crucial requirements for high-risk industries. Traditional language models primarily rely on their internal parameter memory, making it difficult to provide reliable outputs in military scenarios where accuracy is paramount. Therefore, Retrieval Augmented Generation (RAG) has become an important approach to improving model reliability. Its core idea is to provide factual context through external knowledge base retrieval before large-scale model generation. In practical applications, standard RAG supported by vector libraries can satisfy most semantic matching tasks, while knowledge graphs can support structured reasoning tasks, and relational databases excel at performing rule-based, precise parameter queries.
[0003] However, in real-world mission scenarios, user queries often contain multimodal information, multi-level intents, and even cross-knowledge source dependencies. Existing technologies generally only have a single retrieval mechanism, unable to dynamically select the most suitable knowledge source, unable to determine whether a retrieval is necessary, and lack a mechanism for evaluating the quality of retrieval results. Especially in highly complex military fields such as military simulations, operational scenario generation, and force system reasoning, tasks often involve multi-hop logical relationships, cross-attribute chains, and hierarchical command chain dependencies; standard RAGs perform poorly in such scenarios. Summary of the Invention
[0004] The purpose of this invention is to provide an intelligent agent collaborative multi-source retrieval enhancement generation method, device and medium, which can solve the problem that existing retrieval enhancement generation methods cannot meet the needs of professional military scenarios.
[0005] To address the aforementioned technical problems, embodiments of the present invention provide an agent-cooperative multi-source retrieval enhancement generation method, comprising the following steps: Obtain military query tasks input by the user; The first intelligent agent determines whether a military query task needs to be retrieved based on the Self-RAG reflection mechanism. If a retrieval is required, the military query task is decomposed into multiple sub-tasks based on the CoT mind chain. Otherwise, the answer is directly generated by inputting the military big model. For each subtask, the semantic features of the subtask are extracted by the second intelligent agent, and the corresponding retrieval knowledge base is selected for the subtask based on the semantic features. The retrieval knowledge base includes a vector database, a knowledge graph, and a relational database. The vector database contains semantic vectors of military knowledge, the knowledge graph contains graph structure representations of military knowledge, and the relational database contains military normative constraints of military knowledge. After obtaining the retrieval results for each subtask through the selected retrieval knowledge base, a third intelligent agent determines whether a re-retrieval is needed based on the semantic similarity and military knowledge relevance between each retrieval result and its subtask, as well as the supporting value of each retrieval result for its subtask. If a new search is required, the military intent of the military query task is reconstructed. After obtaining a new military query task, the above steps are repeated to obtain the target search results.
[0006] Furthermore, after selecting the corresponding retrieval knowledge base for the sub-task based on semantic features, the method further includes: If the selected retrieval knowledge base is a vector database, then the military intent of the sub-task is parsed, and the semantic features of the parsed military intent are extracted. Obtain the cosine similarity between the semantic features of military intentions and the semantic vectors of all military knowledge in the vector database, and sort all military knowledge in the vector database in descending order based on all cosine similarities; The first preset number of military knowledge items, sorted in descending order, are selected as candidate search results for the subtask; among them, all military knowledge items selected in the candidate search results are weighted using an attention mechanism. The semantic features of military intent, auxiliary military background knowledge, and candidate search results are combined. The military big data model is used to generate retrieval results for sub-tasks based on the spliced results.
[0007] Furthermore, the semantic vectors of all military knowledge in the vector database are obtained using the BGE model, and the BGE model is trained using contrastive learning.
[0008] Furthermore, the knowledge graph includes a graph structure index and a semantic vector index.
[0009] Furthermore, after selecting the corresponding retrieval knowledge base for the sub-task based on semantic features, the method further includes: If the selected retrieval knowledge base is a knowledge graph, the subtask is decomposed into local keywords and global keywords. Local keywords are aligned with the patterns of attributes, models, and parameters of entities in the knowledge graph, while global keywords are aligned with the patterns of structures and relationships in the knowledge graph. Based on the semantic vector index, a nearest neighbor search is performed on local keywords in the knowledge graph to obtain multiple candidate semantic vectors. Based on the graph structure index, global keywords are matched in the knowledge graph to obtain multiple candidate graph structures. After performing 1-hop structure expansion on each candidate graph structure, the semantic chain of each candidate graph structure is extracted to obtain the path representation; Candidate graph structures are selected based on the semantic similarity among all path representations; The military big data model is used to generate retrieval results for subtasks based on the selected candidate semantic vectors, candidate graph structures, and corresponding structural contexts.
[0010] Furthermore, after selecting the corresponding retrieval knowledge base for the sub-task based on semantic features, the method further includes: If the selected retrieval knowledge base is a relational database, then extract the structured retrieval elements of the subtask, including the target entity, query attributes, and constraints. Based on the relational database schema, a semantic similarity matching strategy is used to locate the target table related to the target entity and the fields corresponding to the query attributes in the relational database; Combine the target table, fields, and constraints to generate an SQL query statement; Multiple candidate search results can be obtained by querying a relational database using SQL queries; After performing consistency checks on all candidate search results, the search results for the sub-tasks are generated using a large military model.
[0011] Furthermore, the relational database includes the following military normative constraints: equipment performance indicators, organizational affiliation of combat units, behavioral rules for equipment and combat, and simulation environment configuration.
[0012] Furthermore, the military knowledge in the retrieval knowledge base is obtained by acquiring it from a pre-set encyclopedia website and performing structured processing.
[0013] Embodiments of the present invention also provide a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described agent-cooperative multi-source retrieval enhancement generation method.
[0014] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described agent-cooperative multi-source retrieval enhancement generation method.
[0015] The agent-cooperative multi-source retrieval enhancement generation method provided by this invention has at least the following beneficial effects: This invention constructs a three-tiered, functionally decoupled, and collaboratively autonomous intelligent agent system: a first agent for task parsing and decomposition, a second agent for retrieval scheduling, and a third agent for evaluation and feedback. The first agent is responsible for task semantic understanding, retrieval requirement prediction, and sub-task decomposition, preventing unnecessary retrieval from introducing noise at the source and ensuring that the hierarchical structure of complex military tasks is explicitly expressed. The second agent dynamically schedules three heterogeneous military knowledge bases—relational databases, knowledge graphs, and vector databases—solving the problem of traditional systems struggling to select knowledge sources based on task characteristics. The third agent evaluates the semantic consistency, military knowledge link relevance, and generation usability of the retrieval results, suppressing military illusions, erroneous tactical information, and unreliable content from entering the generation link at the mechanism level, achieving quantitative control over generation reliability. These three retrieval knowledge bases constitute a military expertise foundation lacking in general-purpose large models, directly compensating for the systemic deficiencies of large models in terms of military knowledge scarcity, reasoning bias, and illusions.
[0016] Meanwhile, the closed-loop generation mechanism proposed in this invention, which involves "predicting whether retrieval is needed—task decomposition—task retrieval—retrieval evaluation—re-retrieval," is no longer limited to the linear retrieval mode of traditional RAGs. Instead, it can adjust the search and generation paths in real time based on task progress and retrieval quality, achieving a reasoning logic similar to that of human military staff members: "repeated verification—checking—supplementing information." This mechanism can effectively reduce problems such as misleading knowledge, information deviation, and broken reasoning links in military task generation, fundamentally improving the rigor, consistency, and credibility of task generation results.
[0017] In summary, this invention aims to address the problem that existing RAG technology cannot meet the needs of professional military scenarios by constructing a military-specific knowledge base system, introducing three types of collaborative intelligent agents and three different retrieval types of intelligent agent architecture, and building a closed-loop adaptive task generation mechanism. It realizes a highly reliable intelligent retrieval enhancement generation method that can be used in high-risk scenarios such as military simulations, battlefield decision support, and combat mission planning. It can not only significantly improve the accuracy and controllability of military knowledge application, but also effectively eliminate the illusion and knowledge bias of large models in military missions, and has important military value and engineering significance. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0019] Figure 1A flowchart illustrating an intelligent agent collaborative multi-source retrieval enhancement generation method provided by the present invention; Figure 2 A schematic diagram of an unstructured data analysis and processing architecture provided by the present invention; Figure 3 A schematic diagram of an intelligent agent collaborative multi-source retrieval enhancement generation framework based on a military knowledge base provided by the present invention; Figure 4 This invention provides a schematic diagram of the Agent-A workflow; Figure 5 This invention provides a schematic diagram of dynamic scheduling of Agent-B multi-source knowledge base; Figure 6 This is a schematic diagram of an Agent-C search result evaluation process provided by the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0021] In existing technologies, the most common and closest to this invention is the standard RAG system based on vector databases. This system primarily vectorizes user queries and knowledge documents, performs similarity retrieval, and then injects the retrieval results into a large model for generation. While this approach can handle semantic matching tasks, it cannot reason about structured relationships and fails to meet the stringent requirements of rule-based data and logical chains in specialized fields such as military applications. Furthermore, this approach performs retrieval on all queries without a mechanism to determine the necessity of the query, leading to a large amount of unnecessary retrieval noise entering the generation process. In contrast, single-vector database solutions only focus on surface text similarity, failing to identify the underlying intent of the task and lacking the ability to handle cross-attribute and cross-node relationships.
[0022] Another type of existing technology is the knowledge graph-based retrieval and reasoning method, which achieves relational reasoning through graph node matching and path expansion. While this technology is suitable for hierarchical relation analysis, its limitations include limited expressive power, poor handling of fuzzy descriptions in natural language, and inability to cover parametric problems. Because knowledge graphs often contain incomplete information, retrieval paths are interrupted when relationships between nodes are not fully established, and existing technologies do not provide retrieval compensation mechanisms. Furthermore, knowledge graphs struggle to handle the expressiveness issues of language models and cannot meet the demands of multimodal knowledge fusion.
[0023] Another related technology is the Self-RAG framework, which can predict whether a search is needed based on the query content, thereby reducing invalid searches. However, Self-RAG only provides a binary classification of "search" and "don't search," and cannot perform dynamic selection on multi-source knowledge bases, nor does it have the ability to evaluate search results, filter erroneous knowledge, or perform closed-loop re-search.
[0024] Therefore, the shortcomings of existing technologies are mainly reflected in the following aspects: lack of automated, multi-source knowledge base selection capabilities; lack of ability to evaluate the reliability, relevance, and usability of search results; lack of a multi-round iterative closed-loop optimization mechanism; and inability to decompose tasks into sub-tasks, resulting in a mismatch between retrieval and task objectives. These shortcomings stem from the fact that most existing technologies are based on a single search mode, a single-step search process, or a static knowledge source selection mechanism, which cannot adapt to the dynamic needs of complex, high-precision tasks for knowledge retrieval.
[0025] Against this backdrop, there is an urgent need for an intelligent retrieval enhancement system that can automatically predict retrieval needs, automatically select multi-source knowledge bases, automatically evaluate the effectiveness of knowledge, and has closed-loop optimization capabilities, in order to solve the disconnect between retrieval and generation in existing technologies.
[0026] To overcome the significant shortcomings of existing technologies in complex task generation and military knowledge processing, this invention proposes a multi-agent collaborative retrieval enhancement generation method and system based on a military knowledge base. This invention aims to address five major technical pain points widely exhibited by current large-scale models in the military field: "inability to determine whether a task requires retrieval," "inability to dynamically select from multiple knowledge bases according to the task," "inability to quantitatively evaluate retrieved knowledge," "lack of reliability verification for generated content," and "lack of closed-loop control between retrieval and generation." Furthermore, in military scenarios, general-purpose large-scale models, due to a lack of specialized military knowledge, data scarcity, and insufficient reasoning links, often exhibit illusions such as knowledge confusion, logical errors, and deviations from tactical principles, making it difficult to meet the stringent requirements of high-reliability scenarios such as military simulations, battlefield situation assessment, and mission planning. This invention provides a systematic solution to these core deficiencies.
[0027] The technical solutions provided by the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0028] One embodiment of the present invention relates to an agent-cooperative multi-source retrieval enhancement generation method. The specific process of the agent-cooperative multi-source retrieval enhancement generation method in this embodiment can be as follows: Figure 1 As shown, it includes: Step 101: Obtain the military query task input by the user.
[0029] Step 102: The first intelligent agent determines whether the military query task needs to be retrieved based on the Self-RAG reflection mechanism. If retrieval is required, the military query task is decomposed into multiple sub-tasks based on the CoT (Cooperative Thought Chain). Otherwise, the answer is directly generated by inputting the military big model.
[0030] Step 103: For each subtask, the semantic features of the subtask are extracted by the second intelligent agent, and the corresponding retrieval knowledge base is selected for the subtask based on the semantic features; wherein, the retrieval knowledge base includes a vector database, a knowledge graph and a relational database, the vector database contains semantic vectors of military knowledge, the knowledge graph contains graph structure representations of military knowledge, and the relational database contains military normative constraints of military knowledge.
[0031] Step 104: After obtaining the retrieval results for each subtask through the selected retrieval knowledge base, the third agent determines whether a re-retrieval is needed based on the semantic similarity and military knowledge relevance between each retrieval result and its subtask, as well as the supporting value of each retrieval result for its subtask.
[0032] Step 105: If a new search is required, the military intent of the military query task is reconstructed. After obtaining a new military query task, steps 102 to 104 are repeated to obtain the target search results.
[0033] The following is a detailed description of the implementation details of the intelligent agent collaborative multi-source retrieval enhancement generation method in this embodiment. The following content is only for the convenience of understanding and is not necessary for implementing this solution.
[0034] First, the construction of the three retrieval knowledge bases (i.e., military knowledge bases) will be explained: Step 1: Data Acquisition and Processing. The specific steps are as follows: Step 1.1 involves data acquisition and structured processing, with the following specific steps: Step 1.1.1 Select Wikipedia as the external data source.
[0035] Wikipedia has broad coverage, high update frequency, and good credibility. Introducing this resource can effectively broaden the knowledge scope of the military private domain knowledge base.
[0036] Step 1.1.2 involves generating a large model with suggested engineering optimizations, converting military-related data from Wikipedia into strictly structured text to ensure that the content is standardized, consistent, and suitable for subsequent knowledge extraction processes.
[0037] Step 1.2 Parsing and structuring unstructured data.
[0038] For text, logs, and free-format documents from internal systems, a holistic technical approach of "data collection—data governance—semantic parsing—knowledge fusion—dynamic optimization" is adopted to transform unstructured text into structured knowledge, thereby meeting the needs of the operational decision-making system. Figure 2 As shown.
[0039] Specifically, the following four steps are involved: Step 1.2.1 Use BeautifulSoup to parse the HTML / XML document and use regular expressions to remove redundant tags, links and other noisy content; standardize key fields such as dates, numbers and equipment models, for example, unify various dates into YYYY-MM-DD format.
[0040] Step 1.2.2: Parse the semi-structured data.
[0041] A customized parser was designed for semi-structured data such as simulation platform logs and command system protocol messages. Key information fields were extracted and converted into a unified structured format to ensure consistent representation of semi-structured data from different sources.
[0042] Step 1.2.3 Perform deduplication and anomaly detection on the data.
[0043] The system employs a dual deduplication strategy: first, it generates hash values based on the URL and title for fast deduplication; then, it uses text similarity detection to identify semantically similar duplicate content; for numerical fields, it uses the 3σ principle to remove outliers; and it performs a missing rate check on text records to delete severely missing data items.
[0044] Step 1.2.4 Military terminology mapping and semantic normalization.
[0045] Construct a dedicated mapping dictionary for the military field to achieve a unified mapping of codes and abbreviations to standard terms; convert specific codes used in internal systems into general professional names to ensure semantic consistency of knowledge across the entire domain and improve the accuracy of subsequent analysis and reasoning.
[0046] Step 1.3 Optimizes large-scale military data based on prompting engineering. Utilizing the knowledge compression capabilities of the pre-trained large-scale model, it automatically identifies and completes missing key information in the text based on the military context, including battle background, equipment names, and event elements, thereby improving the completeness and authenticity of the military data. Specific steps are as follows:
[0047] Step 1.3.1 Provides prompts for the military expert role in the engineering construction. To enable the large model to process military data from a professional perspective, prompts for the military expert role are designed. Given a military dataset with questionable authenticity:
[0048] For each data Construct the corresponding prompt text: Step 1.3.2 Large model performs military text structuring generation and correction.
[0049] Input the above prompts into the large LLM model, and the model will perform structured optimization of the military content based on the prompts: This outputs formatted and completed military knowledge units.
[0050] Step 2 involves constructing a military knowledge base, which mainly consists of three different database types: vector database, knowledge graph database, and relational database.
[0051] The steps for building three different types of knowledge bases are as follows: Step 2.1 Vector library construction.
[0052] To enable military texts to be understood by computing systems, the content needs to be converted into a numerical vector representation. This step uses BGE (BAAI General Embedding) as the embedding model to vectorize the knowledge base text. This model can capture deep semantic information of the text and map it to a high-dimensional vector space, while the vector dimension is relatively small, which helps reduce subsequent retrieval costs. The specific steps are as follows:
[0053] Step 2.1.1 Training structure and semantic modeling mechanism of BGE embedding model.
[0054] As a general embedding model, BGE employs a three-stage training strategy to enhance semantic representation capabilities through high-quality text from multiple sources.
[0055] Step 2.1.1.1 Pre-training phase (Masked Language Modeling).
[0056] Use normal text and its randomly masked version The training objectives for encoder Enc and decoder Dec are as follows: This enables the encoder to obtain robust text semantic representations, laying the foundation for subsequent embedding tasks.
[0057] Step 2.1.1.2 General fine-tuning stage (unlabeled comparative learning).
[0058] Using unlabeled paired text and Training is performed to optimize the embedding space using a contrastive learning approach, with the objective function being: in, For the negative sample set, This is the temperature coefficient.
[0059] By selecting high-quality negative samples from a large batch of samples, the model's ability to distinguish different text semantics is improved.
[0060] Step 2.1.1.3 Task-specific fine-tuning phase (labeled paired samples).
[0061] Further training on labeled paired data with clear semantic relationships enhances the model's ability to distinguish texts in specific military missions or domains, thereby improving the overall quality of the embedding representation.
[0062] Step 2.1.2 Vector generation and local vector library storage.
[0063] Step 2.1.2.1 Embedding generation.
[0064] Using the trained BGE embedding model, the text resources in the military knowledge base are localized to obtain high-dimensional vectors representing semantic features.
[0065] Step 2.1.2.2 Vector database construction.
[0066] We use FAISS (Facebook AI Similarity Search) as a vector database for efficient indexing and similarity retrieval of high-dimensional vectors.
[0067] Step 2.1.2.3 Index type and vector standardization.
[0068] In FAISS, IVFFlat is selected as the index structure, and the vectors are standardized to map similarity scores to intervals. This facilitates subsequent retrieval and similarity comparison.
[0069] Step 2.2 Construction of military knowledge graph.
[0070] Step 2.2.1 Military concept modeling and ontology design.
[0071] This step involves abstracting core concepts in the military field and constructing a standardized military ontology model.
[0072] (1) Define the basic concept layer in the military field, including elements such as "combat operations - behavioral nodes - equipment entities - battlefield environment - enemy status changes"; (2) Establish physical systems, such as ships, radars, ammunition, target points, mission units, etc.; (3) Define entity attributes, including range, speed, detection performance, etc.; (4) Design relationship types, such as command relationship, adversarial relationship, constraint relationship, geographical association, etc.
[0073] The above ontology design provides a unified semantic framework for subsequent knowledge extraction and graph structure construction.
[0074] Step 2.2.2 Entity and Relation Extraction.
[0075] Based on preprocessed military text data (tactical documents, operational scripts, training reports, etc.), a large language model optimized for military atlas design is used to automatically extract military knowledge, including: Step 2.2.2.1 Use the Entity Recognition (NER) method to identify combat entities such as equipment name, mission name, geographical location, time sequence nodes, and key parameters.
[0076] Step 2.2.2.2 Extract typical military relationships, including the related structures such as "equipment-target", "mission-resource", and "sensor-target".
[0077] Step 2.2.2.3 Identify complex military action sequences, such as the "discovery-location-strike" chain and the "search-attack-assessment" process, so that the knowledge graph can express dynamic combat processes rather than static information points.
[0078] Step 2.2.3 Knowledge triple generation and graph structure construction.
[0079] The extracted knowledge is organized into a standard RDF triple structure. This step abstracts military knowledge into a graph model:
[0080] ; in, : A collection of entities (equipment, missions, spatial locations, combat units); : Relationship set (command, detection, strike, geographical dependence); : Set of triples.
[0081] The triplet is represented in the form of: By using graph databases (such as Neo4j) to construct triples as nodes and edges, a structured graph representation of military knowledge and high-association modeling can be achieved.
[0082] Step 2.2.4 Graph index construction and semantic vector index integration.
[0083] To support efficient military retrieval and reasoning, this step establishes two types of indexes in the graph database: (1) Structure index: Supports graph computation operations such as multi-path query, link reasoning, and neighborhood expansion; (2) Vector semantic index: Vectorize node descriptions and relation semantics to achieve fast recall based on similarity and support RAG retrieval mechanism with multi-source information fusion.
[0084] Step 2.3 Establishment of the military relations database.
[0085] Step 2.3.1 Design of relational data tables.
[0086] To accurately store quantifiable and strictly consistent structured military data, this step designs multiple types of data tables based on operational modeling requirements, including: (1) Equipment parameter table: Records equipment performance indicators such as speed, load, range, and radar frequency band; (2) Operational Unit Table: Records the fleet structure, formation relationships, and organizational affiliation of each unit; (3) Behavioral rule table: records behavioral constraints such as engagement rules, sensor start / stop logic, and weapon selection strategy; (4) Simulation parameter table: Records the initial state, geographic coordinates, blue / red square parameters and other simulation environment configurations.
[0087] Relational databases serve as structured numerical support for knowledge graphs, ensuring that parameter attributes remain consistent during computation and compensating for the shortcomings of graph structures in constraining numerical consistency.
[0088] Step 2.3.2 Construction of primary and foreign key associations and integrity constraints.
[0089] By using a primary key-foreign key association mechanism, consistency constraints are established for military data, including: maintaining a one-to-one correspondence between equipment entities and their parameter records; maintaining logical consistency between mission records and their sub-behavioral processes; and synchronizing action nodes with time and space constraints.
[0090] The above constraints are formally expressed as functions as follows: (1) Equipment performance constraints: The effective range of the equipment must be less than its maximum performance parameter: ; (2) Task time constraints: The task sequence satisfies both temporal continuity and executableness: ; (3) Geographical flight constraints: The equipment's journey from the origin to the target must be within its maximum operational range: ; Through the aforementioned database constraint mechanism, the reasoning paths of all entities and relations in the knowledge graph can be verified in the relation table, avoiding semantic ambiguity and numerical conflicts.
[0091] Then, a framework for enhanced generation based on military knowledge base and agent collaboration and multi-source retrieval is constructed, such as... Figure 3 As shown, this framework utilizes the three military knowledge bases constructed above to achieve enhanced retrieval generation.
[0092] Regarding the first intelligent agent, AgentA, it determines whether a military query task needs to be retrieved based on the Self-RAG reflection mechanism. If a retrieval is required, it decomposes the military query task into multiple sub-tasks based on the CoT (Cooperation of Thought) mechanism. Otherwise, it directly inputs the military big model to generate an answer.
[0093] Its workflow is as follows: Figure 4 As shown: Step 3.1 Construct the first intelligent agent, Agent A, to decompose the task from the superior's intent or the user's query, and determine whether a retrieval is needed, based on the result, to decide on the subsequent processing method. The specific steps are as follows:
[0094] Step 3.1.1 System obtains input query Its sources include user natural language queries or task intent vectors generated by the superior task planning module.
[0095] Step 3.1.2 Predict search demand based on the Self-RAG reflection mechanism.
[0096] Input Encoded as semantic vectors The token is fed into a generative model that introduces Self-RAG reflection tokens. .
[0097] Step 3.1.3 Model By predicting and reflecting on tokens, we can generate judgments on search needs. ; in, .
[0098] Calculate the retrieval probability: ; when: ; If the result is determined to be "required", proceed to the next step; otherwise, proceed directly to the direct answer path (step 3.1.7).
[0099] Step 3.1.4 Decompose user queries or superior intents based on the CoT (CoT) framework.
[0100] First, use the model Generate inference chains: ; Obtain a set of subtasks.
[0101] Each reasoning step is normalized into an executable subproblem: ; Subtasks have higher semantic certainty and can independently determine retrieval needs.
[0102] Step 3.1.5 For each subproblem Independently perform Self-RAG search demand prediction (inheriting the logic from step 3.1.1) to obtain the corresponding search tags: ; And generate a set: Set to be retrieved: ; No need to retrieve collections: ; Step 3.1.6 Parallel "Dual Path Generation": To improve robustness, when... Located in the near-threshold region (e.g.) ), start two generation paths: Path 1: Direct Answer Path (Non-RAG), directly calls the large language model to generate the answer, without performing a retrieval enhancement generation step: ; Path 2: Retrieval Enhanced Generative Path (RAG), which generates the retrieval results. sub-tasks Both Agent-B and Agent-B are entered together for subsequent operations: ; Regarding the adaptive selection of intelligent agents for multi-source knowledge bases, namely the second intelligent agent Agent-B, for each subtask, it extracts the semantic features of the subtask and selects the corresponding retrieval knowledge base for the subtask based on the semantic features.
[0103] Its workflow is as follows: Figure 5 As shown: Step 3.2 Constructing a multi-source knowledge base for adaptive Agent-B selection, the specific steps are as follows: Step 3.2.1 The system processes the subtasks from Agent-A. Perform semantic parsing to extract the semantic vector representation of the task: ; The parsing results include semantic tags such as task category, dependency structure, information accuracy requirements, and generation goals.
[0104] Step 3.2.2 Based on the semantic parsing results, the system constructs comprehensive features for retrieval source decision-making: ; in, : Task semantic vector; Historical search success rate; Knowledge source reliability score. This feature vector serves as input to the knowledge base selection model.
[0105] Step 3.2.3 The system uses feature vectors The three types of knowledge bases were scored: ; Select the knowledge base type with the highest score: ; Among them, Graph → knowledge graph; Vector → vector database; RDB → relational database. Step 3.2.4 Based on the selection results The system triggers the corresponding retrieval agent.
[0106] The specific retrieval agent is described in step 3.3 below.
[0107] Step 3.3 Construction of the Vector Retrieval Agent: If the selected retrieval knowledge base is a vector database, the military intent of the vector retrieval agent subtask is parsed, and the semantic features of the parsed military intent are extracted. The cosine similarity between the semantic features of the military intent and the semantic vectors of all military knowledge in the vector database is obtained, and all military knowledge in the vector database is sorted in descending order according to all cosine similarities. A predetermined number of military knowledge in the descending order are selected as candidate retrieval results for the subtask. Among them, all military knowledge selected in the candidate retrieval results are weighted using an attention mechanism. The semantic features of the military intent, auxiliary military background knowledge, and candidate retrieval results are concatenated. The military big data model is used to generate the retrieval results of the subtask based on the concatenated results.
[0108] The specific steps are as follows: Step 3.3.1 Fine-grained parsing of query intent: Receive fine-grained military queries (such as "Please give the maximum detection radius of a certain type of early warning aircraft" or "The payload configuration of the Blue Force's 3rd aircraft group in the exercise") from combat personnel or higher-level staff. The semantic parsing module automatically extracts the core military entities, operational attributes, and constraints from the query (such as "Entity: a certain type of early warning aircraft; Attribute: maximum detection radius"), clarifying the fine-grained military information requirements needed for force decision-making.
[0109] Step 3.3.2 Query vector generation employs a "military domain pre-trained semantic encoder" (based on the BERT / LLaMA framework). The military query parsed in step 3.3.1 is semantically encoded to generate a query vector. Formula:
[0110] ; Where q represents the parsed fine-grained military query. (The vector dimension d is consistent with the fine-grained military information vector) to ensure that troop strength queries and fine-grained military knowledge such as combat equipment, tactical actions, and organizational units are in the same semantic space, so as to ensure matching accuracy.
[0111] Step 3.3.3 Semantic similarity calculation (equipment / tactics / troop semantic matching).
[0112] The similarity calculation interface of the military vector database is invoked, using the query vector generated in step 3.3.1. Based on this, calculate its relationship with all fine-grained military information vectors in the database. Cosine similarity: in, To query the degree of association with a specific military information unit (such as weapon parameters, troop size, unit deployment location, and combat node timing), the higher the score, the stronger the military semantic association.
[0113] Step 3.3.4 Filtering Top-K related military fine-grained information based on the similarity score in Step 3.3.3. All military information units are sorted in descending order; the top k (k is a preset parameter, such as 5-20) fine-grained military knowledge units with the highest similarity after sorting are selected to form the retrieval result set. Filtering formula:
[0114] ; in, This represents the k most relevant military details to the query, such as equipment performance, organizational structure, troop deployment, unit coordinates, firepower indicators, command and control links, etc.
[0115] Step 3.3.5 Constraint-based fine-grained military answer generation, the specific steps are as follows: Step 3.3.5.1: Concatenate the search results with the military context of the query using a text concatenation operation. This involves combining the user's military query q, auxiliary military background knowledge (such as "definition of the platform category to which this equipment belongs" and "theater mission background"), and the Top-K search set obtained in Step 3.3.4. Integrate.
[0116] splicing formula: ; Ensure that the final generation process takes into account operational requirements, background environment, and fine-grained military facts obtained from retrieval.
[0117] Step 3.3.5.2 Attention Mechanism-Guided Military Semantic Focus. An attention mechanism is introduced to focus military query vectors... Vector stacking with the search result set :
[0118] Together they serve as the key (K) and value (V) inputs for attention.
[0119] Attention Formula: Here, Q is the query vector for the generation process. This mechanism ensures that the model prioritizes the most critical military information units for the mission when generating combat answers, such as key equipment parameters, troop numbers, combat radius, and action sequences, to avoid misuse of battlefield information due to attention deviation.
[0120] Step 3.3.5.3 Deterministic Decoding Constraints: Avoiding "Illusions" in Military Scenarios. The Language Model (LLM) generates the answer from the concatenated input of Step 3.3.5.1 and sets the following decoding constraints:
[0121] Only select the output with the highest probability; temperature Eliminate randomness and ensure that serious military information is not biased; Final result: ; in, To provide the final, fine-grained military answers, ensure that the output is entirely based on retrieved military facts, avoiding unreliable battlefield information or speculative "illusions".
[0122] Step 3.4 Construction of the Graph Retrieval Agent: If the selected retrieval knowledge base is a knowledge graph, the subtask is decomposed into local keywords and global keywords using the graph retrieval agent. Based on the semantic vector index, a nearest neighbor search is performed on the local keywords in the knowledge graph to obtain multiple candidate semantic vectors. Then, based on the graph structure index, the global keywords are matched in the knowledge graph to obtain multiple candidate graph structures. After performing a 1-hop structure expansion on each candidate graph structure, the semantic chain of each candidate graph structure is extracted to obtain a path representation. Candidate graph structures are then selected based on the semantic similarity between all path representations. Finally, a large-scale military model is used to generate the retrieval results for the subtask based on the selected candidate semantic vectors, candidate graph structures, and their corresponding structural context.
[0123] The specific steps are as follows: Step 3.4.1 Query Decomposition.
[0124] Enter query The keywords can be simplified into two categories: ; Local keywords (align entity attributes, model, parameters); Global keywords (aligning combat structure, relationship patterns).
[0125] Step 3.4.2 performs hybrid graph-vector matching, executing two lightweight matching paths in parallel to quickly locate candidate nodes / triplets: Vector matching (local): Calculate local keyword embedding and nearest neighbor retrieval ; Select several top-k candidate vectors.
[0126] Graph pattern matching (global): Map global keywords to relational schemas ; Match in the graph Matching triples The two types of candidates are merged into a preliminary subgraph candidate set. .
[0127] Step 3.4.3 Higher-order Context Expansion.
[0128] For candidate subgraphs Perform 1-hop structure expansion to ensure context integrity: ; Construct the extended subgraph ,in, .
[0129] Step 3.4.2: Compact Multi-hop Reasoning.
[0130] Lightweight reasoning is performed on the extended subgraph to extract semantic chains. Path representation is defined. (along the path) (aggregate node vector)
[0131] ; Calculate the Path Consistency Score (PCS) to screen for high-quality paths: ; reserve The path forms the final graph context representation. .
[0132] Step 3.4.4 Relational Answer Generation and Deterministic Constraints.
[0133] Expand subgraph With graph context As an enhanced input to a lightweight LLM, it generates relational answers: ; To ensure controllability, deterministic decoding parameters are recommended: .
[0134] Step 3.4.5 Traceability Recording and Output Delivery. Record key items used for generation: retrieval node set, path selection. Thresholds and retrieval parameters form a traceable record. .Will and It can be submitted to Agent-C for final evaluation or directly output to the caller.
[0135] Step 3.5 Construction of a structured retrieval agent based on a relational database: If the selected retrieval knowledge base is a relational database, the structured retrieval elements of the subtask are extracted using the relational database-based structured retrieval agent, including the target entity, query attributes, and constraints. Based on the relational database schema, a semantic similarity matching strategy is used to locate the target table related to the target entity and the fields corresponding to the query attributes in the relational database. Combining the target table, fields, and constraints, an SQL query statement is generated. Multiple candidate retrieval results are obtained by querying the relational database using the SQL query statement. After performing consistency checks on all candidate retrieval results, the retrieval results of the subtask are generated using a large-scale military model.
[0136] The specific steps are as follows: Step 3.5.1 Enter the query Extract structured search elements: ; in, Target entities (such as "early warning aircraft" or "blue force radar station"); Query attributes (such as "maximum detection range" or "deployment location"); Constraints (e.g., "Model = XX", "Time > T"); This step only performs basic parsing of "entity + attribute + constraint" and does not involve graph reasoning or vector matching.
[0137] Step 3.5.2 Table & Column Localization.
[0138] Based on the schema of relational databases Location: Target table related to the entity Fields corresponding to attributes The matching strategy uses a simple semantic similarity calculation:
[0139] Step 3.5.3 can execute SQL construction.
[0140] By combining tables, fields, and query constraints, automatically generate SQL query statements: ; Step 3.5.4 Filter the results, selecting the records retrieved by the SQL search. Perform basic consistency checks, including non-null constraints and type constraints.
[0141] Define a lightweight validity score: ; Output only the results corresponding to valid records: ; Step 3.5.5: Generating structured answers, including valid records. Inputting a lightweight LLM for natural language formatting: ; The output should be a structured response, such as: parameter values of a certain piece of equipment; the affiliation or deployment information of a certain unit; the time, location, and result of a certain event, etc. Step 3.6 Construct Agent-C, the third agent, to evaluate retrieval results. After obtaining the retrieval results for each subtask through the selected retrieval knowledge base, Agent-C determines whether a re-retrieval is needed based on the semantic similarity and military knowledge relevance between each retrieval result and its subtask, as well as the supporting value of each retrieval result for its subtask.
[0142] The specific steps are as follows: Agent-C receives the set of search results output from Vector Search Agent, Graph Search Agent, and Relational Database Search Agent: ; And based on task query vectors Each candidate content is evaluated for quality across multiple dimensions.
[0143] Step 3.6.1 Semantic consistency determination.
[0144] Each search result Encoded as semantic vectors Calculate the cosine similarity between the subtask semantics and the retrieval semantics: ; Step 3.6.2 Knowledge Relevance Assessment.
[0145] Calculate query nodes using the task knowledge graph. With search content nodes Find the shortest path distance and define the relevance score: ; Step 3.6.3 Usability assessment (based on auxiliary LLM verification).
[0146] Agent-C will retrieve the content. Injecting a lightweight language model Generate preliminary task answers from the template And evaluate its supporting value for the task through the model: ; Step 3.6.4 Comprehensive scoring and result filtering.
[0147] The three types of scores are weighted and combined to obtain the final comprehensive score: ; like: ; Then remove that entry to obtain the valid set: ; Step 3.6.5 Validity judgment and closed-loop start determination.
[0148] If the number of valid content items is insufficient: ; This triggers a closed-loop feedback process. That is, if a new search is required, the military intent of the military query task is reconstructed, and after obtaining a new military query task, the above steps are repeated to obtain the target search results.
[0149] Its triggering conditions and operations include: (1) Task intent reconstruction: refactoring the original query By performing intent supplementation, conflict resolution, and constraint rewriting, a new query is obtained. .
[0150] (2) Re-enter the Agent-A process: The information is returned to Agent-A, triggering the "retrieval demand prediction - sub-problem decomposition - retrieval scheduling" process again.
[0151] (3) Re-retrieve: Agent-A sends the new query to Agent-B to schedule a suitable retrieval agent to restart the retrieval process.
[0152] Step 3.6.6 Generate the final usable knowledge block output.
[0153] When a valid search content set is obtained Agent-C then sorted them according to their overall scores: And generate the final knowledge block output: Step 3.6.7 outputs to the task generation model.
[0154] Agent-C will finalize the filtered knowledge blocks. As enhanced contextual knowledge, it is injected into the main model (such as a private domain military large model) to generate the final task results: ; Step 3.6.8 Output the final task answer to the user.
[0155] If the retrieval and evaluation are successful: Output the final generated results. .
[0156] If multiple rounds of closed-loop processing fail to obtain effective knowledge, a downgraded answer is output, including: an explanation that "no high-quality knowledge support was found"; an interpretable answer generated by the model based on its pre-trained knowledge; or, optionally, a potential alternative question or hint.
[0157] This invention constructs an intelligent agent collaboration and multi-source retrieval-enhanced generation framework for military task decomposition. This framework enables automatic decomposition of user task requirements, dynamic scheduling of heterogeneous knowledge sources, and high-fidelity, executable operational scenario generation within complex military knowledge environments. Compared to existing technologies relying on single-vector retrieval or template-based generation strategies, this invention achieves intelligent processing of the entire process—from task understanding and knowledge selection to quality filtering and generation verification—through a hierarchical collaboration mechanism involving Agent-A, Agent-B, and Agent-C. This significantly improves the structural consistency, factual accuracy, and simulation executability of the generated content.
[0158] First, Agent-A of this invention introduces the Self-RAG prediction model to pre-determine whether a user query requires retrieval, and decomposes the query task into fine-grained subtasks based on CoT, realizing an intelligent scheduling mechanism of "fast direct answer when no retrieval is needed, and on-demand parallel recall when retrieval is required." This mechanism effectively reduces invalid retrieval overhead, improves the overall system throughput efficiency, and enables complex military tasks to be decomposed into fine-grained intent structures with interpretable reasoning paths, thereby enhancing the controllability and stability of task understanding.
[0159] Secondly, Agent-B, by combining task semantic features, can dynamically select between relational databases, knowledge graphs, and vector knowledge bases to achieve adaptive retrieval scheduling of multi-source heterogeneous knowledge. For military tasks with features such as causal links, task constraints, and tactical dependencies, Agent-B automatically prioritizes calling the knowledge graph to perform subgraph expansion and path reasoning; for conceptual, empirical, or descriptive information, it calls the vector database for semantic retrieval; and for parameterized rules, it calls the relational database for precise queries. Through this strategy selection mechanism, this invention significantly improves the logical relevance of retrieval results to military tasks and the effectiveness of decision-making, overcoming the fundamental defect of "semantic relevance but logical error" in the traditional RAG model.
[0160] Furthermore, Agent-C performs multi-layered filtering of search content using three metrics: semantic consistency, knowledge relevance, and usability. It also employs a lightweight language model to perform usability verification and generate supporting judgments, achieving high-quality screening of search content. In addition, this invention proposes a trigger-based closed-loop feedback mechanism. When high-quality search results are insufficient, Agent-C automatically generates new query statements and sends them back to Agent-A for re-decomposition and retrieval, thus establishing a multi-round iterative chain of "generation—evaluation—re-retrieval," enabling the generated results to continuously converge and improving the military standardization and factual completeness of the generated content.
[0161] Although this invention has been able to operate stably in most military mission generation scenarios, certain shortcomings remain. For example, when encountering severe knowledge base deficiencies or excessive multi-source knowledge conflicts, the closed-loop mechanism may require multiple iterations to converge, leading to increased generation latency. Furthermore, this invention is highly dependent on the structure of the knowledge graph; when the knowledge graph is massive and highly complex, Agent-B may require additional graph pruning or compression mechanisms to improve query efficiency. However, these shortcomings can be gradually improved through knowledge base expansion, graph index optimization, or the introduction of incremental learning mechanisms, without affecting the core technological advantages of this invention in military intelligent simulation systems.
[0162] To more clearly illustrate the technical process of this invention, the following example demonstrates the intelligent agent collaborative retrieval and task generation process of this invention. This embodiment uses the application scenario of "generating a reconnaissance and precision strike mission plan for the Red Force against the target area of Hongdao Island using an integrated UAV system" as an example, showcasing the entire process of user query processing, task decomposition, multi-source knowledge retrieval, quality assessment, closed-loop optimization, and final plan generation.
[0163] Step 1: User inputs task query.
[0164] In this embodiment, the user inputs the following original task query: "Generate a reconnaissance and strike mission plan for Hongdao using unmanned aerial vehicles (UAVs), which should include platform selection, flight path design, threat avoidance, and attack procedures." The system inputs this query into Agent-A of this invention for processing.
[0165] Step 2 invokes Agent-A's search demand prediction and task understanding.
[0166] Agent-A first performs semantic encoding on the user query to generate a query vector h_q, and then uses the built-in Self-RAG predictor to calculate the probability P(retrieve|q) of the task's dependence on external knowledge. When the predicted probability is higher than a preset threshold θ_self, the system automatically initiates the retrieval process.
[0167] To further understand the user's intention and improve the retrieval quality, Agent-A adopts a CoT-based task thinking decomposition mechanism to break down the original query into multiple structured subtasks. The set of subtasks generated in this embodiment includes:
[0168] q1: Identify the drone platform capable of performing integrated reconnaissance and strike tasks; q2: Query threat nodes such as air defense radars and firepower points in the Hongdao area; q3: Determine the safe flight routes that the drone can pass through and the threat areas to be avoided; q4: Invoke the integrated reconnaissance and strike tactical experience to generate task sequences such as reconnaissance, positioning, and strike.
[0169] Agent-A forms the above subtasks into a set Q = {q1, q2, q3, q4} and submits them in parallel to Agent-B for retrieval scheduling.
[0170] Step 3 In this invention, Agent-B is used to match the subtasks with the optimal knowledge sources and schedule different types of retrieval agents for querying. In this embodiment, Agent-B completes the following mapping by combining the semantic types of the subtasks and the characteristics of the knowledge base:
[0171] For subtask q1 (drone platform parameters), schedule the relational database retrieval agent to query structured equipment information such as drone models, flight ranges, and payloads; For subtask q2 (air defense threat nodes), schedule the knowledge graph retrieval agent to query the air defense systems, radar positions, and threat levels in the Hongdao area; For subtask q3 (flight route experience and threat avoidance), schedule the vector retrieval agent to obtain the flight tracks, experience rules, and traffic corridors of historical tasks; For subtask q4 (integrated reconnaissance and strike process), schedule both the vector library and the knowledge graph to obtain the process dependency structure and tactical experience cases.
[0172] Each retrieval agent accesses the corresponding data source according to the scheduling of Agent-B to form a preliminary retrieval result set R = {c1, c2,..., c}.
[0173] Step 4 Trigger Agent-C to perform multi-dimensional quality assessment and content filtering.
[0174] The retrieval result set R will be subject to quality assessment and screening by Agent-C. The evaluation module of this invention includes three scoring mechanisms: semantic consistency, knowledge relevance, and usability, and the comprehensive score Score_final is obtained through weighted fusion.
[0175] Step 5 Perform retrieval closed-loop optimization When the number of valid retrieval contents is insufficient (Rvalid < Nmin), the system automatically activates the closed-loop optimization mechanism of this invention, including: Task intent reconstruction: The original query is constrained and supplemented or semantically refined to generate a new query q′; for example, in this embodiment, information such as "range ≥ 150km" and "priority given to UAV platforms with stealth capabilities" is added. Then, Agent-A is returned to perform task prediction and subtask decomposition again, and Agent-B is rescheduled to restart the retrieval process based on q′.
[0176] In this embodiment, the closed-loop mechanism is executed in two rounds, ultimately obtaining a valid content set R_valid that meets both the requirements for scale and quality.
[0177] Step 6 generates the final knowledge blocks and task plan output.
[0178] Agent-C sorts the set of valid content according to the comprehensive score, resulting in the final knowledge block set K_final. This knowledge block includes:
[0179] (1) Parameters of the UAV platform capable of performing reconnaissance and strike missions; (2) Distribution of air defense nodes and target threats in the Hongdao area; (3) Passable routes, threat avoidance zones and recommended corridors; (4) Tactical sequence steps and execution conditions for integrated investigation and strike.
[0180] Subsequently, the system injects K_final into the main task generation model (such as a private domain military large model) to generate the final UAV reconnaissance and strike mission plan A_final, which includes platform selection, route planning, threat avoidance strategies, and integrated reconnaissance and strike attack process.
[0181] Step 7: Output the task plan.
[0182] The final generated task solution A_final is returned to the user; if multiple rounds of closed-loop processing still cannot obtain sufficient knowledge support, a downgraded response is output, including the prompt "no high-quality knowledge support found" and an interpretable solution generated based on the model's own knowledge.
[0183] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this invention. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, without changing the core design of the algorithm and process, are also within the protection scope of this invention.
[0184] Another embodiment of the present invention relates to a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the agent-cooperative multi-source retrieval enhancement generation method of the above embodiments.
[0185] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0186] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0187] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method embodiments described above.
[0188] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0189] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing the present invention, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A method for enhancing the generation of intelligent agent-cooperative multi-source retrieval, characterized in that, The method includes: Obtain military query tasks input by the user; The first intelligent agent determines whether a military query task needs to be retrieved based on the Self-RAG reflection mechanism. If a retrieval is required, the military query task is decomposed into multiple sub-tasks based on the CoT mind chain. Otherwise, the answer is directly generated by inputting the large military model. For each subtask, the semantic features of the subtask are extracted by the second intelligent agent, and the corresponding retrieval knowledge base is selected for the subtask based on the semantic features. The retrieval knowledge base includes a vector database, a knowledge graph, and a relational database. The vector database contains semantic vectors of military knowledge, the knowledge graph contains graph structure representations of military knowledge, and the relational database contains military normative constraints of military knowledge. After obtaining the retrieval results for each subtask through the selected retrieval knowledge base, the third intelligent agent determines whether a re-retrieval is needed based on the semantic similarity and military knowledge relevance between each retrieval result and its subtask, as well as the supporting value of each retrieval result for its subtask. If a new search is required, the military intent of the military query task is reconstructed. After obtaining a new military query task, the above steps are repeated to obtain the target search results.
2. The agent-cooperative multi-source retrieval enhancement generation method according to claim 1, characterized in that, After selecting the corresponding retrieval knowledge base for the sub-task based on semantic features, the method further includes: If the selected retrieval knowledge base is a vector database, then the military intent of the sub-task is parsed, and the semantic features of the parsed military intent are extracted. Obtain the cosine similarity between the semantic features of military intentions and the semantic vectors of all military knowledge in the vector database, and sort all military knowledge in the vector database in descending order based on all cosine similarities; The first preset number of military knowledge items, sorted in descending order, are selected as candidate search results for the subtask; among them, all military knowledge items selected in the candidate search results are weighted using an attention mechanism. The semantic features of military intent, auxiliary military background knowledge, and candidate search results are combined. The military big data model is used to generate retrieval results for sub-tasks based on the spliced results.
3. The agent-cooperative multi-source retrieval enhancement generation method according to claim 2, characterized in that, The semantic vectors of all military knowledge in the vector database are obtained using the BGE model, and the BGE model is trained using contrastive learning.
4. The agent-cooperative multi-source retrieval enhancement generation method according to claim 1, characterized in that, The knowledge graph includes a graph structure index and a semantic vector index.
5. The agent-cooperative multi-source retrieval enhancement generation method according to claim 4, characterized in that, After selecting the corresponding retrieval knowledge base for the subtask based on semantic features, the method further includes: If the selected retrieval knowledge base is a knowledge graph, the subtask is decomposed into local keywords and global keywords. Local keywords are aligned with the patterns of attributes, models, and parameters of entities in the knowledge graph, while global keywords are aligned with the patterns of structures and relationships in the knowledge graph. Based on the semantic vector index, a nearest neighbor search is performed on local keywords in the knowledge graph to obtain multiple candidate semantic vectors. Based on the graph structure index, global keywords are matched in the knowledge graph to obtain multiple candidate graph structures. After performing 1-hop structure expansion on each candidate graph structure, the semantic chain of each candidate graph structure is extracted to obtain the path representation; Candidate graph structures are selected based on the semantic similarity among all path representations; The military big data model is used to generate retrieval results for subtasks based on the selected candidate semantic vectors, candidate graph structures, and corresponding structural contexts.
6. The agent-cooperative multi-source retrieval enhancement generation method according to claim 1, characterized in that, After selecting the corresponding retrieval knowledge base for the subtask based on semantic features, the method further includes: If the selected retrieval knowledge base is a relational database, then extract the structured retrieval elements of the subtask, including the target entity, query attributes, and constraints. Based on the relational database schema, a semantic similarity matching strategy is used to locate the target table related to the target entity and the fields corresponding to the query attributes in the relational database; Combine the target table, fields, and constraints to generate an SQL query statement; Multiple candidate search results can be obtained by querying a relational database using SQL queries; After performing consistency checks on all candidate search results, the search results for the sub-tasks are generated using a large military model.
7. The agent-cooperative multi-source retrieval enhancement generation method according to claim 6, characterized in that, The relational database contains the following military normative constraints: equipment performance indicators, organizational affiliation of combat units, behavioral rules for equipment and combat, and simulation environment configuration.
8. The agent-cooperative multi-source retrieval enhancement generation method according to claim 1, characterized in that, The military knowledge in the retrieval knowledge base is obtained by acquiring and structuring information from pre-set encyclopedia websites.
9. A computer device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the agent-cooperative multi-source retrieval enhancement generation method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the intelligent agent collaborative multi-source retrieval enhancement generation method as described in any one of claims 1 to 8.