Skip to content

jdawnduan/Reflexion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Reflexion Language Learning App

Reflexion - Think, Act, Refine. until perfection flows as intuition.


๐ŸŽฏ Elevator Pitch

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.


๐Ÿ› ๏ธ Quick Start

Prerequisites

  • Node.js 18+ installed
  • Google Gemini API key (optional - can use Google Account linking)
  • Modern web browser with WebRTC support

Installation & Setup

# 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 dev

For Windows, if npm is not available, go to the Node.js download page and install the recommended version.


๐ŸŽฏ Inspiration

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.

๐Ÿš€ What It Does

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.โ–ถ๏ธ Watch the video

๐Ÿ—๏ธ How We Built It

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

Architecture Highlights

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

๐ŸŽฏ Core Features

๐Ÿ—ฃ๏ธ Active Translation Practice

  • 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

๐ŸŽง๏ธ Pronunciation Coaching

  • 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

๐Ÿ”ง Technical Implementation

API Management

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

Architecture Patterns

// 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
};

Deployment Configuration

# 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"]

๐ŸŽฏ Challenges & Solutions

Challenge 1: Balancing AI Feedback

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

Challenge 2: Audio Input Processing

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

Challenge 3: Multilingual Support

Problem: Accurate pronunciation across different languages Solution: Language-specific models with phonetic analysis Result: Reliable pronunciation feedback for German, French, English, and Chinese

๐Ÿ† Accomplishments We're Proud Of

๐Ÿง  Active Learning Loop

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.

๐ŸŽค๏ธ Multimodal AI Coaching

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.

๐ŸŒ๏ธ Production-Ready Deployment

Successfully deployed to Vercel with optimized Docker configuration. The app runs reliably on Cloud Run with proper port configuration and environment variable handling.

๐Ÿ”ฎ What We Learned

๐ŸŽฏ Active Recall Beats Passive Consumption

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

๐Ÿค– Prompt Engineering is Critical

Discovery: The quality of AI feedback depends entirely on prompt design Technique: Frame corrections as "refinements" rather than "mistakes" to maintain motivation

๐ŸŽต Multimodal Input Unlocks Deeper Insights

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

๐Ÿš€ What's Next for Reflexion

๐Ÿ“ฑ๏ธ Real-time Progress Tracking

Built an intelligent progress system that celebrates milestones and maintains spaced repetition schedules. Users can export detailed reports to track their language learning journey.

๐Ÿ“š Enhanced Language Packs

  • Open-source core prompts for community language contributions
  • Add support for Spanish, Japanese, Italian, and more languages
  • Create culture-specific learning scenarios and idioms

๐ŸŽฎ Gamification Elements

  • Achievement system with badges and milestones
  • Streak tracking for consistent practice habits
  • Leaderboards for community learning challenges

๐Ÿ”ง Advanced Analytics Dashboard

  • Detailed learning analytics and insights
  • Personalized difficulty adjustment based on performance
  • Export options for teachers and institutions

๐Ÿ“„ License

MIT License - Feel free to use, modify, and distribute this project for educational or commercial purposes.

๐Ÿค Contributing

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages