# Build a RAG knowledge assistant with Google Drive, OpenAI, and Pinecone

> Quick Overview This workflow syncs documents from a Google Drive folder into a Pinecone vector index using OpenAI embeddings, then exposes a webhook chat endpoint where an OpenAI-powered agent answers questions by retrieving relevant context from Pinecone. How it works 1. Triggers every minute when a file in a specified Google Drive folder is updated. 2. Extracts the file’s metadata, downloads the updated file from Google Drive, and parses it into text. 3. Splits the text into chunks, generates OpenAI embeddings for each chunk, and inserts them into a Pinecone index under the configured namespace. 4. Receives user questions via a POST webhook endpoint. 5. Uses an OpenAI chat model with conversation memory and a Pinecone retrieval tool to search for relevant document chunks and answer strictly from the retrieved context. 6. Returns the agent’s response to the webhook caller. Setup 1. Connect Google Drive credentials and set the folder to watch in the Google Drive trigger. 2. Add an Open

- **Domain**: `n8n-workflow-18829.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/18829
- Page (HTML): https://agenstry.com/agents/n8n-workflow-18829.n8n.io
- Documentation: https://n8n.io/workflows/18829
