Skip to main content
CodeLava
Back to work

AI-Powered Educational RAG Workflow

An intelligent Telegram study assistant grounded strictly in the instructor's curriculum materials, enabling students to ask academic questions 24/7 and receive accurate, syllabus-aligned explanations.

AI and automation
AI-Powered Educational RAG Workflow

Technologies

  • PostgreSQL
  • n8n
  • Ollama
  • OpenRouter
  • Supabase
  • Telegram Bot API
01

Chapter 01

Challenge

Students frequently asked repetitive curriculum questions outside live class hours, while generic AI chatbots risked giving off-syllabus or inaccurate explanations rather than textbook-verified answers.

02

Chapter 02

Solution

We built a Retrieval-Augmented Generation (RAG) workflow using n8n AI Agent, Supabase Vector DB, Ollama embeddings, OpenRouter LLM, and Postgres chat memory. Uploaded curriculum PDFs are parsed, chunked via a recursive character text splitter, embedded, and indexed in Supabase so incoming Telegram questions retrieve exact textbook passages and generate context-grounded multi-turn answers.

03

Chapter 03

Results

  • Document Ingestion & Vector Indexing: Extracts text from uploaded curriculum PDFs, splits content using a recursive character text splitter, generates embeddings via Ollama, and stores vectors in Supabase.
  • Semantic Knowledge Base Retrieval: When a student sends a question on Telegram, the AI Agent queries the Supabase vector store to retrieve exact relevant passages from the course material.
  • Context-Grounded Responses & Memory: Synthesizes clear, structured answers through OpenRouter while maintaining multi-turn conversation history in a Postgres chat memory database.