Chat with Local Documents in n8n: Ollama + MariaDB Vector Cache
Chat with Local Documents in n8n: Ollama + MariaDB Vector Cache
Regular price
£2.99
Regular price
£2.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
Chat with Local Documents in n8n: Ollama + MariaDB Vector Cache
Regular price
£2.99
Regular price
£2.99
Sale price
Unit price
/
per
Chat with your own files locally in n8n—using Ollama embeddings + a MariaDB vector cache
This n8n workflow ingests documents from an FTP server into a MariaDB vector store, then lets users ask questions through an n8n chat trigger. Answers are generated with Ollama from retrieved document context—and repeated questions are automatically cached in MariaDB for fast, cost-saving responses.
What this workflow does
- Manual document ingestion via FTP: Lists and downloads a file from an FTP server, extracts its text, and prepares it for indexing.
- Summarize & categorize: Sends extracted text to an Ollama chat model to produce a short summary and assign a category from an allowed list.
- Create a vector index in MariaDB: Splits the document into chunks, generates Ollama embeddings for each chunk, and inserts chunk text, vectors, and metadata into the MariaDB documents table (including a VECTOR column).
- Chat with retrieval-augmented generation (RAG): Receives a question via an n8n Chat trigger, normalizes it, and checks the MariaDB qa_cache for a matching cached answer.
- Retrieve context & answer strictly from it: If not cached, embeds the question, retrieves the top similar chunks from MariaDB by vector distance, builds a context-cited prompt, and asks an Ollama chat model to answer strictly from that retrieved context.
- Cache new answers: Stores the new response back into qa_cache and returns either the cached or newly generated answer.
Use cases
- Internal “chat with documents” for operators who receive files over FTP
- Faster Q&A for frequently asked support questions via MariaDB caching
- Private RAG setups where you want control over embeddings and storage (MariaDB + Ollama)
Technical details
- Integrations / nodes: if, ftp, set, code, MySQL/MariaDB, sticky note
- Data storage: MariaDB 11.7+ with documents (VECTOR column) and qa_cache
- Modeling: Ollama chat model for summary/categorization and embeddings generation for vector retrieval
- Key configuration: MariaDB credentials, Ollama base URL, and embedding/chat model names, plus FTP credentials
