Automation library · AI assistants

Build a dual-stage RAG chat assistant with Google Drive

Started by someone opening a chat with it, and works across Google Drive and Pinecone. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 27 steps, 2 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: GeminiRetrieval

27 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 3Model 15Logic 5Service 4

The steps in the order they run, from what starts it.

  1. 1Manual Test TriggerManual triggerStarts it
  2. 2When File Updated in DriveGoogle Drive triggerStarts it
  3. 3Generate Ollama EmbeddingsEmbeddings OllamaModel
  4. 4Load Data for IngestionDocument Default Data LoaderModel
  5. 5On Chat Message ReceivedChat triggerStarts it
  6. 6Cache Query with OllamaEmbeddings OllamaModel
  7. 7Google Chat Model for AgentLm Chat Google GeminiModel
  8. 8Manage Simple MemoryMemory Buffer WindowModel
  9. 9Google Chat Model for ToolLm Chat Google GeminiModel
  10. 10Fetch Ollama Knowledge EmbeddingsEmbeddings OllamaModel
  11. 11Store Embeddings in CacheEmbeddings OllamaModel
  12. 12Cache Storage Data LoaderDocument Default Data LoaderModel
  13. 13Search Drive FilesGoogle DriveService
  14. 14Store Knowledge in PineconeVector Store PineconeModel
  15. 15Lookup in Semantic CacheVector Store PineconeModel
  16. 16AI Query Response AgentAgentModel
  17. 17Vector Store Question AnsweringTool Vector StoreModel
  18. 18Retrieve Knowledge from PineconeVector Store PineconeModel
  19. 19Store Answer in Semantic CacheVector Store PineconeModel
  20. 20Download Drive FileGoogle DriveService
  21. 21Evaluate JavaScript CacheCodeLogic
  22. 22Check If PDFIfLogic
  23. 23Check Cache HitIfLogic
  24. 24Extract PDF ContentExtract From FileService
  25. 25Extract Text ContentExtract From FileService
  26. 26Set Cached AnswerSetLogic
  27. 27Merge Extracted ContentMergeLogic

How it's built

Starts on
Someone opening a chat with it
Steps
27, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Google Drive, Pinecone
Model
Gemini
Retrieval
Answers are drawn from documents you supply, not from the model alone

Questions

What does it need to run?

An n8n account, plus your own Google Drive and Pinecone accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 27 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 27 steps before you point it at anything that matters.