Templates / Guide students with an AI tutor chatbot using RAG, intent classification and GPT-4o-mini

Guide students with an AI tutor chatbot using RAG, intent classification and GPT-4o-mini

Needs changes

by isaWOW ✓ · 463 views · created 2026-03-24 · Support Chatbot, AI Chatbot

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.

What to replace before upgrading

Removed in 3.0Replace with
AI Agent v1 (old agent modes)
Intent Classifier (v1.9), AI Teacher Agent (v1.9)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (11)

DeepSeek Chat ModelAI AgentEmbeddings OpenAIOpenAI Chat ModelSimple MemoryGoogle SheetsPinecone Vector Store

What it does

Description Automatically guide students through personalized learning sessions using AI-powered intent classification, book-based knowledge retrieval (RAG), and full session logging — all without writing a single line of code. --- What this workflow does Nathan is an intelligent AI tutor chatbot that detects what the student is trying to do — greeting, asking a question, answering, introducing a topic, or going off-topic — and responds accordingly using the right teaching strategy every time. Key features: - Smart intent classification using DeepSeek LLM — identifies 5 intents: greeting, topic, answer, question, random - Dynamic system prompts — fetches the right teaching prompt from Google Sheets based on the classified intent - RAG-powered answers — GPT-4o-mini retrieves relevant content from a Pinecone book vector store to give accurate, book-grounded responses - Full session memory — maintains conversation context with a sliding-window buffer for natural multi-turn dialogue - Automatic Q\&A logging — every exchange is saved to Google Sheets for teacher review and auditing - Public chat interface — students can access Nathan directly via browser without any login --- How it works Step 1 — User sends a message The public chat trigger receives the student's input and simultaneously fires two paths: one to the Intent Classifier and one to the Merge node for later combining. Step 2 — DeepSeek classifies intent The Intent Classifier agent (powered by DeepSeek LLM + sliding-window memory) reads the message and outputs exactly one word: greeting / topic / answer / question / random Step 3 — Fetch matching system prompt The classified intent is used to look up the correct system prompt from the pmt tab in Google Sheets (filtered by the Output column). Each intent maps to a unique pedagogical strategy. Step 4 — Merge and aggregate The fetched prompt and original user input are merged and aggregated into a single payload, ready to be passed to the AI teacher. Step 5 — AI Teacher Agent generates response (RAG) GPT-4o-mini receives the system prompt, full session memory (last 10 turns), and uses the Pinecone book vector store as a retrieval tool (topK=3). It generates a pedagogically appropriate, book-grounded response. Step 6 — Log and return The session ID, user message, and AI response are appended to the Preservation tab in Google Sheets. The final response is formatted and returned to the student in the chat interface. --- Setup requirements Services you'll need: - n8n instance (self-hosted or n8n Cloud) - DeepSeek API account - OpenAI API account (for GPT-4o-mini and embeddings) - Pinecone account (free tier works) - Google account with Sheets access Estimated setup time: 20–30 minutes --- Step-by-step setup 1. Add credentials in n8n Go to Settings → Credentials and add: - DeepSeek API key → connect to the DeepSeek LLM node - OpenAI API key → connect to both GPT-4o-mini LLM and OpenAI Embeddings nodes - Google Sheets OAuth2 → connect to Fetch System Prompt and Log Q\&A to Sheets nodes - Pinecone API key → connect to the Book Knowledge Base node 2. Set up your Google Sheet Create a new Google Sheet with two tabs: Tab 1 — pmt (prompt library): | Output | Prompt | | --------- | ---------------------------------- | | greeting | You are Nathan, a friendly tutor… | | topic | The student wants to learn about… | | answer | The student has just answered… | | question | The student is asking a question… | | random | Gently redirect the conversation… | Tab 2 — Preservation (Q\&A log): | Session | User Msg | AI Response | | ------- | -------- | ----------- | | (auto-filled) | (auto-filled) | (auto-filled) | 3. Replace placeholder Sheet IDs In the workflow, find all nodes that contain YOURGOOGLESHEETID and replace with your actual Google Sheets document ID (found in the URL: docs.google.com/spreadsheets/d/YOURIDHERE). Also replace YOURPRESERVATIONSHEETGID with the gid value of your Preservation tab. 4. Set up Pinecone vector store - Create a

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.