A personalized AI language tutor built with n8n workflows that helps learners practice conversations in their target language through intelligent, context-aware interactions.
- 🎯 Personalized Learning: Saves user preferences (languages, topics, teaching style)
- 🧠 Context Awareness: Remembers recent conversation history for coherent interactions
- 🤖 AI-Powered Responses: Generates intelligent responses tailored to the learner's level
- 🔊 Text-to-Speech: Converts tutor responses into audio for pronunciation practice
- 📊 Progress Tracking: Stores conversation history for learning analytics
- 🎭 Multiple AI Personalities: Choose from different teaching styles (friendly, strict, funny)
Trigger: POST /onboarding
Purpose: Initialize user profile and preferences
Saves:
user_id- Unique identifier for the usernative_language- User's native languagetarget_language- Language they want to learntopic- Preferred conversation topicsai_mood- Teaching personality (friendly, strict, funny, etc.)
Trigger: POST /chat
Process Flow:
- Fetch User Context: Retrieves user preferences and conversation history
- Generate AI Response: Creates contextually appropriate responses using OpenAI
- Save Interaction: Stores both user message and tutor response
- Text-to-Speech: Converts tutor response to audio
- Return Response: Sends back text and audio to the user
- n8n - Workflow automation platform
- Cloud account at n8n.cloud OR
- Local installation via Docker
- OpenAI API Key (Required)
- Used for AI conversation generation
- Also provides TTS functionality
- Alternative TTS Services (Optional)
- Google Cloud Text-to-Speech API
- ElevenLabs API
- Azure Speech Services
- Hugging Face TTs
- Docker (for local setup)
- Node.js 16+ (if running n8n locally without Docker)
-
Start n8n with Docker
docker run -it --rm \ -p 5678:5678 \ -v ~/.n8n:/home/node/.n8n \ n8nio/n8n -
Access n8n Interface Open your browser and navigate to:
http://localhost:5678
- Sign up at n8n.cloud
- Create a new workflow instance
-
Import Workflows
- In the n8n UI, navigate to:
Workflows → Import from File - Upload the
.jsonfiles from the/workflowfolder - Import both
onboardingandchatworkflows
- In the n8n UI, navigate to:
-
Configure API Credentials
- Go to:
Credentials → Add Credential - Add your OpenAI API Key/Hugging Face API Key:
- Credential Type:
OpenAI - API Key: Your OpenAI API key
- Credential Type:
- (Optional) Add additional TTS service credentials
- Go to:
-
Assign Credentials to Nodes
- Open each imported workflow
- Click on nodes that require authentication
- Assign the appropriate credentials
-
Activate Workflows
- Ensure both workflows are set to "Active"
- Verify webhook URLs are accessible
Endpoint: POST /webhook/onboarding
curl -X POST http://localhost:5678/webhook/onboarding \
-H "Content-Type: application/json" \
-d '{
"user_id": "user123",
"native_language": "English",
"target_language": "Spanish",
"topic": "Travel",
"ai_mood": "friendly"
}'Request Parameters:
user_id(string): Unique identifier for the usernative_language(string): User's native languagetarget_language(string): Language to learntopic(string): Preferred conversation topicai_mood(string): Teaching style preference
Endpoint: POST /webhook/chat
curl -X POST http://localhost:5678/webhook/chat \
-H "Content-Type: application/json" \
-d '{
"user_id": "user123",
"message": "How do I say where is the airport?"
}'Request Parameters:
user_id(string): User identifier (must match onboarding)message(string): User's question or conversation input
{
"status": "success",
"response_text": "You can say: '¿Dónde está el aeropuerto?' This literally means 'Where is the airport?' in Spanish. Try to practice the pronunciation: DON-deh es-TAH el ah-eh-ro-PWER-to.",
"audio_url": "https://your-storage-service/audio/response123.mp3",
"conversation_id": "conv_456",
"timestamp": "2024-01-15T10:30:00Z"
}Built with ❤️ and n8n