Skip to content

ckakgun/docquery-rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

docquery rag

πŸ“„ DocQuery RAG β€” Automated Drive-to-RAG System

This n8n workflow automates a Retrieval-Augmented Generation (RAG) pipeline that connects Google Drive, Supabase, Slack and OpenAI for document-aware AI chat and intelligent document indexing.


βš™οΈ Key Features

  • 🧩 Auto-ingestion pipeline
    Detects new or updated files in Google Drive and indexes them into a Supabase vector database.

  • 🧠 RAG chat interface
    Retrieves relevant document embeddings for user queries and generates grounded responses using OpenAI or OpenRouter models.

  • πŸ”Ž Semantic search & reranking
    Uses OpenAI embeddings and Cohere reranker to ensure precise document retrieval.

  • 🧰 Memory persistence
    Postgres-backed chat memory for contextual continuity across user sessions.

  • πŸ”” Slack alerts
    Sends success or error notifications to a Slack channel (#ceren-news) for monitoring.

  • πŸ›  Error recovery
    Automatic error detection and fallback models for continuous reliability.


πŸ—οΈ Tech Stack

Component Technology
Workflow Engine n8n
Vector Database Supabase
LLMs OpenAI GPT-4.1, Anthropic Claude via OpenRouter
Embeddings OpenAI text-embedding-3-large
Reranker Cohere
File Source Google Drive API
Notifications Slack API
Memory Postgres (Chat Memory Node)

🧾 Workflow Overview

πŸ”Ή 1. File Detection

  • Triggers when a new or updated document appears in Google Drive.

πŸ”Ή 2. Text Extraction & Embedding

  • Downloads and converts the document.
  • Extracts text and generates vector embeddings via OpenAI.

πŸ”Ή 3. Vector Storage

  • Inserts embeddings into the drive_docs table in Supabase.

πŸ”Ή 4. Chat Querying

  • When a user sends a message, the system retrieves semantically related content from the vector store, reranks, and generates a contextual AI answer.

πŸ”Ή 5. Monitoring

  • Scheduled system health checks and Slack alerts for failures.

πŸš€ How to Use

  1. Import the workflow file into your n8n instance.
  2. Set up credentials for:
    • OpenAI
    • Supabase
    • Google Drive
    • Slack
    • (Optional) OpenRouter & Postgres
  3. Adjust folder IDs and table names in the parameters.
  4. Activate the workflow.

πŸ“ˆ Example Use Cases

  • AI-powered internal knowledge assistant
  • Auto-indexing system for Drive-based document archives
  • Semantic document search bot for company data

πŸ“¬ Author

Ceren Kaya AkgΓΌn
🧠 AI & Automation Engineer | Berlin, Germany
🌐 Portfolio β€’ GitHub β€’ Medium


πŸͺͺ License

MIT License β€” free to use and adapt for non-commercial or educational purposes.

About

πŸ€– Automated RAG pipeline using n8n: Connects Google Drive, Supabase vector DB, and OpenAI for intelligent document indexing and AI-powered chat with semantic search

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors