Retrieval augmented generation guided automated event detection using machine learning models
Techniques described herein involve automated event detection using retrieval augmented generation and machine learning models. Embodiments include creating a directed graph for each of a plurality of interactive sessions based on attributes associated with the interactive sessions and generating an embedding of the directed graph for each of the plurality of interactive sessions. Embodiments include storing the embedding of the directed graph for each of the plurality of interactive sessions in a vector database and, in response to an input session, retrieving one or more embeddings related to the input session from the vector database. Embodiments include selecting a subset of the one or more embeddings based on a prompt provided to a language processing machine learning model. Embodiments include comparing features associated with the subset of the one or more embeddings to features associated with an embedding of the input session and performing an action based on the comparing.
1 . A method for automated fraud detection using retrieval augmented generation and machine learning models, comprising:
creating a directed graph for each of a plurality of interactive sessions based on attributes associated with the plurality of interactive sessions;
generating an embedding of the directed graph for each of the plurality of interactive sessions;
storing the embedding of the directed graph for each of the plurality of interactive sessions in a vector database;
retrieving, in response to an input session, one or more embeddings related to the input session from the vector database;
selecting, using a language processing machine learning model, a subset of the one or more embeddings based on a prompt provided to the language processing machine learning model, wherein the selecting comprises determining K-most similar embeddings of the one or more embeddings by calculating distance scores between an embedding of the input session and each of the one or more embeddings;
comparing features associated with the subset of the one or more embeddings to features associated with the embedding of the input session; and
performing an action based on the comparing.
2 . The method of claim 1 , wherein nodes in the directed graph correspond to one or more of:
an event associated with a particular interactive session of the plurality of interactive sessions;
a timestamp associated with the event; or
an elapsed time from a previous event associated with the particular interactive session to the event.
3 . The method of claim 1 , wherein the retrieving, in response to the input session, the one or more embeddings related to the input session from the vector database comprises generating the embedding of the input session and searching the vector database based on the embedding of the input session using a retrieval augmented generation technique.
4 . The method of claim 1 , wherein the performing of the action based on the comparing comprises assigning a classification to the input session upon determining that the embedding of the input session matches more than a threshold number of embeddings in the subset of the one or more embeddings that contain a particular label.
5 . The method of claim 4 , wherein the assigning the classification to the input session is performed more than a threshold amount of time after initiation of the input session and prior to termination of the input session.
6 . The method of claim 4 , further comprising displaying an indication of the classification assigned to the input session via a user interface or sending the indication of the classification assigned to the input session to one or more elements of a software application.
7 . A system for automated fraud detection using retrieval augmented generation and machine learning models, comprising:
one or more processors; and
a memory comprising instructions that, when executed by the one or more processors, cause the system to:
create a directed graph for each of a plurality of interactive sessions based on attributes associated with the plurality of interactive sessions;
generate an embedding of the directed graph for each of the plurality of interactive sessions;
store the embedding of the directed graph for each of the plurality of interactive sessions in a vector database;
retrieve, in response to an input session, one or more embeddings related to the input session from the vector database;
select, using a language processing machine learning model, a subset of the one or more embeddings based on a prompt provided to the language processing machine learning model, wherein the selecting comprises determining K-most similar embeddings of the one or more embeddings by calculating distance scores between an embedding of the input session and each of the one or more embeddings;
compare features associated with the subset of the one or more embeddings to features associated with the embedding of the input session; and
perform an action based on the comparing.
8 . The system of claim 7 , wherein nodes in the directed graph correspond to one or more of:
an event associated with a particular interactive session of the plurality of interactive sessions;
a timestamp associated with the event; or
an elapsed time from a previous event associated with the particular interactive session to the event.
9 . The system of claim 7 , wherein the retrieving, in response to the input session, the one or more embeddings related to the input session from the vector database comprises generating the embedding of the input session and searching the vector database based on the embedding of the input session using a retrieval augmented generation technique.
10 . The system of claim 7 , wherein the performing of the action based on the comparing comprises assigning a classification to the input session upon determining that the embedding of the input session matches more than a threshold number of embeddings in the subset of the one or more embeddings that contain a particular label.
11 . The system of claim 10 , wherein the assigning the classification to the input session is performed more than a threshold amount of time after initiation of the input session and prior to termination of the input session.
12 . The system of claim 10 , wherein the instructions, when executed by the one or more processors, further cause the system to display an indication of the classification assigned to the input session via a user interface or sending the indication of the classification assigned to the input session to one or more elements of a software application.
13 . A non-transitory computer readable medium comprising instructions that, when executed by one or more processors of a computing system, cause the computing system to:
create a directed graph for each of a plurality of interactive sessions based on attributes associated with the plurality of interactive sessions;
generate an embedding of the directed graph for each of the plurality of interactive sessions;
store the embedding of the directed graph for each of the plurality of interactive sessions in a vector database;
retrieve, in response to an input session, one or more embeddings related to the input session from the vector database;
select, using a language processing machine learning model, a subset of the one or more embeddings based on a prompt provided to the language processing machine learning model, wherein the selecting comprises determining K-most similar embeddings of the one or more embeddings by calculating distance scores between an embedding of the input session and each of the one or more embeddings;
compare features associated with the subset of the one or more embeddings to features associated with the embedding of the input session; and
perform an action based on the comparing.
14 . The non-transitory computer readable medium of claim 13 , wherein nodes in the directed graph correspond to one or more of:
an event associated with a particular interactive session of the plurality of interactive sessions;
a timestamp associated with the event; or
an elapsed time from a previous event associated with the particular interactive session to the event.
15 . The non-transitory computer readable medium of claim 13 , wherein the retrieving, in response to the input session, the one or more embeddings related to the input session from the vector database comprises generating the embedding of the input session and searching the vector database based on the embedding of the input session using a retrieval augmented generation technique.
16 . The non-transitory computer readable medium of claim 13 , wherein the performing of the action based on the comparing comprises assigning a classification to the input session upon determining that the embedding of the input session matches more than a threshold number of embeddings in the subset of the one or more embeddings that contain a particular label.
17 . The non-transitory computer readable medium of claim 16 , wherein the assigning the classification to the input session is performed more than a threshold amount of time after initiation of the input session and prior to termination of the input session.