# Build a PDF Document RAG System with Mistral and Qdrant: n8n workflow

> Started by someone opening a chat with it, and works across Google Drive and Qdrant. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn...

Source: https://millionrounds.com/workflow/build-a-pdf-document-rag-system-with-mistral-and-qdrant (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# Build a PDF Document RAG System with Mistral and Qdrant

Started by someone opening a chat with it, and works across Google Drive and Qdrant. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 29 steps, 3 loops or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbuild-a-pdf-document-rag-system-with-mistral-and-qdrant)

**29 steps** Large: read it before trusting it with anything live

**0** Branches: places the flow splits

**3** Loops or waits

**2** Services it connects to

## The flow

Starts it 3 Model 11 Logic 8 Service 7

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

- 1 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 2 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 3 **Token Splitter** Text Splitter Token Splitter *Model*
- 4 **When chat message received** Chat trigger *Starts it*
- 5 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 6 **Embeddings OpenAI1** Embeddings Open Ai *Model*
- 7 **When Executed by Another Workflow** Execute Workflow trigger *Starts it*
- 8 **Create collection** Http Request *Service*
- 9 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 10 **Refresh collection** Http Request *Service*
- 11 **Qdrant Vector Store** Vector Store Qdrant *Model*
- 12 **Default Data Loader** Document Default Data Loader *Model*
- 13 **Question and Answer Chain** Chain Retrieval Qa *Model*
- 14 **Qdrant Vector Store1** Vector Store Qdrant *Model*
- 15 **Get PDF** Google Drive *Service*
- 16 **Summarization Chain** Chain Summarization *Model*
- 17 **Search PDFs** Google Drive *Service*
- 18 **Wait** Wait *Logic*
- 19 **Vector Store Retriever** Retriever Vector Store *Model*
- 20 **Mistral Upload** Http Request *Service*
- 21 **Set summary** Set *Logic*
- 22 **Loop Over Items1** Split In Batches *Logic*
- 23 **Loop Over Items** Split In Batches *Logic*
- 24 **Mistral Signed URL** Http Request *Service*
- 25 **Edit Fields1** Set *Logic*
- 26 **Set page** Set *Logic*
- 27 **Mistral DOC OCR** Http Request *Service*
- 28 **Execute Workflow** Execute Workflow *Logic*
- 29 **Code** Code *Logic*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 29, 3 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Qdrant
- **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 Google Drive and Qdrant accounts, 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 29 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 29 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbuild-a-pdf-document-rag-system-with-mistral-and-qdrant)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Qdrant](https://millionrounds.com/workflows?service=Qdrant#library)

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**Automate commercial insurance submissions with Google Suite** 29 steps · Email, Google Docs](https://millionrounds.com/workflow/automate-commercial-insurance-submissions-with-google-suite)
- [**Chat with Google Drive and Pinecone** 30 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/chat-with-google-drive-and-pinecone)
- [**Create custom PDF documents from templates with Gemini** 30 steps · calls a model · Google Drive](https://millionrounds.com/workflow/create-custom-pdf-documents-from-templates-with-gemini)
- [**Generate business requirement documents with Google Workspace** 28 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/generate-business-requirement-documents-with-google-workspac)
- [**Provide academic OCR and RAG answers on Telegram with Gemini** 28 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/provide-academic-ocr-and-rag-answers-on-telegram-with-gemini)
- [**Automated workflow backup to Google Drive with Google Sheets** 28 steps · Google Drive, Google Sheets](https://millionrounds.com/workflow/automated-workflow-backup-to-google-drive-with-google-sheets)
