# OpenLingo A free, open-source, AI-powered language learning platform. Practice through conversations with an AI tutor, interactive exercises, spaced repetition flashcards, and translated reading material — all in 15+ languages. Live version: [https://openlingo.dev](https://openlingo.dev) ## Features ### AI Chat Tutor Conversational language practice powered by your choice of LLM. The tutor adapts to your level, remembers context across sessions via a persistent memory system, and can generate exercises on the fly. For example you can ask: `create a unit about the benefits of open source software in spanish A1 level` Output: [https://www.openlingo.dev/unit/1ba528d4-b507-4211-9369-03300928fab6](https://www.openlingo.dev/unit/1ba528d4-b507-4211-9369-03300928fab6) ### AI Tools The chat tutor has access to tools it can call during conversation: | Tool | Description | | ------------------ | --------------------------------------------------------------------- | | `readMemory` | Recall persistent notes about the learner | | `addMemory` | Save new notes to the learner's memory | | `rewriteAllMemory` | Reorganize the full memory | | `srs` | Query and mutate the learner's SRS flashcard deck | | `presentExercise` | Render an interactive exercise inline | | `createUnit` | Generate a full lesson unit from a topic | | `addWordsToSrs` | Bulk-add dictionary words to the SRS deck with CEFR/frequency filters | | `switchLanguage` | Change the target or native language | | `readArticle` | Fetch a web article and translate it to the target language | ### Spaced Repetition (SRS) SM-2 algorithm with automatic scheduling. Cards progress through `new → learning → review` states. The AI tutor can add words during conversation, or you can bulk-import from the built-in dictionaries (15+ languages, frequency-ranked, CEFR-classified). ### Interactive Exercises 9 exercise types that can appear in lessons or be generated by the AI tutor: - Multiple choice - Translation - Fill in the blank - Matching pairs - Listening (TTS-powered) - Word bank - Speaking (STT with feedback) - Free-text writing - Flashcard review ### Courses & Units Pre-built or AI-generated learning content. Units are stored as markdown with YAML frontmatter, containing multiple lessons with progressive difficulty. The AI can generate entire units from a topic on demand. ### Reading Paste any web article URL and OpenLingo will fetch, extract, and translate it paragraph-by-paragraph to your target language at your CEFR level. Includes optional audio narration. ### Text-to-Speech & Speech-to-Text - **TTS:** OpenAI GPT-4o-mini-tts for pronunciation and listening exercises - **STT:** OpenAI Whisper for speaking exercises and voice input - Audio cached in Cloudflare R2 ## Supported Languages German, French, Spanish, Italian, Portuguese, Russian, Arabic, Hindi, Korean, Mandarin Chinese, Japanese (Hiragana, Katakana, Kanji), English — with pre-loaded frequency dictionaries and CEFR classifications for each. ## Tech Stack | Layer | Technology | | --------- | ------------------------------------------- | | Framework | Next.js 16, React 19 | | Language | TypeScript 5 | | Database | PostgreSQL 16 (Drizzle ORM) | | Auth | Better Auth (email/password + Google OAuth) | | AI | Vercel AI SDK 6 | | TTS/STT | OpenAI (GPT-4o-mini-tts, Whisper) | | Storage | Cloudflare R2 (audio cache) | | Styling | Tailwind CSS 4 | | Runtime | Bun | ## Getting Started ### Prerequisites - [Bun](https://bun.sh) - [Docker](https://www.docker.com/) (for PostgreSQL) - At least one AI provider API key (OpenAI, Anthropic, or Google) ### 1. Clone and install ```bash git clone https://github.com/pretzelai/openlingo.git cd openlingo bun install ``` ### 2. Configure environment ```bash cp example.env.local .env.local ``` Edit `.env.local` with your API keys ### 3. Start the database ```bash bun run db:up # starts PostgreSQL via Docker bun run db:migrate # run migrations bun run db:seed # load dictionaries and sample content ``` ### 4. Run the app ```bash bun run dev ``` ## License MIT