diff --git a/workflows/Chat with PDF, CSV, and JSON documents using Google Gemini RAG-13575/13575-chat-with-pdf--csv--and-json-documents-using-google-gemini-rag.webp b/workflows/Chat with PDF, CSV, and JSON documents using Google Gemini RAG-13575/13575-chat-with-pdf--csv--and-json-documents-using-google-gemini-rag.webp new file mode 100644 index 000000000..03078b42d --- /dev/null +++ b/workflows/Chat with PDF, CSV, and JSON documents using Google Gemini RAG-13575/13575-chat-with-pdf--csv--and-json-documents-using-google-gemini-rag.webp @@ -0,0 +1 @@ +{"id":"lneyM4DwfKEiLcpY","meta":{"tags":["AI","RAG","Chatbot","Documents","Knowledge Base","Gemini","Automation"],"useCase":"Turn documents into an interactive AI knowledge base and chatbot.","createdBy":{"url":"https://ainconsulting.com","name":"Md. Khalid Ali"},"categories":["AI","Productivity","Knowledge Base"],"instanceId":"","description":"Upload PDF, CSV, or JSON files and ask questions about their content using an AI-powered Retrieval-Augmented Generation (RAG) workflow built with Google Gemini. Demonstrates document ingestion, vector storage, and conversational retrieval in a beginner-friendly automation.","templateCredsSetupCompleted":true},"name":"AI Multi-Format Document Q&A (PDF, CSV, JSON)","tags":[],"nodes":[{"id":"b558578b-4be9-4fb0-b339-ed135510ec28","name":"Document Upload Form","type":"n8n-nodes-base.formTrigger","position":[-704,-192],"webhookId":"63535cab-49e2-4d33-a1f2-29d512b1a6ef","parameters":{"options":{"appendAttribution":false},"formTitle":"Document Upload for Knowledge Base","formFields":{"values":[{"fieldType":"file","fieldLabel":"Document File","acceptFileTypes":".pdf, .csv, .json"}]},"formDescription":"Upload PDF, CSV, or JSON files"},"typeVersion":2.3},{"id":"285ec04b-4619-479a-b50e-b4a57ef6a330","name":"Add Metadata","type":"n8n-nodes-base.set","position":[-512,-192],"parameters":{"options":{},"assignments":{"assignments":[{"id":"id-1","name":"filename","type":"string","value":"={{ $json['Document File'][0].filename }}"},{"id":"id-2","name":"fileType","type":"string","value":"={{ $json['Document File'][0].mimetype }}"},{"id":"id-3","name":"uploadDate","type":"string","value":"={{ $json.submittedAt }}"}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"fabb9bbe-9bac-4dbd-b854-fa7b8dede758","name":"Vector Store Insert","type":"@n8n/n8n-nodes-langchain.vectorStoreInMemory","position":[-256,-192],"parameters":{"mode":"insert","memoryKey":{"__rl":true,"mode":"id","value":"Document_File"}},"typeVersion":1.3},{"id":"f73dc9fd-da62-4435-804e-be58a1c919da","name":"Document Loader","type":"@n8n/n8n-nodes-langchain.documentDefaultDataLoader","position":[-176,48],"parameters":{"options":{},"dataType":"binary","textSplittingMode":"custom"},"typeVersion":1.1},{"id":"f5f283b0-7584-4404-8b3c-aac6c725b4ea","name":"Chatbot Trigger","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[-1568,304],"webhookId":"a28ad270-0da3-485d-8f46-9ffc08e263d7","parameters":{"public":true,"options":{"title":"AI Document Knowledge Base Assistant","subtitle":"Ask any questions about the uploaded document"},"initialMessages":"Hi! I'm your virtual assistant. You can ask me anything about the knowledge database that I have."},"typeVersion":1.4},{"id":"dffdf4a3-c72c-4f55-bb55-0ab1c7e804bb","name":"Knowledge Base Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[-1360,304],"parameters":{"text":"={{ $json.chatInput }}","options":{"systemMessage":"You are an advanced AI Knowledge Base Assistant designed to answer questions strictly based on uploaded documents.\n\nOPERATING RULES:\n\n1. Always search the knowledge base before answering.\n2. Only use information retrieved from the vector database.\n3. If the answer is not found, clearly say: \"I could not find this information in the uploaded documents.\"\n4. Never hallucinate or invent details.\n5. When possible, cite the source filename and relevant section.\n6. Provide structured, clear, and concise answers.\n7. If the user asks for summaries, provide a well-organized summary.\n8. If the user asks for analysis, compare, or insights, derive them strictly from the retrieved data.\n9. If the uploaded file is CSV or JSON, interpret it intelligently (tables, fields, values, trends).\n10. Keep answers professional, factual, and helpful.\n\nRESPONSE STYLE:\n\n- Use bullet points when helpful\n- Use short paragraphs\n- Be precise and information-dense\n- Avoid filler text"},"promptType":"define"},"typeVersion":3},{"id":"1bb26476-a290-4cf2-8243-3fa7bd658617","name":"Chat Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[-1264,480],"parameters":{"contextWindowLength":10},"typeVersion":1.3},{"id":"f4ca267b-9623-4a8f-8698-fc771185fc4b","name":"Embeddings Google Gemini","type":"@n8n/n8n-nodes-langchain.embeddingsGoogleGemini","position":[-320,48],"parameters":{"modelName":"models/gemini-embedding-001"},"typeVersion":1},{"id":"a1b48a08-63f2-4f8e-a905-df7545affc08","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-1424,480],"parameters":{"options":{}},"typeVersion":1},{"id":"dd4ea245-64ad-4243-9741-8512e51fa0c3","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-816,-240],"parameters":{"color":6,"width":992,"height":608,"content":"## Document Ingestion"},"typeVersion":1},{"id":"8b98eaff-7c1c-4621-8c25-c5ff3292a563","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-1632,160],"parameters":{"color":6,"width":800,"height":560,"content":"## Chat and AI response"},"typeVersion":1},{"id":"249ef950-2c97-4a43-abd4-7e7316a318d2","name":"Vector Store Retrieve","type":"@n8n/n8n-nodes-langchain.vectorStoreInMemory","position":[-1120,480],"parameters":{"mode":"retrieve-as-tool","topK":5,"memoryKey":{"__rl":true,"mode":"id","value":"Document_File"},"toolDescription":"Search the knowledge base for information from uploaded documents"},"typeVersion":1.3},{"id":"2660e12e-00c0-48dd-918d-f2195b7b9d84","name":"Token Splitter","type":"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","position":[-176,208],"parameters":{"options":{},"chunkOverlap":200},"typeVersion":1},{"id":"fa62450f-95da-47db-9fce-7781e38ae8db","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-1088,-944],"parameters":{"width":1488,"height":624,"content":"## Chat with PDF, CSV, and JSON documents using AI\n\nThis workflow turns uploaded documents into an AI-powered knowledge base. Users can upload PDF, CSV, or JSON files and ask questions about their content through a chatbot interface. The workflow converts documents into embeddings and retrieves relevant information before generating answers, ensuring responses are grounded in uploaded data.\n\nThis template is designed as a simple starting point for building document assistants using Retrieval-Augmented Generation (RAG). It demonstrates how ingestion, vector storage, and AI interaction work together in a practical automation workflow.\n\n## How it works\n\n1. A document is uploaded using the form trigger \n2. The content is extracted and split into smaller chunks \n3. Google Gemini generates embeddings \n4. Data is stored in a vector store \n5. The chatbot retrieves relevant context \n6. AI generates answers based on retrieved content \n\n## Setup steps\n\n1. Add Google Gemini API credentials \n2. Activate the workflow \n3. Upload a PDF, CSV, or JSON document \n4. Open the chat interface and ask questions"},"typeVersion":1},{"id":"8546dc07-be90-4787-a15d-8160f874d97a","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-1184,-240],"parameters":{"width":368,"content":"## Processes uploaded files and converts them into searchable embeddings used for semantic retrieval."},"typeVersion":1},{"id":"1ca4171f-0379-492a-9892-a0c628c8dd1f","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-1632,0],"parameters":{"width":368,"content":"## Retrieves relevant document context and generates grounded AI answers using a RAG-based agent."},"typeVersion":1},{"id":"89ee1a7c-ffee-4274-b3df-db075ef59c98","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[176,-240],"parameters":{"width":368,"height":176,"content":"## Uses an in-memory vector store. Data resets when the workflow restarts. Replace with a persistent database for production use."},"typeVersion":1}],"active":false,"pinData":{},"settings":{"executionOrder":"v1"},"versionId":"4c20faf5-2dcd-4f4b-bdd7-15677f93f6dd","connections":{"Chat Memory":{"ai_memory":[[{"node":"Knowledge Base Agent","type":"ai_memory","index":0}]]},"Add Metadata":{"main":[[{"node":"Vector Store Insert","type":"main","index":0}]]},"Token Splitter":{"ai_textSplitter":[[{"node":"Document Loader","type":"ai_textSplitter","index":0}]]},"Chatbot Trigger":{"main":[[{"node":"Knowledge Base Agent","type":"main","index":0}]]},"Document Loader":{"ai_document":[[{"node":"Vector Store Insert","type":"ai_document","index":0}]]},"Document Upload Form":{"main":[[{"node":"Add Metadata","type":"main","index":0}]]},"Vector Store Retrieve":{"ai_tool":[[{"node":"Knowledge Base Agent","type":"ai_tool","index":0}]]},"Embeddings Google Gemini":{"ai_embedding":[[{"node":"Vector Store Insert","type":"ai_embedding","index":0},{"node":"Vector Store Retrieve","type":"ai_embedding","index":0}]]},"Google Gemini Chat Model":{"ai_languageModel":[[{"node":"Knowledge Base Agent","type":"ai_languageModel","index":0}]]}}} \ No newline at end of file