Integration of anchor information for retrieval augmented generation
Systems and methods for integration of anchor information for retrieval augmented generation are provided. A communication platform accesses communication data associated with an enterprise on the communication platform. The communication platform divides the communication data into multiple data chunks. The communication platform generates one or more extended queries for each data chunk of the multiple data chunks using a generative AI model. The communication platform receives a user query, and identifies, from the multiple data chunks, one or more relevant data chunks for the user query at least by comparing the user query with the one or more extended queries associated with each data chunk of the multiple data chunks. The communication platform provides an answer to the user query based on the one or more relevant data chunks.
1 . A method comprising:
accessing communication data on a communication platform associated with an enterprise;
dividing the communication data into multiple data chunks;
generating one or more extended queries for each data chunk of the multiple data chunks using a first generative AI model;
generating one or more extended query embeddings for the one or more extended queries associated with each data chunk of the multiple data chunks using an embedding model;
determining one or more topic phrases associated with each data chunk of the multiple data chunks using a second generative AI model;
generating one or more topic phrase embeddings for the one or more topic phrases associated with each data chunk of the multiple data chunks using the embedding model;
receiving a user query from a client device;
generating a user query embedding for the user query using the embedding model;
identifying, from the multiple data chunks, one or more relevant data chunks for the user query at least by comparing the user query embedding with the one or more extended query embeddings associated with each data chunk of the multiple data chunks and the one or more topic phrase embeddings associated with each data chunk of the multiple data chunks; and
providing an answer to the user query based on the one or more relevant data chunks.
2 . The method of claim 1 , further comprising:
extracting one or more keywords associated with each data chunk of the multiple data chunks; and
identifying the one or more relevant data chunks from the multiple data chunks by comparing the user query to the one or more keywords.
3 . The method of claim 1 , further comprising:
ranking the one or more relevant data chunks to obtain an ordered list of relevant data chunks using a reranking model;
selecting a subset of one or more relevant data chunks from the ordered list of relevant data chunks; and
providing the answer to the user query based on the subset of one or more relevant data chunks.
4 . The method of claim 3 , wherein method further comprises:
generating a relevancy score for a relevant data chunk of the one or more relevant data chunks with respect to the user query; and
ranking the one or more relevant data chunks based on corresponding relevancy scores.
5 . The method of claim 1 , further comprising:
generating the answer to the user query based on the one or more relevant data chunks, using a third generative AI model.
6 . A system comprising:
a communications interface;
a non-transitory computer-readable medium; and
one or more processors communicatively coupled to the communications interface and the non-transitory computer-readable medium, the one or more processors configured to execute processor-executable instructions stored in the non-transitory computer-readable medium to:
access communication data on a communication platform associated with an enterprise;
divide the communication data into multiple data chunks;
generate one or more extended queries for each data chunk of the multiple data chunks using a first generative AI model;
generate one or more extended query embeddings for the one or more extended queries associated with each data chunk of the multiple data chunks;
determine one or more topic phrases associated with each data chunk of the multiple data chunks using a second generative AI model;
generate one or more topic phrase embeddings for the one or more topic phrases associated with each data chunk of the multiple data chunks;
receive a user query from a client device;
generate a user query embedding for the user query;
identify, from the multiple data chunks, one or more relevant data chunks for the user query at least by comparing the user query embedding with the one or more extended query embeddings associated with each data chunk of the multiple data chunks and the one or more topic phrase embeddings associated with each data chunk of the multiple data chunks; and
provide an answer to the user query based on the one or more relevant data chunks.
7 . The system of claim 6 , wherein the one or more processors are configured to execute further processor-executable instructions stored in the non-transitory computer-readable medium to:
extract one or more keywords associated with each data chunk of the multiple data chunks; and
identify the one or more relevant data chunks from the multiple data chunks by comparing the user query to the one or more keywords.
8 . The system of claim 6 , wherein the one or more processors are configured to execute further processor-executable instructions stored in the non-transitory computer-readable medium to:
rank the one or more relevant data chunks to obtain an ordered list of relevant data chunks using a reranking model;
select a subset of the one or more relevant data chunks from the ordered list of relevant data chunks; and
provide the answer to the user query based on the subset of the one or more relevant data chunks.
9 . The system of claim 7 , wherein the one or more processors are configured to execute further processor-executable instructions stored in the non-transitory computer-readable medium to:
generating a relevancy score for a relevant data chunk of the one or more relevant data chunks with respect to the user query; and
select a subset of the one or more relevant data chunks based on corresponding relevancy scores.
10 . The system of claim 6 , wherein the one or more processors are configured to execute further processor-executable instructions stored in the non-transitory computer-readable medium to:
generate the answer to the user query based on the one or more relevant data chunks, using a third generative AI model.
11 . A non-transitory computer-readable medium comprising processor-executable instructions configured to cause one or more processors to:
access communication data on a communication platform associated with an enterprise;
divide the communication data into multiple data chunks;
generate one or more extended queries for each data chunk of the multiple data chunks using a first generative AI model;
generate one or more extended query embeddings for the one or more extended queries associated with each data chunk of the multiple data chunks;
determine one or more topic phrases associated with each data chunk of the multiple data chunks using a second generative AI model;
generate one or more topic phrase embeddings for the one or more topic phrases associated with each data chunk of the multiple data chunks;
receive a user query from a client device;
generate a user query embedding for the user query;
identify, from the multiple data chunks, one or more relevant data chunks for a user query at least by comparing the user query embedding with the one or more extended query embeddings associated with each data chunk of the multiple data chunks and the one or more topic phrase embeddings associated with associated with each data chunk of the multiple data chunks; and
provide an answer to the user query based on the one or more relevant data chunks.
12 . The non-transitory computer-readable medium of claim 11 , further comprising processor-executable instructions configured to cause one or more processors to:
extract one or more keywords associated with each data chunk of the multiple data chunks; and
identify the one or more relevant data chunks from the multiple data chunks by comparing the user query to the one or more keywords.
13 . The non-transitory computer-readable medium of claim 11 , further comprising processor-executable instructions configured to cause one or more processors to:
rank the one or more relevant data chunks to obtain an ordered list of relevant data chunks using a reranking model;
select a subset of the one or more relevant data chunks from the ordered list of relevant data chunks; and
provide the answer to the user query based on the subset of the one or more relevant data chunks.
14 . The non-transitory computer-readable medium of claim 13 , further comprising processor-executable instructions configured to cause one or more processors to:
generate a relevancy score for a relevant data chunk of the one or more relevant data chunks with respect to the user query; and
select the subset of the one or more relevant data chunks based on corresponding relevancy scores; and
generate the answer to the user query based on the subset of the one or more relevant data chunks, using a third generative AI model.
15 . The method of claim 1 , wherein determining one or more topic phrases associated with each data chunk of the multiple data chunks comprises extracting the one or more topic phrases from each data chunk of the multiple data chunks.
16 . The method of claim 1 , wherein determining one or more topic phrases associated with each data chunk of the multiple data chunks comprises paraphrasing each data chunk of the multiple data chunks.