Skip to content
Courses/Self-hosted AI automation for small businesses/Private RAG with n8n, Qdrant, and Ollama

Private RAG with n8n, Qdrant, and Ollama

The stack most commonly used by SMBs and solopreneurs is straightforward: private documents in Qdrant, a local model with Ollama, and n8n as the glue to receive questions, query context, and respond with human oversight.

  • Design a local RAG flow without sending documents to external APIs.
  • Separate ingestion, retrieval, generation, and response delivery.
  • Avoid unsupported answers and cross-user data leaks.

Flow map

Terminal
Input: Telegram / form / internal chat
  -> n8n validates user and question
  -> n8n creates embedding or calls an embeddings service
  -> Qdrant returns allowed chunks
  -> Ollama generates response with citations
  -> n8n saves trace and sends draft
  -> human approves if the action has real impact

Lab Docker Compose

This compose file is a local starting point. In production, add HTTPS, backups, user management, secrets outside the repository, and network boundaries.

Terminal
services:
  qdrant:
    image: qdrant/qdrant:latest
    ports:
      - "6333:6333"
    volumes:
      - qdrant_data:/qdrant/storage

  n8n:
    image: n8nio/n8n:latest
    ports:
      - "5678:5678"
    environment:
      - N8N_ENCRYPTION_KEY=change-me
      - GENERIC_TIMEZONE=Europe/Madrid
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  qdrant_data:
  n8n_data:

Minimum nodes in n8n

  • Chat, Telegram, or webhook trigger.
  • User, tenant, and permission validation.
  • Question normalization.
  • Qdrant search with tenant filter.
  • Call to Ollama with context and an "I don't know" rule.
  • Response with citations and saved trace.
Terminal
Response rule:
- Answer only with the retrieved context.
- Cite document and section when possible.
- If the context is insufficient, say "I don't have enough evidence".
- Do not execute external actions without human approval.

Official sources

  • n8n Docs
  • Qdrant documentation
  • Ollama API
  • Open WebUI documentation
  • Docker Compose documentation
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue