AutomationFlowsAI & RAG › RAG Query

RAG Query

rag_query. Uses vectorStorePinecone, telegram, agent, lmChatGoogleGemini. Event-driven trigger; 9 nodes.

Event trigger★★★☆☆ complexityAI-powered9 nodesPinecone Vector StoreTelegramAgentGoogle Gemini ChatMemory Buffer WindowGoogle Gemini EmbeddingsTelegram Trigger
AI & RAG Trigger: Event Nodes: 9 Complexity: ★★★☆☆ AI nodes: yes Added:

This workflow follows the Agent → Google Gemini Embeddings recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "rag_query",
  "nodes": [
    {
      "parameters": {
        "content": "## Generar una Respuesta usando la Vector Store:\n\u26a0\ufe0f __Al importar se deben configurar las credenciales antes de ejecutar el workflow__",
        "height": 720,
        "width": 1504,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -752,
        -304
      ],
      "id": "85260b71-d66c-4632-9426-de5610a81bdc",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolDescription": "Usa esta herramienta para acceder a la base de datos que contiene la informaci\u00f3n para responder a cada consulta del usuario.",
        "pineconeIndex": {
          "__rl": true,
          "value": "n8n-chatbot-famaf",
          "mode": "list",
          "cachedResultName": "n8n-chatbot-famaf"
        },
        "options": {
          "pineconeNamespace": "Question-Answer"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1.3,
      "position": [
        208,
        64
      ],
      "id": "903fe07e-7688-4f24-bba3-752e287203c8",
      "name": "Vector Store con Preguntas",
      "credentials": {
        "pineconeApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendChatAction",
        "chatId": "={{ $json.message.chat.id }}"
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -288,
        -144
      ],
      "id": "9b3af7e0-7858-416c-9c0a-86b38d960db3",
      "name": "Cambiar estado a \"Escribiendo...\"",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('Cuando Reciba un Mensaje').item.json.message.text }}",
        "options": {
          "systemMessage": "Eres un asistente para estudiantes universitarios de la Facultad de Astronom\u00eda, F\u00edsica y Computaci\u00f3n de la Universidad Nacional de C\u00f3rdoba. Tu trabajo es responder preguntas acerca de aulas, materias, R\u00e9gimen Especial de Cursado, solicitudes de certificaci\u00f3n, fechas definitivas para ex\u00e1menes, calendario acad\u00e9mico e ingreso. Toda la informaci\u00f3n sobre esto puede ser encontrada en la vector store que te suministre, por lo que deber\u00e1s llamarla cada vez que te hagan una pregunta, para asegurar que la respuesta que des sea acertada.\n\nNo respondas preguntas que no tienen que ver con la Facultad de Astronom\u00eda, F\u00edsica y Computaci\u00f3n (FAMAF) o la Universidad Nacional de C\u00f3rdoba (UNC), en ese casos donde el usuario pregunta por otra cosa cuya informaci\u00f3n no encuentres en la vector store solo aclara cual es tu objetivo y que por favor ingrese una consulta que tenga que ver con tu objetivo."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [
        16,
        -144
      ],
      "id": "722842d0-f3e3-4f6d-9434-d072b3c567a8",
      "name": "Agente RAG"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -128,
        80
      ],
      "id": "d777fce7-64da-4224-9444-9c9c81d279a8",
      "name": "Gemini 2.5 Flash",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "notes": "Eres un asistente muy \u00fatil. Usa la herramienta provista para responder a las preguntas solamente en el contexto que te pas\u00e9. \n\nSi la respuesta no est\u00e1, no la inventes, simplemente d\u00ed que no sabes,"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Cuando Reciba un Mensaje').item.json.message.chat.id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        80,
        80
      ],
      "id": "60cea2fd-e0bc-482e-932f-e292b023ccde",
      "name": "Memoria de 5 mensajes vol\u00e1til"
    },
    {
      "parameters": {
        "modelName": "models/gemini-embedding-001"
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
      "typeVersion": 1,
      "position": [
        208,
        240
      ],
      "id": "4f3c5781-a1a4-4db8-bec9-71a734fac7b0",
      "name": "Embeddings Google Gemini",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Cuando Reciba un Mensaje').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false,
          "reply_to_message_id": "={{ $('Cuando Reciba un Mensaje').item.json.message.message_id }}"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        448,
        -144
      ],
      "id": "f8a13511-02ff-44ff-ba9d-6f63b9eefab9",
      "name": "Enviar Mensaje con Respuesta",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -496,
        -144
      ],
      "id": "06b3c9a9-aeff-46d9-9711-12e550a9fab2",
      "name": "Cuando Reciba un Mensaje",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Vector Store con Preguntas": {
      "ai_tool": [
        [
          {
            "node": "Agente RAG",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Cambiar estado a \"Escribiendo...\"": {
      "main": [
        [
          {
            "node": "Agente RAG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agente RAG": {
      "main": [
        [
          {
            "node": "Enviar Mensaje con Respuesta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini 2.5 Flash": {
      "ai_languageModel": [
        [
          {
            "node": "Agente RAG",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Memoria de 5 mensajes vol\u00e1til": {
      "ai_memory": [
        [
          {
            "node": "Agente RAG",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Google Gemini": {
      "ai_embedding": [
        [
          {
            "node": "Vector Store con Preguntas",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Cuando Reciba un Mensaje": {
      "main": [
        [
          {
            "node": "Cambiar estado a \"Escribiendo...\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4837251f-7d53-4499-97ab-a91b76e5b415",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "iMdKU04hORM3aWQD",
  "tags": [
    {
      "name": "FAMAF",
      "id": "mYRoVhs5Njd6jn03",
      "updatedAt": "2025-11-27T00:56:21.602Z",
      "createdAt": "2025-11-27T00:56:21.602Z"
    }
  ]
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

rag_query. Uses vectorStorePinecone, telegram, agent, lmChatGoogleGemini. Event-driven trigger; 9 nodes.

Source: https://github.com/mit0110/chatbot_famaf/blob/3740f39a771137ea15bea05cafebe16d80a33499/workflows/rag/rag_query.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

AI Document Assistant via Telegram + Supabase. Uses lmChatGoogleGemini, openWeatherMapTool, agent, telegramTrigger. Event-driven trigger; 28 nodes.

Google Gemini Chat, Open Weather Map Tool, Agent +9
AI & RAG

This template creates a Telegram AI Assistant that answers questions based on your documents, powered by Google Gemini and Supabase. Key features include Intelligent HTML Post-processing for rich form

Google Gemini Chat, Open Weather Map Tool, Agent +9
AI & RAG

Rag. Uses documentDefaultDataLoader, agent, rerankerCohere, memoryBufferWindow. Event-driven trigger; 15 nodes.

Document Default Data Loader, Agent, Reranker Cohere +7
AI & RAG

17 · Company RAG Chatbot qua Telegram: AI Agent + Pinecone + DeepSeek. Uses telegramTrigger, agent, lmChatDeepSeek, memoryBufferWindow. Event-driven trigger; 11 nodes.

Telegram Trigger, Agent, Lm Chat Deep Seek +4
AI & RAG

17 · Company RAG Chatbot qua Telegram: AI Agent + Pinecone + Gemini. Uses telegramTrigger, agent, lmChatGoogleGemini, memoryBufferWindow. Event-driven trigger; 11 nodes.

Telegram Trigger, Agent, Google Gemini Chat +4