This n8n workflow implements a RAG (Retrieval-Augmented Generation) chatbot π€ that can answer questions based on your company documents or any dataset you provide. The bot uses Google Gemini embeddings, Pinecone vector store, and an AI Agent for contextual answers.
- π Upload and monitor company documents from Google Drive
- π Automatically process new or updated files
- π§ Convert documents into embeddings using Google Gemini API
- πΎ Store embeddings in Pinecone vector database
- π¨οΈ Use AI Agent to answer questions based on retrieved documents
- π Maintains conversation memory with sliding window buffer
- β‘ Easy to extend to new datasets
- n8n (latest version)
- Google Cloud Project with Vertex AI API enabled
- Google AI API Key (for Google Gemini)
- Pinecone account with index (e.g.,
company-files) - Google Drive credentials in n8n (OAuth2)
-
Google Cloud Project & Vertex AI API
- Create a project in Google Cloud βοΈ
- Enable Vertex AI API β
-
Google AI API Key
- Obtain your API key from Google AI Studio π
-
Pinecone Setup
- Create a free account at Pinecone π₯οΈ
- Create an index called
company-filesπ
-
Google Drive
- Create a dedicated folder for company documents π
- Note the folder ID π
-
Configure Credentials in n8n
- Google Drive OAuth2 π
- Google Gemini API (PaLM) π€
- Pinecone API Key ποΈ
-
Import Workflow
- Import the provided JSON workflow into n8n π₯
-
Configure Nodes
- Update Google Drive Trigger nodes to watch your specific folder π
- Configure Pinecone Vector Store nodes with your index πΎ
- Once the workflow is running, any new or updated document in the folder will be automatically processed.
- Ask questions through the chatbot π¨οΈ and it will retrieve the most relevant information from your documents.
- If a question cannot be answered, the bot will respond:
"I cannot find the answer in the available resources." β
- Ensure your Google AI API Key, Pinecone API Key, and Google Drive credentials are properly configured in n8n.
- Adjust the window buffer memory for longer or shorter conversation contexts.
- The workflow is fully modular, so you can add more tools, vector stores, or embeddings as needed.