Aulafy
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

TerminalCode
Entrada: Telegram / formulario / chat interno
  -> n8n valida usuario y pregunta
  -> n8n crea embedding o llama a un servicio de embeddings
  -> Qdrant devuelve chunks permitidos
  -> Ollama genera respuesta con citas
  -> n8n guarda traza y envía borrador
  -> humano aprueba si la acción tiene impacto real

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.

TerminalCode
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.
TerminalCode
Regla de respuesta:
- Responde solo con el contexto recuperado.
- Cita documento y sección cuando sea posible.
- Si el contexto no basta, di "No tengo evidencia suficiente".
- No ejecutes acciones externas sin aprobación humana.

Official sources

  • n8n Docs
  • Qdrant documentation
  • Ollama API
  • Open WebUI documentation
  • Docker Compose documentation