Skip to main content
IAMV Consulting

AI Language Tutor: Multi-Agent Language Tutor on Telegram

AI Agents

Autonomous language tutor available 24/7 with voice, text, and CEFR assessment, without a line of backend.

Stack

  • Telegram
  • OpenAI GPT-4o-mini
  • Whisper
  • OpenAI TTS
  • Redis
  • LangChain
  • n8n

Solution Architecture

Message on Telegram
Professor PolyAI
Response to student
Recursos · Professor PolyAI
Model
GPT-4o-mini
LangChain Orchestrator
Sub-agents
CEFR Assessment
Light placement, estimates the range from A1 to C2
Conversation Tutoring
Roleplay with scaffolding and inline correction
Resources
Debounce in Redis
15s window per Telegram ID
Whisper
Transcribes the voice note
OpenAI TTS
Returns the response in audio
An orchestrator delegates to specialist sub-agents, separating level assessment from conversation tutoring, and relies on voice resources and message consolidation.

The challenge

Personalized language teaching does not scale. Independent teachers exchange hours for classes and cannot meet the demand for practice between sessions. Language schools need a practice tool available 24 hours, but building a conversational backend with voice, level assessment, and pedagogical correction is an engineering project that most cannot afford. And the student, in the interval between classes, is left without a conversational partner: this is exactly where fluency stalls.

There was also a tricky technical problem: students send messages in bursts. Without treatment, each fragment triggers an AI response, and the conversation turns into noise.

The solution

A fully autonomous language tutor running as an n8n workflow on Telegram, without any line of backend code. The core is Professor PolyAI, a LangChain orchestrator powered by GPT-4o-mini, which interprets the student's intent and delegates to the appropriate specialist sub-agent. The CEFR Assessment Specialist conducts a light placement, estimates the student's range (A1 to C2), and stores the result for future turns. The Conversation Tutoring Specialist leads practice dialogues and roleplay with scaffolding, inline correction, and positive reinforcement.

The orchestrator applies pedagogical formatting rules: short responses of 3 to 8 lines, structured correction templates, and commands like /quiz, /drill, /dialogo, and /nivel. To address the burst message problem, a debounce buffer in Redis stacks each message indexed by the user's Telegram ID, waits 15 seconds, and silently discards exceeded entries. The result is a single coherent response per burst, without duplicates.

How it works

The student sends a message on Telegram, in text or audio. An input router detects the type: voice notes are downloaded and transcribed via OpenAI Whisper before entering the main flow; unsupported types are diverted. After the debounce, Professor PolyAI reads the full context of the conversation, chooses the sub-agent, and generates the pedagogical response.

At the output, a conditional node checks if the original input was voice. If it was, the Markdown is removed, the text goes to OpenAI TTS, and the student receives the response as a voice note on Telegram. This completes a fully spoken conversation cycle, essential for practicing listening and pronunciation.

All customization happens through parameters: the variable lingua_ensino defines the target language (English, Spanish, French, or any language supported by GPT-4o-mini and Whisper), and the system prompt controls persona, tone, and commands. New specialist sub-agents, such as a grammar checker or vocabulary trainer, can be added by duplicating the agentTool pattern and connecting to the orchestrator.

Solution Flow

Telegram
Message
n8n Workflow
Input Router
Detects the type; voice is transcribed via Whisper
Consolidation
Debounce in Redis
Waits 15s and discards exceeded entries
AI Models
Professor PolyAI
Reads the full context of the conversation, chooses the sub-agent
Specialist Sub-agent
CEFR Assessment or Conversation Tutoring
Conditional Output
If the input was voice, the TTS generates the voice note
Response
Telegram
From the message on Telegram to the pedagogical response, with voice transcription, debounce, and delegation to the specialist sub-agent.

Results

  • Tutor available 24/7 on Telegram, with input via voice and text and CEFR level assessment from A1 to C2
  • Zero backend code: all logic resides in n8n nodes, parameters, and system prompts, and can be replicated by non-programmers
  • 15s debounce in Redis eliminates duplicate responses in sequential messages
  • Adaptable to any language and curriculum by changing a configuration variable and the persona prompt
  • CEFR level estimation maintained per student and reused between sessions, personalizing scaffolding at each turn

The lesson from the project lies in the architecture. The pedagogical gain came from orchestration, not from a larger model: separating level assessment and conversation tutoring into distinct sub-agents is what makes a generic chatbot function as a tutor.

Metrics

24/7
Practice availability
A1-C2
CEFR assessment range covered
15s
Debounce window for consolidating messages
Everything is fine! I liked the service! Clear communication, timely delivery
Leonardo Pelizzari (CEO) · Italy for Brazil