connected workflows
One for ingestion (vectorise), one for retrieval (chat agent). They share the same Pinecone index and namespace.
A two-workflow n8n system that automatically vectorises documents from Google Drive into Pinecone, then lets users ask questions through a conversational AI agent grounded in that knowledge base.
Instead of reading through PDFs or searching folders manually, a user simply asks a question and the agent retrieves only the relevant passages from the vector store to answer it.
Most teams store important information in documents that sit in shared drives. When someone needs an answer, they open the folder, skim through files, and hope they find the right paragraph. The bigger the knowledge base grows, the longer this takes, and the more context gets missed.
This project solves that with two connected n8n workflows. The first watches a Google Drive folder for new files, downloads each PDF, splits it into overlapping chunks of 850 characters, generates OpenAI embeddings, and inserts them into a Pinecone vector index. The second workflow is a chat-based AI agent: it receives a user question, queries the vector store for the most relevant passages, and returns a grounded answer using only the stored content. No hallucination, no guessing, no external sources.
The demo uses iOS 26 documentation as the knowledge base, but the architecture works for any domain: internal policies, product specs, research papers, or training materials.
One for ingestion (vectorise), one for retrieval (chat agent). They share the same Pinecone index and namespace.
6 nodes handle the vectorisation pipeline; 8 nodes power the conversational agent with memory, tools, and dual LLM calls.
Documents are split into 850-character segments with 50-character overlap, keeping context intact across chunk boundaries.
The agent retains the last 10 conversation turns, so follow-up questions stay contextual without re-stating the topic.
A Google Drive trigger polls the designated "RAG KB's" folder every minute for newly created files.
Each PDF is downloaded, loaded through a document parser, and split into overlapping chunks using a recursive character text splitter.
OpenAI generates embeddings for each chunk, which are inserted into the "rag-agent" Pinecone index under the "rag-vector" namespace.
A public chat interface receives the user's question and passes it to the AI agent node.
The agent's vector store tool queries Pinecone for the most relevant document chunks, scored by semantic similarity.
GPT-5 Mini synthesises the retrieved passages into a clear, concise answer. If the information isn't in the store, the agent says so rather than guessing.