Split test different agent prompts with Supabase and OpenAI
Split Test Agent Prompts with Supabase and OpenAI Use Case Oftentimes, it's useful to test different settings for a large language model in production agains...
🔌 Nodes & Integrations Used (5)
📖 Implementation & Setup Guide
Split Test Agent Prompts with Supabase and OpenAI ### Use Case Oftentimes, it's useful to test different settings for a large language model in production against various metrics. Split testing is a good method for doing this. ### What it Does This workflow randomly assigns chat sessions to one of two prompts, the baseline and the alternative. The agent will use the same prompt for all interactions in that chat session. ### How it Works 1. When messages arrive, a table containing information regarding session ID and which prompt to use is checked to see if the chat already exists 2. If it does not, the session ID is added to the table and a prompt is randomly assigned 3. These values are then used to generate a response
Setup 1. Create a table in Supabase called **split_test_sessions**. It needs to have the following columns: **session_id** (`text`) and **show_alternative** (`bool`) 2. Add your **Supabase**, **OpenAI**, and **PostgreSQL** credentials 3. Modify the **Define Path Values** node to set the baseline and alternative prompt values. 4. Activate the workflow and test by sending messages through n8n's inbuilt chat 5. Experiment with different chat sessions to test see both prompts in action
Next Steps - Modify the workflow to test different LLM settings such as temperature - Add a method to measure the efficacy of the two alternative prompts
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Split test different agent prompts with Supabase and OpenAI.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related AI Agents Workflows
View All in AI Agents →5 ways to process images PDFs with Gemini AI in n8n
How it works Many users have asked in the support forum about different methods to analyze images and PDF documents with Google Gemini AI in n8n. This workfl...
7 AI Sales Assistant
Production-ready n8n automation template for 7 AI Sales Assistant built by AhiXLight. Seamlessly connects Airtop Tool, Slack, Airtop with 24 configured nodes.
AAVE portfolio professional AI agent Telegram Email GPT 4o
A next-generation AI-powered DeFi health monitor that tracks wallet positions across Aave V3 using GPT-4o and LangChain. It delivers human-readable reports v...
Access control for AI agents RBAC using Airtable and Telegram
Purpose This workflow allows granular control over the access to tools connected to AI Agents (including Multi-Agent setups) using Role Based Access Control....