Agente de conocimiento (con Google Drive, Telegram)
Este es unAI RAG, Multimodal AIflujo de automatización del dominio deautomatización que contiene 13 nodos.Utiliza principalmente nodos como Telegram, GoogleDrive, Agent, TelegramTrigger, GoogleDriveTrigger. Chatbot de preguntas y respuestas de documentos basado en Google Drive, GPT-4-mini y Telegram (sistema RAG)
- •Bot Token de Telegram
- •Credenciales de API de Google Drive
- •Clave de API de OpenAI
Nodos utilizados (13)
Categoría
{
"id": "UZz84VC8pY6FRROm",
"meta": {
"instanceId": "0e8fdabaa466e62faf8e9a5c8aa5dd452ffac3f7ec047a63d5c8b1d769a5fcf7",
"templateId": "knowledge_store_agent_with_google_drive",
"templateCredsSetupCompleted": true
},
"name": "Knowledge agent (with Google Drive, Telegram)",
"tags": [],
"nodes": [
{
"id": "708d9e4e-6566-4b18-86b8-8301bf0c72dd",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
384,
-64
],
"parameters": {
"options": {},
"dataType": "binary"
},
"typeVersion": 1.1
},
{
"id": "604a4e5e-5ccc-4db1-94dc-673711bea6af",
"name": "Descargar archivo",
"type": "n8n-nodes-base.googleDrive",
"position": [
-192,
-240
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LQ155GD7daIPvHOZ",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "e8db240e-bb3f-43ab-b4ed-527c6c2e8f54",
"name": "Embedding model",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
144,
-48
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "EwkNMKtlWGUUxIVL",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "99f9315f-4f3d-48d9-a6f4-8c519b249eba",
"name": "Agente IA",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-352,
320
],
"parameters": {
"text": "={{ $json.message.text }}",
"options": {
"systemMessage": "# Knowledge Store Agent System Prompt\n\nYou are a data analysis agent that retrieves and analyzes information from a vector store to answer user questions.\n\n## Your Task\n\n1. **Search the vector store** - Use similarity search to find relevant documents and data\n2. **Analyze the results** - Understand what the retrieved data tells you\n3. **Provide clear answers** - Give helpful responses based on the data you found\n\n## How to Work with Vector Data\n\n### Search Process\n- Use the user's question to search for similar content\n- Retrieve multiple relevant chunks of data\n- Look for patterns and connections across the results\n- Consider both exact matches and conceptually similar information\n\n### Analysis Guidelines\n- Read through all retrieved documents carefully\n- Identify key information that answers the user's question\n- Note any conflicting or incomplete information\n- Look for trends, patterns, or insights in the data\n\n### Response Format\n- Start with a direct answer to the user's question\n- Support your answer with specific information from the data\n- Cite which documents or sources your information comes from\n- Be clear about what you found and what you didn't find\n\n## Response Guidelines\n\n### When You Find Good Data\n- Give a confident, detailed answer\n- Include relevant quotes or data points\n- Explain how the information relates to their question\n- Offer additional insights if available\n\n### When Data is Limited\n- Be honest about what information is available\n- Share what you did find, even if partial\n- Suggest related questions you could help with\n- Don't make up information not in the data\n\n### When No Relevant Data is Found\n- Clearly state that you couldn't find relevant information\n- Suggest alternative ways to phrase the question\n- Offer to search for related topics\n\n## Key Principles\n\n- Always base answers on the retrieved data\n- Be transparent about your sources\n- Admit when information is unclear or missing\n- Help users understand what the data shows\n- Ask clarifying questions if the user's request is vague\n\nRemember: Your strength is finding and explaining information that already exists in the vector store. Focus on being accurate and helpful with the data you can retrieve."
},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "9751b75b-50ac-49c8-8f4d-24a8035b6e73",
"name": "Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-416,
560
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "gpt-4.1-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "EwkNMKtlWGUUxIVL",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "167d097a-69f6-4f1b-a741-8c8936adb3d2",
"name": "Simple Memoria",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-272,
544
],
"parameters": {
"sessionKey": "={{ $json.message.chat.id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "0cddc21e-a75f-48df-b168-8e288be12469",
"name": "Archivo cargado",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
-608,
-240
],
"parameters": {
"event": "fileCreated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "1Nc_T_wHj8eF6LLed8D8hZX-q1YUeZT5j",
"cachedResultUrl": "https://drive.google.com/drive/folders/1Nc_T_wHj8eF6LLed8D8hZX-q1YUeZT5j",
"cachedResultName": "Rag-Folder"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LQ155GD7daIPvHOZ",
"name": "Google Drive account"
}
},
"typeVersion": 1
},
{
"id": "b60fde91-e9bf-4f03-a847-b471af228a95",
"name": "Nota adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1024,
-16
],
"parameters": {
"color": 5,
"width": 304,
"height": 512,
"content": "### Knowledge store agent\nA chat-based AI agent to retrieve, analyze, and answer questions using documents uploaded to Google Drive and stored in a vector database.\n\n#### Set up\n- Configure credentials in the **Google Drive** and **Open AI** nodes\n- Create a folder in Google Drive to store your documents, then select it in the \"File uploaded\" trigger node\n- Upload a file to that folder, return to n8n and click \"Execute workflow\"\n- Once **Insert documents** has been completed you can Open chat and ask the agent questions about your files.\n\n#### Next steps\nTry connecting other data sources to your knowledge base, using other triggers before the **Insert documents** node.\n"
},
"typeVersion": 1
},
{
"id": "2fa9684d-f20a-4262-9b8b-81babb2fecc5",
"name": "Nota adhesiva 3",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
624
],
"parameters": {
"color": 4,
"width": 320,
"height": 240,
"content": "### Embeddings\n\nThe Insert and Retrieve operation use the same embedding node.\n\nThis is to ensure that they are using the **exact same embeddings and settings**.\n\nDifferent embeddings might not work at all, or have unintended consequences.\n"
},
"typeVersion": 1
},
{
"id": "64d17551-1637-4a53-a3e0-db45894c12a6",
"name": "Insertar documentos",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
240,
-240
],
"parameters": {
"mode": "insert",
"memoryKey": {
"__rl": true,
"mode": "list",
"value": "vector_store_key",
"cachedResultName": "vector_store_key"
}
},
"typeVersion": 1.3
},
{
"id": "4f8a4a45-28a4-4684-b838-66011cc6a4a5",
"name": "Recuperar documentos",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
-288,
0
],
"parameters": {
"mode": "retrieve-as-tool",
"topK": 10,
"memoryKey": {
"__rl": true,
"mode": "list",
"value": "vector_store_key",
"cachedResultName": "vector_store_key"
},
"toolDescription": "Use this tool to retrieve any information required."
},
"typeVersion": 1.3
},
{
"id": "a5249962-686f-40fe-bee4-1b7d3bea5e79",
"name": "Escuchar eventos entrantes",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-640,
320
],
"webhookId": "322dce18-f93e-4f86-b9b1-3305519b7834",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "23MJQt59L7oOwA07",
"name": "Telegram account"
}
},
"typeVersion": 1
},
{
"id": "36f64ae1-cd45-4c4d-a130-434240fae577",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"onError": "continueErrorOutput",
"position": [
32,
320
],
"webhookId": "b0c8b1dc-6607-4681-84d7-7e600348cb56",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Listen for incoming events').first().json.message.from.id }}",
"additionalFields": {
"parse_mode": "Markdown",
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "23MJQt59L7oOwA07",
"name": "Telegram account"
}
},
"typeVersion": 1.1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "fede1a58-ea3d-45f3-a4fa-4b4a367dadea",
"connections": {
"9751b75b-50ac-49c8-8f4d-24a8035b6e73": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "36f64ae1-cd45-4c4d-a130-434240fae577",
"type": "main",
"index": 0
}
]
]
},
"604a4e5e-5ccc-4db1-94dc-673711bea6af": {
"main": [
[
{
"node": "64d17551-1637-4a53-a3e0-db45894c12a6",
"type": "main",
"index": 0
}
]
]
},
"0cddc21e-a75f-48df-b168-8e288be12469": {
"main": [
[
{
"node": "604a4e5e-5ccc-4db1-94dc-673711bea6af",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"e8db240e-bb3f-43ab-b4ed-527c6c2e8f54": {
"ai_embedding": [
[
{
"node": "64d17551-1637-4a53-a3e0-db45894c12a6",
"type": "ai_embedding",
"index": 0
},
{
"node": "4f8a4a45-28a4-4684-b838-66011cc6a4a5",
"type": "ai_embedding",
"index": 0
}
]
]
},
"4f8a4a45-28a4-4684-b838-66011cc6a4a5": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"708d9e4e-6566-4b18-86b8-8301bf0c72dd": {
"ai_document": [
[
{
"node": "64d17551-1637-4a53-a3e0-db45894c12a6",
"type": "ai_document",
"index": 0
}
]
]
},
"a5249962-686f-40fe-bee4-1b7d3bea5e79": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio - RAG de IA, IA Multimodal
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
DuyTran
@duytran82Compartir este flujo de trabajo