Animated data flow diagram

AI Q&A Agent for Local Files using Mistral & Qdrant

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

Mistral AI Qdrant Local File System

Overview

Unlock Intelligent Search & Q&A for Your Local Documents with this AI Agent

This n8n AI Agent transforms your local file directory into an intelligent, searchable knowledge base. It actively monitors a specified folder for new, updated, or deleted files. When changes occur, it processes the files (text extraction, chunking), generates embeddings using Mistral AI, and syncs them with a Qdrant vector store. You can then ask questions about your documents in natural language via a chat interface, with Mistral AI providing answers based on the content stored in Qdrant.

Key Features & Benefits

  • Automated File Sync: Keeps your Qdrant vector store perfectly synchronized with your local folder (handles additions, changes, and deletions).
  • AI-Powered Indexing: Uses Mistral AI to create semantic embeddings for your documents, enabling powerful contextual search.
  • Intelligent Q&A: Leverage Mistral AI's language understanding for a conversational Q&A experience on your document set.
  • RAG Implementation: Implements a Retrieval Augmented Generation (RAG) pipeline, grounding AI responses in your specific file content.
  • Customizable: Easily configure the target folder, Qdrant collection, and Mistral AI model.
  • Extensible: Build further automations based on file events or Q&A interactions within n8n.

Use Cases

  • Building an intelligent, searchable internal knowledge base from local documents (e.g., company policies, project files, research papers).
  • Creating a personal AI research assistant for a folder of articles or notes.
  • Enabling quick, natural language Q&A on specific project documentation for development teams.
  • Automating the process of keeping a vector database updated as local source files change.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • Mistral AI API Key.
  • Access to a Qdrant instance (e.g., self-hosted Docker, Qdrant Cloud) and its API details (URL & API Key if secured).
  • A local directory that your n8n instance can read/write to (if using Docker for n8n, ensure volume mounts are correctly configured).

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure File Monitoring:
    • In the 'Local File Trigger' node, update the Path parameter to your target local folder that n8n can access.
    • In the 'Set Variables' node (ID: 7ab0e284-b667-4d1f-8ceb-fb05e4081a06), update the directory variable to match the base path of your files as they should be represented in metadata (e.g., /my_documents). Set the qdrant_collection variable to your desired Qdrant collection name (default is 'local_file_search').
  4. Configure Qdrant Connection:
    • In n8n, go to 'Credentials' and add your Qdrant API credentials (select 'Qdrant API'). If your Qdrant instance doesn't use an API key, you might need to adjust the HTTP Request nodes' authentication or ensure Qdrant is accessible without it from n8n.
    • Assign the created Qdrant credential to the 'Qdrant Vector Store' nodes (IDs: 7b29b0b9-ffee-4456-b036-9b39400d2b31 and 1857bebb-b492-415e-96c8-235329bfd28a) and to the HTTP Request nodes that interact with Qdrant ('Search For Existing Point', 'Delete Existing Point', etc.).
    • Verify the URLs in the HTTP Request nodes (e.g., 'Search For Existing Point') point to your Qdrant instance (e.g., http://your-qdrant-host:6333).
    • In the 'Qdrant Vector Store' node for ingestion (ID: 7b29b0b9-ffee-4456-b036-9b39400d2b31), ensure the 'Qdrant Collection' parameter is dynamically set using ={{ $('Set Variables').item.json.qdrant_collection }}.
  5. Configure Mistral AI:
    • In n8n, go to 'Credentials' and add your Mistral AI API key (select 'Mistral Cloud API').
    • Assign these credentials to the 'Embeddings Mistral Cloud' (ID: 7354a080-051b-479f-97b1-49cc0c14c9d8), 'Mistral Cloud Chat Model' (ID: f143e438-8176-4923-a866-3f9a2a16793d), and 'Embeddings Mistral Cloud1' (ID: 2fdabcb5-a7a7-4e02-8c1b-9190e2e52385) nodes.
  6. Align Q&A Qdrant Collection:
    • Crucially, in the 'Qdrant Vector Store1' node (ID: 1857bebb-b492-415e-96c8-235329bfd28a), which is used by the Q&A chain for retrieval, update the 'Qdrant Collection' parameter. Change it from the hardcoded 'BankStatements' to use the same dynamic collection name: ={{ $('Set Variables').item.json.qdrant_collection }}. This ensures the Q&A part queries the data you are ingesting.
  7. Test & Activate:
    • Use the 'When clicking "Test workflow"' manual trigger or trigger the 'Local File Trigger' by adding/modifying a file in the monitored folder to test the file synchronization logic. Check your Qdrant instance to see if data is ingested/updated.
    • To test the Q&A, ensure the workflow is active (deployed). Then, use the 'Chat Trigger' (ID: ffe8c363-0809-4d21-aa8f-34b0fc2dc57f) by sending a message to its webhook URL.
    • Activate the workflow for continuous operation.

Tags:

AI AgentAutomationMistral AIQdrantLocal FilesRAGDocument Q&AKnowledge BaseVector SearchSolopreneur Tool

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation