The application provides a kind of RAG
knowledge base retrieval threshold self-adapting dynamic optimization method and
system thereof, comprising reading
system basic configuration parameter, and based on parameter dynamic calculation maximum
shard containing number;Load
test question set, execute threshold step scanning to generate candidate threshold;For each candidate threshold, retrieve
test question,
record the
original data of
retrieval result under each candidate threshold;
Statistical analysis is carried out on the
retrieval result, and effective coverage rate and average result number are calculated;Apply constraint-based nonlinear
scoring algorithm, combine effective coverage rate and average result number, and introduce load adaptability as penalty boundary, calculate the comprehensive
score of each candidate threshold;According to the comprehensive
score result, output the threshold with the highest
score as the recommended parameter, and generate an analysis report containing the recommended reason.The application effectively controls the context
noise and Token cost input to the
large model while ensuring the retrieval
recall rate, and realizes the automatic performance optimization of RAG
system.