The invention provides a data reordering retrieval method and
system based on RAG, and the method comprises the steps: carrying out the dynamic semantic partitioning
processing of an original document, generating corresponding document blocks, storing the document blocks in a vector
database, constructing a hierarchical index, analyzing a received query request, extracting keywords in the query request, and carrying out the retrieval of the query request. Boolean keyword matching is carried out through an
inverted index in the hierarchical index, semantic retrieval of keywords is carried out in a vector
database, an initial candidate set is generated after multi-source retrieval results are fused, a query request and the initial candidate set are input into a generative reordering model, and a query result is obtained; according to the method, the initial candidate set is selected, the corresponding
score is generated through the cross-
modal attention mechanism in the generative reordering model, the initial candidate set is reordered according to the
score, the final
retrieval result is obtained, and the reordered document blocks are displayed, so that the overall retrieval speed is increased, the limitation of a single retrieval mode is avoided, and the accuracy of the
retrieval result is improved.