AI-Powered Knowledge Assistant using Google Sheets, OpenAI, and Supabase Vector Search

Go to Workflow
376 views
Built by Alex Huy Alex Huy
Created on June 07, 2026

Description

Description
An intelligent conversational AI system that provides contextual responses by combining chat history, vector database knowledge retrieval, and web search capabilities.
How it Works (High-level steps)

Message Detection: Google Sheets trigger monitors for new user messages and filters out already-processed entries
Context Preparation: Extracts user message, retrieves chat history, and formats conversation context with system prompt
Knowledge Retrieval: AI agent searches vector database for relevant context using Supabase + OpenAI embeddings
Response Generation: LangChain agent processes the request using:

OpenAI GPT-4 language model
Vector store tool for knowledge base queries
SerpAPI tool for web search when needed
Buffer memory for conversation continuity


Response Storage: Updates Google Sheets with AI response and assigns unique timestamp ID

Setup Steps

Configure Google Sheets with columns: user_message, ai_respond, id
Set up Supabase vector store with OpenAI embeddings
Connect OpenAI API credentials (GPT-4 + embeddings)
Configure SerpAPI for web search functionality
Set up Google Sheets trigger and update permissions

Nodes Used (8)

AI Agent
@n8n/n8n-nodes-langchain.agent
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
Google Sheets
n8n-nodes-base.googleSheets
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
SerpApi (Google Search)
@n8n/n8n-nodes-langchain.toolSerpApi
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase
Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore