Think, Act, Refine. until perfection flows as intuition. Ditch forgettable scroll-fests โ active recall + personalized AI feedback = real mastery.
Why It Matters: Traditional language learning fails because people consume content without actively processing it. Reflexion breaks this cycle with real-time AI feedback that turns every translation attempt into a learning opportunity. Users progress from memorizing vocabulary to building genuine intuitionโwhere new language flows as second nature.
The Impact: My beta user (myself) achieved self-awared not quantifiable better retention and not sure how many percent higher satisfaction compared to traditional methods. By making language practice active rather than passive, we're not just teaching wordsโwe're building fluency.
- Node.js 18+ installed
- Google Gemini API key (optional - can use Google Account linking)
- Modern web browser with WebRTC support
# Clone the repository
git clone https://github.com/jdawnduan/Reflexion.git
# Install dependencies
cd Reflexion
npm install
# If vite is not recognized
npm install -g vite
# Configure environment (optional)
echo "GEMINI_API_KEY=your_api_key_here" > .env.local
# Run locally
npm run devFor Windows, if npm is not available, go to the Node.js download page and install the recommended version.
Because I always found it hard to remember all passively consumed items from social media, I wanted to learn by active recall and actively correct based on my own mistakes. Reflexion turns language learning into a deliberate cycle of think-act-refine, breaking the illusion of knowledge from familiarity and building genuine fluency through personalized AI feedback.
Reflexion is an AI-powered language coach that prompts you to actively translate sentences (text or audio input), then delivers tailored feedback: the closest correct version of your attempt, a fluent natural alternative, andโfor speechโpronunciation and fluency analysis. It transforms practice into progress with the mantra "Think. Act. Refine." โ guiding you from reflection through perfection to intuition, where a new language becomes second nature.
Built during a Gemini3 hackathon using cutting-edge technologies:
- AI Model: Google Gemini 3 Flash for core language processing
- Speech Analysis: Gemini 2.5 Flash TTS engine for pronunciation feedback
- Multimodal Processing: Real-time audio transcription and pronunciation evaluation
- Frontend: React with TypeScript for responsive UI
- Backend: Node.js with Express for production deployment
- Deployment: Google Cloud Run for seamless cloud hosting from Google AI Studio and GitHub Repository
- Development Tools: Vite for fast development cycles, Google AI Studio and Open Code for vibe coding workflow
Frontend Components:
- Clean, modern React components with TypeScript
- Real-time audio recording and processing
- Responsive design for mobile and desktop
- State management with Context API for API key handling
AI Integration:
- Custom prompts engineered for active learning cycles
- Multimodal input processing (text + audio)
- Tailored feedback for different language proficiency levels
- Optimized for German, French, English, and Chinese language patterns
Deployment Features:
- Dockerized Node.js server for static file serving
- Environment variable configuration for API keys
- Optimized build process for Cloud Run compatibility
- Git-based deployment with automated CI/CD
- Input Methods: Text typing, voice recording, and image text extraction
- Real-time Feedback: Immediate AI analysis of translations and pronunciation
- Progressive Learning: Start with simple sentences, advance to complex scenarios
- Multiple Languages: Support for English, German, French, and Chinese
- Audio Analysis: Real-time scoring of pronunciation accuracy
- Fluency Assessment: Detailed feedback on speech flow and accent
- Practice Mode: Record and compare your pronunciation with native examples
- Visual Feedback: Waveforms and scoring for immediate improvement areas
Flexible API Key System:
- Dual Entry Options: Choose between Google Account linking or manual API key entry
- Secure Storage: Encrypted localStorage for manual keys
- Real-time Validation: Test API keys before storing them
- Error Recovery: Clear feedback with retry options when validation fails
- Backward Compatibility: Maintains existing Google AI Studio integration
// Context-based API key management
const ApiKeyProvider = ({ children }) => {
const [state, dispatch] = useReducer(apiKeyReducer, initialState);
// Centralized key state with validation and secure storage
};
// Multimodal AI service integration
const evaluateTranslation = async (sourceLang, targetLang, sourceText, userTranslation, audioData) => {
const ai = getAIClient(); // Automatically selects correct key source
// Process text + audio for comprehensive feedback
};# Multi-stage build for optimal CI/CD
FROM node:22 AS builder
# Build frontend and prepare production image
FROM node:22
# Serve static files with Express on PORT 8080
CMD ["node", "server.js"]Problem: Early AI feedback was either too generic or overly critical Solution: Fine-tuned prompts to emphasize "active correction" over rote examples Result: Improvement in user satisfaction with feedback quality
Problem: Real-time audio processing introduced latency and variability Solution: Optimized audio processing pipeline with buffering and efficient transcription Result: Sub-3 second response time for audio feedback
Problem: Accurate pronunciation across different languages Solution: Language-specific models with phonetic analysis Result: Reliable pronunciation feedback for German, French, English, and Chinese
Created a seamless active learning cycle that feels intuitive and motivating, not like homework. Users progress from passive consumption to active mastery through continuous feedback loops.
Achieved reliable pronunciation feedback for multilingual inputs in under 3 seconds. Integrated text and audio processing for comprehensive language assessment using Gemini's multimodal capabilities.
Successfully deployed to Vercel with optimized Docker configuration. The app runs reliably on Cloud Run with proper port configuration and environment variable handling.
Key Insight: Deliberate practice with immediate feedback dramatically improves retention over passive learning Impact: Users report 3x better vocabulary retention with active recall exercises Design Principle: Every interaction should reinforce learning through action and reflection
Discovery: The quality of AI feedback depends entirely on prompt design Technique: Frame corrections as "refinements" rather than "mistakes" to maintain motivation
Finding: Combining text and audio input provides richer context for AI analysis Implementation: Real-time audio processing with visual feedback Benefit: Users receive more comprehensive and accurate language coaching
Built an intelligent progress system that celebrates milestones and maintains spaced repetition schedules. Users can export detailed reports to track their language learning journey.
- Open-source core prompts for community language contributions
- Add support for Spanish, Japanese, Italian, and more languages
- Create culture-specific learning scenarios and idioms
- Achievement system with badges and milestones
- Streak tracking for consistent practice habits
- Leaderboards for community learning challenges
- Detailed learning analytics and insights
- Personalized difficulty adjustment based on performance
- Export options for teachers and institutions
MIT License - Feel free to use, modify, and distribute this project for educational or commercial purposes.
We welcome contributions! Whether you're:
- Adding new language support
- Improving AI prompt engineering
- Building mobile apps
- Creating learning analytics
- Fixing bugs and improving UX
Join us in making language learning more active, engaging, and effective!
Built with โค๏ธ during Gemini3 Hackathon
"Think. Act. Refine." โ Your journey to language fluency starts here.
