RAG Reranking Workflow for Golf Rules Q&A
detail.loadingPreview
This workflow ingests golf rules from a PDF, processes them using a Code node for structured data, and then utilizes Supabase Vector Store with Cohere reranking for efficient retrieval in a RAG (Retrieval-Augmented Generation) system. It enables a conversational AI to answer golf rule questions accurately by leveraging a reranked knowledge base.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This n8n workflow is designed to create a sophisticated Retrieval-Augmented Generation (RAG) system focused on the rules of golf. It begins by downloading a PDF document (Rules of Golf Simplified) from Google Drive. The Extract from File node then processes this PDF, followed by a Code node that intelligently splits the rules into individual, structured items, each containing the rule number, title, and full text. These structured rules are then vectorized using OpenAI embeddings and uploaded to a Supabase vector store, with a reranker (Cohere) improving the relevance of retrieved documents. Finally, a RAG agent is set up to answer user questions by first querying the Supabase vector store and then generating a response using a language model, with an additional agent to extract rule numbers for more targeted searches.
Key Features
- Automated PDF Processing: Downloads and extracts text from PDF documents.
- Intelligent Rule Segmentation: A custom code node splits rules into distinct, parsable items.
- Vectorization and Storage: Utilizes OpenAI embeddings to create vector representations of rules and stores them in Supabase.
- Reranking for Enhanced Relevance: Integrates Cohere reranking to improve the accuracy of retrieved information.
- Conversational AI Agent: Builds a RAG agent capable of answering golf rule-related questions using the vectorized data.
How To Use
- Configure Google Drive Credentials: Ensure your Google Drive credentials are set up in n8n to access the PDF.
- Set up Supabase: Configure your Supabase API credentials and ensure you have a vector table named 'documents' created.
- Configure OpenAI API: Set up your OpenAI API credentials for embeddings.
- Configure Cohere API: Set up your Cohere API credentials for reranking.
- Configure OpenRouter API: Set up your OpenRouter API credentials for the language models.
- Run the Workflow: Execute the workflow to download, process, vectorize, and upload the golf rules to Supabase.
- Interact with the Agent: Trigger the
When chat message receivednode with a question about golf rules to test the RAG agent.
Apps Used
Workflow JSON
{
"id": "bd13aee4-fca9-41b1-8b7c-f20fe2d9f599",
"name": "RAG Reranking Workflow for Golf Rules Q&A",
"nodes": 0,
"category": "AI & Machine Learning",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: bd13aee4-fca9...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Automated Blog Post Tagging with AI and Supabase
This workflow automatically tags blog posts using AI. It leverages Langchain's RAG Agent, OpenAI Embeddings, and Supabase for vector storage to efficiently categorize content.
RAG on Living Notion Data with OpenAI
This n8n workflow enables Retrieval Augmented Generation (RAG) on dynamic Notion data. It fetches Notion page blocks, splits them into chunks, embeds them using OpenAI, stores them in a vector database, and allows for question answering.
AI-Powered Document Processing and Chatbot
Automates document processing from Google Drive, generates structured metadata, and enables AI-powered chat with vector search.
RAG Workflow for Company Documents Stored in Google Drive
Automate RAG for your company's internal documents stored in Google Drive. This workflow ingests new or updated files, processes them into embeddings, and stores them in Pinecone for efficient retrieval by an AI agent.
AI-Powered Resume Screening with Weaviate and OpenAI
Automate resume screening by using a Webhook Trigger to receive resumes, processing them with Text Splitter, Embeddings, and Weaviate for vector storage, and then utilizing a RAG Agent with an OpenAI Chat Model for intelligent analysis and response.
Business WhatsApp AI RAG Chatbot for Electronics Stores
Build an AI-powered chatbot for your electronics store on WhatsApp using Retrieval Augmented Generation (RAG). This workflow integrates with Google Drive for knowledge base, Qdrant for vector storage, and OpenAI for AI.