{"id":"2Eba0OHGtOmoTWOU","meta":{"instanceId":"workflow-6ab0a70c","versionId":"1.0.0","createdAt":"2025-09-29T07:07:44.610608","updatedAt":"2025-09-29T07:07:44.610631","owner":"n8n-user","license":"MIT","category":"automation","status":"active","priority":"high","environment":"production"},"name":"RAG AI Agent with Milvus and Cohere","nodes":[{"id":"361065cc-edbf-47da-8da7-c59b564db6f3","name":"Default Data Loader","type":"n8n-nodes-base.noOp","position":[0,320],"parameters":{"options":{}},"typeVersion":1,"notes":"This documentDefaultDataLoader node performs automated tasks as part of the workflow."},{"id":"a01b9512-ced1-4e28-a2aa-88077ab79d9a","name":"Embeddings Cohere","type":"n8n-nodes-base.noOp","position":[-140,320],"parameters":{"modelName":"embed-multilingual-v3.0"},"credentials":{"cohereApi":{"id":"8gcYMleu1b8Hm03D","name":"CohereApi account"}},"typeVersion":1,"notes":"This embeddingsCohere node performs automated tasks as part of the workflow."},{"id":"1da6ea4b-de88-44d3-a215-78c55b5592a2","name":"When chat message received","type":"n8n-nodes-base.noOp","position":[-800,520],"webhookId":"a4257301-3fb9-4b9d-a965-1fa66f314696","parameters":{"options":{}},"typeVersion":1,"notes":"This chatTrigger node performs automated tasks as part of the workflow."},{"id":"23004477-3f6d-4909-a626-0eba0557a5bd","name":"Watch New Files","type":"n8n-nodes-base.googleDriveTrigger","position":[-800,100],"parameters":{"event":"fileCreated","options":{},"pollTimes":{"item":[{"mode":"everyMinute"}]},"triggerOn":"specificFolder","folderToWatch":{"__rl":true,"mode":"list","value":"15gjDQZiHZuBeVscnK8Ic_kIWt3mOaVfs","cachedResultUrl":"{{ $env.WEBHOOK_URL }}","cachedResultName":"RAG template"}},"credentials":{"googleDriveOAuth2Api":{"id":"r1DVmNxwkIL8JO17","name":"Google Drive account"}},"typeVersion":1,"notes":"This googleDriveTrigger node performs automated tasks as part of the workflow."},{"id":"001fbdbe-dfcb-4552-bf09-de416b253389","name":"Download New","type":"n8n-nodes-base.googleDrive","position":[-580,100],"parameters":{"fileId":{"__rl":true,"mode":"id","value":"={{ $json.id }}"},"options":{},"operation":"download"},"credentials":{"googleDriveOAuth2Api":{"id":"r1DVmNxwkIL8JO17","name":"Google Drive account"}},"typeVersion":3,"notes":"This googleDrive node performs automated tasks as part of the workflow."},{"id":"c1116cba-beb9-4d28-843d-c5c21c0643de","name":"Insert into Milvus","type":"n8n-nodes-base.noOp","position":[-124,100],"parameters":{"mode":"insert","options":{"clearCollection":false},"milvusCollection":{"__rl":true,"mode":"list","value":"collectionName","cachedResultName":"collectionName"}},"credentials":{"milvusApi":{"id":"Gpsxqr2l9Qxu48h0","name":"Milvus account"}},"typeVersion":1,"notes":"This vectorStoreMilvus node performs automated tasks as part of the workflow."},{"id":"2dbc7139-46f6-41d8-8c13-9fafad5aec55","name":"RAG Agent","type":"n8n-nodes-base.noOp","position":[-540,520],"parameters":{"options":{}},"typeVersion":1,"notes":"This agent node performs automated tasks as part of the workflow."},{"id":"a103506e-9019-41f2-9b0d-9b831434c9e9","name":"Retrieve from Milvus","type":"n8n-nodes-base.noOp","position":[-340,740],"parameters":{"mode":"retrieve-as-tool","topK":10,"toolName":"vector_store","toolDescription":"You are an AI agent that responds based on information received from a vector database.","milvusCollection":{"__rl":true,"mode":"list","value":"collectionName","cachedResultName":"collectionName"}},"credentials":{"milvusApi":{"id":"Gpsxqr2l9Qxu48h0","name":"Milvus account"}},"typeVersion":1,"notes":"This vectorStoreMilvus node performs automated tasks as part of the workflow."},{"id":"74ccdff1-b976-4e1c-a2c4-237ffff19e34","name":"OpenAI 4o","type":"n8n-nodes-base.noOp","position":[-580,740],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o","cachedResultName":"gpt-4o"},"options":{}},"credentials":{"openAiApi":{"id":"vupAk5StuhOafQcb","name":"OpenAi account"}},"typeVersion":1,"notes":"This lmChatOpenAi node performs automated tasks as part of the workflow."},{"id":"36e35eaf-f723-4eeb-9658-143d5bc390a0","name":"Memory","type":"n8n-nodes-base.noOp","position":[-460,740],"parameters":{},"typeVersion":1,"notes":"This memoryBufferWindow node performs automated tasks as part of the workflow."},{"id":"ec7b6b92-065c-455c-a3f0-17586d9e48d7","name":"Cohere embeddings","type":"n8n-nodes-base.noOp","position":[-220,900],"parameters":{"modelName":"embed-multilingual-v3.0"},"credentials":{"cohereApi":{"id":"8gcYMleu1b8Hm03D","name":"CohereApi account"}},"typeVersion":1,"notes":"This embeddingsCohere node performs automated tasks as part of the workflow."},{"id":"3c3a8900-0b98-4479-8602-16b21e011ba1","name":"Set Chunks","type":"n8n-nodes-base.noOp","position":[80,480],"parameters":{"options":{},"chunkSize":700,"chunkOverlap":60},"typeVersion":1,"notes":"This textSplitterRecursiveCharacterTextSplitter node performs automated tasks as part of the workflow."},{"id":"3a43bf1a-7e22-4b5e-bbb1-6bb2c1798c07","name":"Extract from File","type":"n8n-nodes-base.extractFromFile","position":[-360,100],"parameters":{"options":{},"operation":"pdf"},"typeVersion":1,"notes":"This extractFromFile node performs automated tasks as part of the workflow."},{"id":"e0c9d4d7-5e3e-4e47-bb1f-dbdca360b20a","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1440,120],"parameters":{"color":2,"width":540,"height":600,"content":"## Why Milvus\nBased on comparisons and user feedback, **Milvus is often considered a more performant and scalable vector database solution compared to Supabase**, particularly for demanding use cases involving large datasets, high-volume vector search operations, and multilingual support.\n\n\n### Requirements\n- Create an account on [Zilliz]({{ $env.WEBHOOK_URL }} to generate the Milvus cluster. \n- There is no need to create docker containers or your own instance, Zilliz provides the cloud infraestructure to build it easily\n- Get your credentials ready from Drive, Milvus (Zilliz), and [Cohere]({{ $env.WEBHOOK_URL }}\n\n### Usage\nEvery time a new pdf is added into the Drive folder, it will be inserted into the Milvus Vector Store, allowing for the interaction with the RAG agent in seconds.\n\n## Calculate your company's RAG costs\n\nWant to run Milvus on your own server on n8n? Zilliz provides a great [cost calculator]({{ $env.WEBHOOK_URL }}\n\n### Get in touch with us\nWant to implement a RAG AI agent for your company? [Shoot us a message]({{ $env.WEBHOOK_URL }}\n"},"typeVersion":1,"notes":"This stickyNote node performs automated tasks as part of the workflow."},{"id":"error-43cf3364","name":"Error Handler","type":"n8n-nodes-base.stopAndError","typeVersion":1,"position":[1000,400],"parameters":{"message":"Workflow execution error","options":{}}}],"active":true,"settings":{"executionOrder":"v1","saveManualExecutions":true,"callerPolicy":"workflowsFromSameOwner","errorWorkflow":null,"timezone":"UTC","executionTimeout":3600,"maxExecutions":1000,"retryOnFail":true,"retryCount":3,"retryDelay":1000},"versionId":"8b5fc2b8-50f7-425c-8fc8-94ba4f76ecf3","connections":{"Watch New Files":{"main":[[]]},"Download New":{"main":[[]]},"OpenAI 4o":{"main":[[]]},"Extract from File":{"main":[[]]}},"description":"Automated workflow: RAG AI Agent with Milvus and Cohere. This workflow integrates 13 different services: stickyNote, googleDriveTrigger, textSplitterRecursiveCharacterTextSplitter, agent, googleDrive. It contains 18 nodes and follows best practices for error handling and security.","notes":"Excellent quality workflow: RAG AI Agent with Milvus and Cohere. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}