Icon

Semana 3 - RAG - Product FAQ usando Gemini

Mitigate hallucinations in LLMs with RAG

This workflow shows how to mitigate factual hallucinations in LLM responses about KNIME nodes for deep learning by implementing a RAG-based AI framework. The question we ask is: "What KNIME node should I use for transfer learning?"

We first import and embed a knowledge base containing the node descriptions of the KNIME Deep Learning - Keras Integration. Next, we create a Vector Store of that knowledge base and export it.

We implement a RAG process where we query the Vector Store and retrieve documents (5) that are most similar to the query. Next, we use the retrieved documents to augment the prompt with more context. Finally, we prompt ChatGPT to generate a response.

URL: OpenAI API Keys https://platform.openai.com/account/api-keys
URL: What are hallucinations in AI? (Blog) https://www.knime.com/blog/ai-hallucinations
URL: Mitigate hallucinations in LLMs using RAG with KNIME? (Blog) https://www.knime.com/blog/mitigate-hallucinations-in-LLMs-with-RAG

1. Preparar base de conocimiento

Cargar nuestra BD de conocimieto
Guardar en almacenamiento vectorial

2. RAG

Recuperación
Aumento
Generación
Conectarse al LLM

RAG para preguntas frecuentes de nuestros clientes

Google AI Studio Authenticator
Modelo a utilizar para interacción con el cliente
Gemini LLM Selector
Cargar el API Key en "Password"
Credentials Configuration
Procesar consultas del cliente
LLM Prompter
Modelo para embeddings (creación de vectores)
Gemini Embedding Model Selector
Mostrar respuestas
Table View
Preparar prompts
String Manipulation
Tabla de preguntas frecuentes (FAQ) que tiene nuestra empresa
Table Creator
Traer almacenamiento vectorial
Model Reader
Almacenar BD
Model Writer
Preguntas del cliente, que queremos contestar
Table Creator
Creamos una BD vectorial
FAISS Vector Store Creator
Traer del almacenamiento vectorial los documentos que se aproximen a la pregunta
Vector Store Retriever

Nodes

Extensions

Links