System and method for generating symmetric searches for retrieval augmented generation using chunk summaries
A method, computer program product, and computing system for generating a plurality of chunks for a plurality of text portions of a document. A plurality of chunk summaries are generated by generating a summary for each respective chunk of the plurality of chunks. A plurality of chunk summary embeddings are generated by generating an embedding of the summary for each respective chunk. The plurality of chunk summary embeddings are provided for processing a query using the generative AI model.
1 . A computer-implemented method, executed on a computing device, comprising:
generating a plurality of chunks for a plurality of text portions of a document, wherein generating the plurality of chunks includes:
generating a plurality of semantically homogenous chunks by:
performing topic extraction on the plurality of text portions of the document, and
generating a new chunk in response to detecting a change in topic for a topic extracted from a text portion of the document;
generating a plurality of chunk summaries by generating a summary for each respective chunk of the plurality of chunks based upon, at least in part, a character limit based on a predefined character limit for a query, wherein generating the plurality of chunk summaries includes extracting the chunk summary from a plurality of headings from the document structure;
generating a plurality of chunk summary embeddings by generating an embedding of the summary for each respective chunk; and
providing the plurality of chunk summary embeddings for processing the query using a generative AI model.
2 . The computer-implemented method of claim 1 , wherein generating the plurality of chunk summaries includes performing topic extraction on each chunk to generate the chunk summary.
3 . The computer-implemented method of claim 1 , wherein generating the plurality of chunk summaries includes performing chunk summarization using a generative AI model.
4 . The computer-implemented method of claim 1 , further comprising:
generating a query embedding from the query;
identifying a candidate chunk by determining a similarity between the query embedding and the plurality of chunk summary embeddings;
generating a prompt using the query and the candidate chunk; and
providing the prompt to the generative AI model.
5 . A computer program product residing on a non-transitory computer readable medium having a plurality of instructions stored thereon which, when executed by a processor, cause the processor to perform operations comprising:
generating a plurality of chunks for a plurality of text portions of a document, wherein generating the plurality of chunks includes generating a plurality of semantically homogenous chunks by:
performing topic extraction on the plurality of text portions of the document, and
generating a new chunk in response to detecting a change in topic for a topic extracted from a text portion of the document;
generating a plurality of chunk summaries by generating a summary for each respective chunk of the plurality of chunks based upon, at least in part, a character limit based on a predefined character limit for a query, wherein generating the plurality of chunk summaries includes extracting the chunk summary from a plurality of headings from the document structure;
generating a plurality of chunk summary embeddings by generating an embedding of the summary for each respective chunk; and
providing the plurality of chunk summary embeddings for processing the query using a generative AI model.
6 . The computer program product of claim 5 , wherein generating the plurality of chunk summaries includes performing topic extraction on each chunk to generate the chunk summary.
7 . The computer program product of claim 5 , wherein generating the plurality of chunk summaries includes performing chunk summarization using a generative AI model.
8 . The computer program product of claim 5 , wherein the operations further comprise:
generating a query embedding from the query;
identifying a candidate chunk by determining a similarity between the query embedding and the plurality of chunk summary embeddings;
generating a prompt using the query and the candidate chunk; and
providing the prompt to the generative AI model.
9 . A computing system comprising:
a memory; and
a processor configured to generate a plurality of chunks for a plurality of text portions of a document, wherein generating the plurality of chunks includes generating a plurality of semantically homogenous chunks by: performing topic extraction on the plurality of text portions of the document, and generating a new chunk in response to detecting a change in topic for a topic extracted from a text portion of the document, to generate a plurality of chunk summaries by generating a summary for each respective chunk of the plurality of chunks based upon, at least in part, a character limit based on a predefined character limit for a query, wherein generating the plurality of chunk summaries includes extracting the chunk summary from a plurality of headings from the document structure, to generate a plurality of chunk summary embeddings by generating an embedding of the summary for each respective chunk, and to provide the plurality of chunk summary embeddings for processing a query using a generative AI model.
10 . The computing system of claim 9 , wherein generating the plurality of chunk summaries includes performing topic extraction on each chunk to generate the chunk summary.
11 . The computing system of claim 9 , wherein generating the plurality of chunk summaries includes performing chunk summarization using a generative AI model.
12 . The computing system of claim 9 , wherein the processor is further configured to:
generate a query embedding from the query;
identify a candidate chunk by determining a similarity between the query embedding and the plurality of chunk summary embeddings;
generate a prompt using the query and the candidate chunk; and
provide the prompt to the generative AI model.