Build a Financial Documents Assistant using Qdrant and Mistral.ai n8n Workflow Template

n8n workflow template · 23 nodes · Mistral AI

Build a Financial Documents Assistant using Qdrant and Mistral.ai is a free n8n workflow template that starts from the Local File Trigger node and works with Mistral AI and Qdrant. It has 23 nodes, 10 of them AI nodes (Mistral Cloud Embeddings, Default Data Loader, Recursive Character Text Splitter and Chat Trigger). The notes inside the workflow say: “In this workflow, we'll monitor a specific folder on disk that n8n has access to. Since we're using docker, we can either use the n8n volume or mount a folder from the host machine.” 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
23
Apps
Mistral AI and Qdrant
AI nodes
10
Credentials
2 types
Category
RAG, documents and vector search

Apps and integrations

  • Mistral AI
  • Qdrant

Node types used

  • Local File Trigger
  • Manual Trigger
  • Edit Fields (Set)
  • Read/Write Files from Disk
  • Mistral Cloud Embeddings
  • Default Data Loader
  • Recursive Character Text Splitter
  • Chat Trigger
  • Question and Answer Chain
  • Mistral Cloud Chat Model
  • Vector Store Retriever
  • HTTP Request
  • If
  • Switch
  • Qdrant Vector Store

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.

Step 1. Select the target folder

Read more about local file trigger

In this workflow, we'll monitor a specific folder on disk that n8n has access to. Since we're using docker, we can either use the n8n volume or mount a folder from the host machine.

The local file trigger is useful to execute the workflow whenever changes are made to our target folder.

Step 2. When files are removed, the vector point is cleared.

Learn how to delete points using the Qdrant API

To keep our vectorstore relevant, we'll implement a simple synchronisation system whereby documents deleted from the local file folder are also purged from Qdrant. This can be simply achieved using Qdrant APIs.

Step 3. When files are updated, the vector point is updated.

Learn how to delete points using the Qdrant API

Similarly to the files deleted branch, when we encounter a change in a file we'll update the matching vector point in Qdrant to ensure our vector store stays relevant. Here, we can achieve this my deleting the existing vector point and creating it anew with the updated bank statement.

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.

Try It Out!

This workflow does the following

  • Monitors a target folder for changes using the local file trigger
  • Synchronises files in the target folder with their vectors in Qdrant
  • Mistral AI is used to create a Q&A AI agent on all files in the target folder

Need Help?

Join the Discord or ask in the Forum!

Step 4. When new files are added, add them to Qdrant Vectorstore.

Read more about the Qdrant node

Using Qdrant, we'll able to create a simple yet powerful RAG based application for our bank statements. One of Qdrant's most powerful features is its filtering system, we'll use it to manage the synchronisation of our local file system and Qdrant.

Step 5. Create AI Agent expert on historic bank statements

Read more about the Question & Answer Chain

Finally, let's use a Question & Answer AI node to combine the Mistral AI model and Qdrant as the vector store retriever to create a local expert for all our bank statements questions.

Nodes in this workflow

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

  1. Local File Trigger (Local File Trigger)
  2. When clicking "Test workflow" (Manual Trigger)
  3. Set Variables (Edit Fields (Set))
  4. Read File (Read/Write Files from Disk)
  5. Embeddings Mistral Cloud (Mistral Cloud Embeddings)
  6. Default Data Loader (Default Data Loader)
  7. Recursive Character Text Splitter (Recursive Character Text Splitter)
  8. Prepare Embedding Document (Edit Fields (Set))
  9. Chat Trigger (Chat Trigger)
  10. Question and Answer Chain (Question and Answer Chain)
  11. Mistral Cloud Chat Model (Mistral Cloud Chat Model)
  12. Vector Store Retriever (Vector Store Retriever)
  13. Embeddings Mistral Cloud1 (Mistral Cloud Embeddings)
  14. Remap for File_Added Flow (Edit Fields (Set))
  15. Search For Existing Point (HTTP Request)
  16. Has Existing Point? (If)
  17. Delete Existing Point (HTTP Request)
  18. Search For Existing Point1 (HTTP Request)
  19. Has Existing Point?1 (If)
  20. Delete Existing Point1 (HTTP Request)
  21. Handle File Event (Switch)
  22. Qdrant Vector Store (Qdrant Vector Store)
  23. Qdrant Vector Store1 (Qdrant Vector Store)

Credentials you need

  • Mistral Cloud API – used by Embeddings Mistral Cloud, Embeddings Mistral Cloud1 and Mistral Cloud Chat Model
  • Qdrant API – used by Delete Existing Point, Delete Existing Point1, Qdrant Vector Store and Qdrant Vector Store1 and others

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