Deploy an advanced AI assistant using this n8n workflow. It combines Retrieval-Augmented Generation (RAG) via Supabase and Text-to-SQL via Peliqan to query internal documents and quantitative business data effectively. This n8n template accelerates BI.
Download this n8n workflow template and start using it instantly.
This comprehensive n8n workflow solves the challenge of accessing disparate business data sources—unstructured knowledge bases (like Notion) and structured databases (like Chargebee)—through a single, conversational interface. By using the LangChain AI Agent n8n node, the system intelligently decides whether a user's question requires searching the internal knowledge base (RAG) or generating and executing an SQL query (Text-to-SQL) against data brokered by Peliqan. This ensures that the AI assistant, driven by an OpenAI Chat Model, provides accurate and timely answers derived from the freshest business data. This advanced n8n automation leverages specialized tools to make data querying as simple as asking a question, making it an indispensable tool for data accessibility.
This n8n workflow is divided into two logical sections: data ingestion for RAG, and the live chatbot agent:
To successfully deploy this advanced n8n workflow using these n8n templates, follow these steps:
tableId in 'Get table data' to match your relevant dataset.documents) is correctly set up in your Supabase instance.This n8n workflow utilizes several specialized n8n node types to achieve complex AI logic:
When chat message received (LangChain Chat Trigger): The starting point, acting as the primary n8n trigger for user interaction, defining the chatbot endpoint.
AI Agent (LangChain Agent): The central decision-making component. Its system message dictates its ability to use RAG via Supabase and Text-to-SQL via Peliqan. It orchestrates tool usage based on the user's query.
OpenAI Chat Model (LangChain LLM): Provides the underlying intelligence for the agent, used for parsing questions, generating SQL, and synthesizing final answers.
Simple Memory (LangChain Memory): A crucial n8n node for maintaining conversation context across multiple messages.
Supabase Vector Store (mode: retrieve-as-tool): Configured as a tool named 'Companyknowledgebase' for the agent to perform RAG lookups against internal knowledge documents.
Execute an SQL query via Peliqan (Peliqan Tool): A custom Peliqan n8n node that functions as a secure tool, allowing the AI agent to execute dynamically generated SQL queries against business data, providing accurate quantitative answers.
Get table data (Peliqan node): Used in the ingestion pipeline to retrieve large volumes of source data (e.g., Notion pages) from Peliqan before vectorization. This step initiates the RAG ingestion segment of the n8n workflow.
Supabase Vector Store (mode: insert): Used exclusively in the ingestion sub-workflow to permanently store the vector embeddings generated by the OpenAI embedding n8n node.
Deploy a powerful n8n workflow using an AI agent, OpenAI, and Peliqan to transform natural language questions into accurate SQL queries against your Uniconta ERP data, leveraging Text-to-SQL technology.

Use this powerful n8n workflow to create an AI Agent capable of querying Cin7 ERP data via natural language. Integrates n8n nodes for Peliqan and OpenAI for Text-to-SQL automation.

Use this n8n workflow to create an MCP Server endpoint, allowing AI agents to query BikeWise cycling incident data using dynamic parameters via a dedicated n8n trigger. Find more n8n templates for AI tooling.

Use this sophisticated n8n workflow to sync Google Sheets data to PostgreSQL, then query the database naturally using a Gemini AI Agent. Leverage powerful n8n templates for RAG.

Automate natural language queries for Monday.com tasks using this powerful n8n workflow. Integrate GPT-4o to analyze real-time board data instantly, eliminating manual searches.

Peliqan.io is the one-click data foundation for our n8n AI Agents. Add all your business applications for RAG and "Text to SQL", and build AI chatbots and AI Agents that can interact with all internal company data from CRM, ERP, cloud storage, accounting, HRM/ATS etc.







































