D) Enriching Analytics with GenAI: Providing Context for Email Alerts
Step 1: Segment knowledge base PDF in sections
Search, drag and drop a Sentence Extractor and apply it to the PDF Parser output, that is the document describing different types of investments. This will segment the document into rows, each containing a different sentence from the PDF.
Step 2: Create a vector store from the segmented knowledge base
Search, drag and drop a FAISS Vector Store Creator to convert the text sections in vectors and store them in a FAISS vector store. Connect the input embeddings model from the OpenAI Embeddings Connector. Save the Vector Store for Part E in the 'models' folder by adding a Model Writer node.
Step 3: Retrieve text describing the contract type of detected fraud
Search, drag and drop a Vector Store Retriever to search in the vector store the relevant sentences describing the contract types for the detected frauds in Part B. Connect as first input the vector store, and as second input the Tile View output from Part B. Select 'type' in the settings.
Step 4: Engineer a prompt for email alerts with contract type context
Similarly to before use a String Manipulation to engineer the prompt generating the alert emails.
This time add the context from the vector store to explain the contract type.
Step 5: Perform retrieval augmented generation (RAG)
Drag and drop an LLM Prompter, and feed it with the output of the String Manipulation.
Finally, visualize the generated emails via the provided component.