Breakdown Documents into Study Notes using Templating MistralAI and Qdrant n8n Workflow Template

n8n workflow template · 35 nodes · Mistral AI

Breakdown Documents into Study Notes using Templating MistralAI and Qdrant is a free n8n workflow template that starts from the Local File Trigger node and works with Mistral AI and Qdrant. It has 35 nodes, 16 of them AI nodes (Default Data Loader, Recursive Character Text Splitter, Mistral Cloud Embeddings and Mistral Cloud Chat Model). The notes inside the workflow say: “Join the Discord or ask in the Forum!” To run it, you add your own credentials for Mistral Cloud API and Qdrant API.

At a glance

Trigger
Local File Trigger (Local File Trigger)
Nodes
35
Apps
Mistral AI and Qdrant
AI nodes
16
Credentials
2 types
Category
RAG, documents and vector search

Apps and integrations

  • Mistral AI
  • Qdrant

Node types used

  • Local File Trigger
  • Default Data Loader
  • Recursive Character Text Splitter
  • Mistral Cloud Embeddings
  • Mistral Cloud Chat Model
  • Edit Fields (Set)
  • Merge
  • Split Out
  • Loop Over Items
  • Item List Output Parser
  • Vector Store Retriever
  • Qdrant Vector Store
  • Aggregate
  • Question and Answer Chain
  • Wait
  • Basic LLM Chain
  • Convert to File
  • Read/Write Files from Disk
  • Switch
  • Extract from File
  • Summarization Chain

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Try It Out!

This workflow automates generating notes from a source document.

  • It watches a target folder to pick up new files.
  • When a new file is detected, it saves the contents of the file in a vectorstore.
  • multiple AI agents guided by a templates list, generate the predetermined notes.
  • These notes are then export alongside the original source file for the user.

Need Help?

Join the Discord or ask in the Forum!

Step 1. Watch Folder and Import New Documents

Read more about Local File Trigger

With n8n's local file trigger, we're able to trigger the workflow when files are created in our target folder. We still have to import them however as the trigger will only give the file's path. The "Extract From" node is used to get at the file's contents.

Step 2. Summarise and Vectorise Document Contents

Learn more about using the Qdrant VectorStore

Capturing the document into our vector store is intended for a technique we'll use later known as Retrieval Augumented Generation or "RAG" for short. For our scenario, this allows our LLM to retrieve context more efficiently which produces better respsonses.

Step 3. Loop through Templates

We'll ask the LLM to help us generate 3 types of notes from the imported source document. These notes are intended to breakdown the content for faster study. Our templates for this demo are: (1) Study guide (2) Briefing document (3) Timeline

Step 5. Export Generated Templates To Folder

Learn more about writing to the local filesystem

Finally, the AI generated documents can now be exported to disk. This workflow makes it easy to generate any kind of document from various source material and can be used for training and sales.

Step 4. Use AI Agents to Query and Generate Template Documents

Read more about using the Question & Answer Retrieval Chain

n8n allows us to easily use a chain of LLMs as agents which can work together to handle any task! Here the agents generate questions to explore the content of the source document and use the answers to generate the template.

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Add your own templates here!

Nodes in this workflow

The 35 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. Local File Trigger (Local File Trigger)
  2. Default Data Loader (Default Data Loader)
  3. Recursive Character Text Splitter (Recursive Character Text Splitter)
  4. Embeddings Mistral Cloud (Mistral Cloud Embeddings)
  5. Mistral Cloud Chat Model (Mistral Cloud Chat Model)
  6. Mistral Cloud Chat Model1 (Mistral Cloud Chat Model)
  7. Prep Incoming Doc (Edit Fields (Set))
  8. Settings (Edit Fields (Set))
  9. Merge (Merge)
  10. Get Doc Types (Edit Fields (Set))
  11. Split Out Doc Types (Split Out)
  12. For Each Doc Type... (Loop Over Items)
  13. Item List Output Parser (Item List Output Parser)
  14. Vector Store Retriever (Vector Store Retriever)
  15. Embeddings Mistral Cloud1 (Mistral Cloud Embeddings)
  16. Qdrant Vector Store1 (Qdrant Vector Store)
  17. Mistral Cloud Chat Model2 (Mistral Cloud Chat Model)
  18. Split Out (Split Out)
  19. Aggregate (Aggregate)
  20. Mistral Cloud Chat Model3 (Mistral Cloud Chat Model)
  21. Discover (Question and Answer Chain)
  22. 2secs (Wait)
  23. Get Generated Documents (Edit Fields (Set))
  24. Generate (Basic LLM Chain)
  25. Prep For AI (Edit Fields (Set))
  26. To Binary (Convert to File)
  27. Export to Folder (Read/Write Files from Disk)
  28. Get FileType (Switch)
  29. Import File (Read/Write Files from Disk)
  30. Extract from PDF (Extract from File)
  31. Extract from DOCX (Extract from File)
  32. Extract from TEXT (Extract from File)
  33. Summarization Chain (Summarization Chain)
  34. Qdrant Vector Store (Qdrant Vector Store)
  35. Interview (Basic LLM Chain)

Credentials you need

  • Mistral Cloud API – used by Embeddings Mistral Cloud, Embeddings Mistral Cloud1, Mistral Cloud Chat Model and Mistral Cloud Chat Model1 and others
  • Qdrant API – used by Qdrant Vector Store and Qdrant Vector Store1

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us