Automation library · Documents and files

RAG-powered document chatbot with OpenAI and Gemini

Started by someone opening a chat with it, and works across in-memory vectors. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 32 steps, 1 branch, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: Gemini, OpenAIRetrieval

32 stepsLarge: read it before trusting it with anything live
1Branch: places the flow splits
1Loop or waits
1Service it connects to

The flow

Starts it 2Model 10Logic 5Service 15

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

  1. 1OpenAI Chat ModelLm Chat Open AiModel
  2. 2Window Buffer MemoryMemory Buffer WindowModel
  3. 3When chat message receivedChat triggerStarts it
  4. 4Embeddings Google GeminiEmbeddings Google GeminiModel
  5. 5Recursive Character Text SplitterText Splitter Recursive Character Text SplitterModel
  6. 6On form submissionForm triggerStarts it
  7. 7Embeddings Google Gemini1Embeddings Google GeminiModel
  8. 8Simple MemoryMemory Buffer WindowModel
  9. 9AI AgentAgentModel
  10. 10CodeCodeLogic
  11. 11Simple Vector StoreVector Store In MemoryModel
  12. 12Default Data LoaderDocument Default Data LoaderModel
  13. 13Query Data Tool1Vector Store In MemoryModel
  14. 14Split OutSplit OutLogic
  15. 15Loop Over ItemsSplit In BatchesLogic
  16. 16AggregateAggregateLogic
  17. 17SwitchSwitchLogic
  18. 18Convert to FileConvert To FileService
  19. 19Convert to File1Convert To FileService
  20. 20Convert to File2Convert To FileService
  21. 21Convert to File3Convert To FileService
  22. 22Convert to File4Convert To FileService
  23. 23Convert to File5Convert To FileService
  24. 24Convert to File7Convert To FileService
  25. 25Convert to File8Convert To FileService
  26. 26Extract from FileExtract From FileService
  27. 27Extract from File1Extract From FileService
  28. 28Extract from File2Extract From FileService
  29. 29Extract from File3Extract From FileService
  30. 30Extract from File4Extract From FileService
  31. 31Extract from File6Extract From FileService
  32. 32Extract from File7Extract From FileService

How it's built

Starts on
Someone opening a chat with it
Steps
32, with 1 branch, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
in-memory vectors
Model
Gemini, OpenAI
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 in-memory vectors account, and a key for Gemini and OpenAI. 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 and OpenAI. 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 32 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 32 steps before you point it at anything that matters.