The invention discloses an RAG
performance improvement method based on
process optimization. The method comprises the following steps: S1, preprocessing text data; s2, performing hierarchical
text segmentation, obtaining a document, storing the text by utilizing a
database after the document is segmented, converting the text into vectors, and storing the vectors into a vector
knowledge base; s3, querying and
rewriting to obtain a rewritten question; s4, combining parent document search with mixed retrieval, and retrieving related contexts for the rewritten questions; s5, performing rearrangement and denoising to obtain a final context; and S6, generating an answer, and sending the final context into a large
language model for understanding
questions and answers. According to the method, the links of text preprocessing, text partitioning, text embedding,
query optimization, retrieval, retrieval post-
processing, generation and the like are sequentially optimized according to the data flowing direction, the semantic retrieval precision is improved, and the performance of RAG in the aspects of
text retrieval precision, answer generation quality, user interaction and the like can be remarkably improved; and the flexibility and the practicability of the
system are enhanced, so that the
system is more excellent in practical application.