AI-powered educational platform that teaches strategy games through interactive tutoring.
LearnPlay.ai uses cutting-edge AI agents to teach classic board games (Sudoku and Chess) with real-time guidance, visual highlights, and voice explanations. Each game has a specialized AI tutor that adapts to your skill level and teaches step-by-step.
- Sudoku Game: Complete with 4 difficulty levels and AI tutor
- Multi-Agent System: Specialized agents for each game
- Voice Teaching: Natural voice explanations (ElevenLabs TTS)
- Multi-LLM Support: Works with OpenAI, Anthropic, Azure OpenAI, Ollama
- Interactive Guidance: Visual highlights and step-by-step lessons
- Chess Game: Full chess implementation with AI opponent
- User Authentication: Save progress and track learning
- Mobile Support: Responsive design for tablets and phones
LearnPlay.ai uses a Multi-Agent Architecture where specialized AI agents handle specific games, orchestrated through CopilotKit's AG-UI protocol for seamless frontend-backend communication.
flowchart TB
subgraph Frontend["Frontend (Next.js 16 + React 19)"]
HomePage[Home Page]
SudokuPage[Sudoku Page]
ChessPage[Chess Page]
end
subgraph Runtime["CopilotKit Runtime"]
Router[Agent Router]
end
subgraph Agents["Specialized AI Agents (Python + LangGraph)"]
direction LR
RouterAgent["Router Agent<br/>(General Assistant)"]
SudokuAgent["Sudoku Agent<br/>(~80 line prompt)"]
ChessAgent["Chess Agent<br/>(~80 line prompt)"]
end
subgraph Shared["Shared Tools"]
Voice[Voice/TTS]
Teaching[Teaching Utilities]
State[Base State]
end
subgraph External["External Services"]
LLM[OpenAI/Claude/Ollama]
TTS[ElevenLabs TTS]
end
HomePage --> Router
SudokuPage --> Router
ChessPage --> Router
Router -->|"general queries"| RouterAgent
Router -->|"sudoku context"| SudokuAgent
Router -->|"chess context"| ChessAgent
RouterAgent --> Shared
SudokuAgent --> Shared
ChessAgent --> Shared
RouterAgent --> LLM
SudokuAgent --> LLM
ChessAgent --> LLM
Shared --> TTS
style Frontend fill:#4A90A4,stroke:#2C5F6E,color:#fff
style Runtime fill:#7B68A6,stroke:#4A3D6E,color:#fff
style Agents fill:#5A9A6E,stroke:#3D6B4A,color:#fff
style Shared fill:#C4A35A,stroke:#8B7340,color:#fff
style External fill:#E85D75,stroke:#B83E54,color:#fff
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS
- AI Framework: CopilotKit 1.90, LangGraph 1.2, LangChain
- LLM Providers: OpenAI, Anthropic Claude, Azure OpenAI, Ollama
- Voice: ElevenLabs Text-to-Speech
Detailed architecture guide: docs/AGENT_ARCHITECTURE_RECOMMENDATIONS.md
- Node.js 26 (LTS) (Download)
- pnpm 10 (Install)
- Python 3.12+ (Download)
- OpenAI API Key (or other LLM provider) (Get Key)
# Clone the repository
git clone https://github.com/nitin27may/learnplay-ai.git
cd learnplay-ai
# Install all dependencies (frontend + backend)
pnpm installThe postinstall script automatically sets up the Python environment using uv.
Create or edit agent/.env:
# Required: LLM Provider
OPENAI_API_KEY=sk-proj-your-key-here
OPENAI_MODEL=gpt-4o-mini
# Optional: Voice (get free key at elevenlabs.io)
ELEVENLABS_API_KEY=your-elevenlabs-key
ELEVENLABS_VOICE_ID=JBFqnCBsd6RMkjVDRZzbOther LLM Providers:
Anthropic Claude
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-your-key
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022Azure OpenAI
LLM_PROVIDER=azure-openai
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT=gpt-4oOllama (Local)
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3.1:8bpnpm run devThis starts:
- Frontend: http://localhost:3000
- Agent Server: http://localhost:8123
That's it! Open your browser and start learning Sudoku with AI guidance.
If you need to run frontend and backend separately:
# Terminal 1 - Frontend only
pnpm run dev:ui
# Terminal 2 - Agent server only
pnpm run dev:agentAfter starting, you should see:
✓ Router agent registered
✓ Sudoku agent registered
✓ Chess agent registered
Navigate to http://localhost:3000/sudoku and click "Learn Sudoku Basics" to test the AI tutor.
- Start a Game: Select difficulty (Easy/Medium/Hard/Expert)
- Make Moves: Click cells and use number pad (1-9) or keyboard
- Get Help: Click chat icon and ask: "Explain the basics" or "Give me a hint"
- Learn Strategies: Use "Learn Sudoku Basics" button for step-by-step teaching
- Visual Highlights: Agent highlights cells with different colors
- Voice Explanations: Natural voice guidance (optional)
- Step-by-Step Lessons: Progress through teaching sessions
- Strategy Analysis: Learn techniques like Naked Singles, X-Wing, etc.
Complete usage guide: docs/SETUP.md
- Setup Guide - Detailed configuration, gameplay, and LLM providers
- Sudoku Guide - Sudoku strategies and techniques
- Chess Guide - Chess gameplay (coming soon)
- Quick Start - Multi-agent setup and testing
- Architecture - Multi-agent design patterns
- AI Teaching System - Teaching patterns and behavior
- Security - Security hardening guide
- Development Plan - Roadmap and task tracking
- Sudoku game with 4 difficulty levels
- Multi-agent architecture (Router, Sudoku, Chess)
- Interactive AI tutor with teaching sessions
- Voice mode (ElevenLabs TTS)
- Multi-LLM support (OpenAI, Claude, Azure, Ollama)
- Visual highlights and step-by-step guidance
- Security hardening (authentication, rate limiting)
- Chess game implementation
- User accounts and progress tracking
- Achievement system and leaderboards
- Mobile app
- More games (Go, Checkers)
See PLAN.md for detailed task tracking with 40+ tasks organized by phase.
# Run both frontend and agent
pnpm run dev
# Run separately
pnpm run dev:ui # Frontend only (port 3000)
pnpm run dev:agent # Agent server only (port 8123)
# Build for production
pnpm run build
# Lint code
pnpm run lintlearnplay-ai/
├── src/ # Frontend (Next.js + React)
│ ├── app/ # Pages (home, sudoku, chess)
│ ├── components/ # UI components
│ └── lib/ # Game logic and utilities
│
├── agent/ # Backend (Python + LangGraph)
│ ├── agents/ # Specialized agents
│ │ ├── router_agent.py
│ │ ├── sudoku/ # Sudoku agent
│ │ └── chess/ # Chess agent
│ └── shared/ # Shared tools (voice, TTS, state)
│
└── docs/ # Documentation
Contributions welcome! This is a learning project demonstrating:
- Multi-agent AI architecture
- CopilotKit integration
- LangGraph agent orchestration
- Interactive teaching systems
Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Share feedback
MIT License - see LICENSE file for details.
- CopilotKit - Amazing AI framework for building AI agents
- LangChain / LangGraph - Agent orchestration
- Sudoku & Chess communities - Strategy documentation and teaching methods
Built with ❤️ using CopilotKit and LangGraph