AI Kahoot Agent - About the Project
Inspiration
The inspiration came during a Kahoot quiz session with my colleagues. Watching everyone frantically tap their phones to beat the clock made me wonder if an AI could not just answer these questions correctly, but actually compete in real-time against human players. Most AI demonstrations show static question-and-answer scenarios, but here was an opportunity to test reasoning capabilities under time pressure in a genuinely competitive environment. The challenge was not just generating correct answers, but doing so fast enough to matter in a game designed for human reaction times.
With OpenAI's gpt-oss models being open-weight and locally runnable, this seemed like the perfect opportunity to build something that showcases pure reasoning capabilities without any training. The goal was to create raw intelligence that could compete against humans in their own game.
What it does
Our AI-powered Kahoot agent autonomously joins live Kahoot quiz games and competes alongside human players in real-time. Here's the magic in action:
- Joins any Kahoot game using the game PIN
- Analyzes questions instantly across multiple formats (multiple choice, true/false)
- Applies zero-shot reasoning using gpt-oss-20b with no specific training needed
- Responds within game time limits typically few seconds per question
- Handles visual content frameworks for future image-based questions
- Operates completely offline via local Ollama deployment
The agent doesn't just answer questions, it competes. It shows up in leaderboards and experiences the full competitive Kahoot experience just like a human player.
How we built it
Architecture Overview

Technical Stack
- AI Engine: OpenAI's gpt-oss-20b model via Ollama for local inference
- Real-time Communication: WebSocket connection through Python Kahoot client
- Async Processing: Event-driven architecture for optimal response timing
- Language: Python with asyncio for concurrent operations
Key Implementation Details
1. Question Processing Pipeline
question_ready → analyze_with_gpt_oss → cache_prediction → question_start → submit_answer
2. Intelligent Prompt Engineering We crafted prompts specifically for quiz scenarios:
prompt = f"""You are a quiz AI. Only return the number of the correct answer.
Question: {question}
Answer choices: {choices}
Respond ONLY with the number — no explanation."""
3. Multi-Format Adaptation Dynamic prompt generation based on question type:
- True/False: 2-option format with semantic understanding
- Multiple Choice: 4-option format with numerical mapping
Challenges we ran into
1. Timing Constraints
Kahoot games operate on tight schedules. I had to optimize the entire processing pipeline:
- Pre-processing: Analyze questions during the "ready" phase rather than waiting for the "start" phase
- Caching: Store predictions to submit instantly when questions begin
- Async Architecture: Non-blocking operations to meet the few seconds response deadline
2. Response Parsing Inconsistency
AI models do not always follow instructions precisely. The gpt-oss model would return:
- "The answer is 2" instead of just "2"
- "I think it's option B" instead of numerical indices
- Complete explanations despite explicit requests for numbers only
3. Dynamic Format Detection
Kahoot does not explicitly indicate whether a question is multiple choice versus true/false. The system had to:
- Dynamically detect question format from choice arrays
- Adapt prompts in real-time based on the number of available choices
- Handle edge cases like questions with 3 choices or empty options
4. WebSocket Connection Reliability
Real-time gaming requires stable connections with challenges including:
- Network interruptions during critical response moments
- Unexpected packet formats from Kahoot's API
- Race conditions between different question event types
Accomplishments that we're proud of
Real-World Performance
This is not merely a demonstration but a system tested in live Kahoot sessions with actual human players. The agent consistently participates, competes, and frequently outperforms human players.
Sub-Second Response Times
Optimized the entire pipeline to analyze questions and generate answers in under few seconds, well within Kahoot's time constraints.
Zero-Shot Intelligence
No training on specific data whatsoever. Pure reasoning from gpt-oss-20b's general knowledge competing against domain-specific human experience and intuition.
Production-Ready Architecture
Built with comprehensive error handling, asynchronous processing, and system resilience. The agent gracefully handles network issues, malformed responses, and unexpected game events.
Format Agnostic Processing
Seamlessly handles both multiple choice and true/false questions through intelligent prompt adaptation based on question structure.
What we learned
AI Reasoning Under Pressure is Different
Static Q&A is one thing; real-time competitive reasoning is entirely different. Time pressure reveals interesting characteristics of how language models process information.
Prompt Engineering for Speed
Learned that verbose prompts hurt performance in time-critical scenarios. The shortest, most direct instructions work best for competitive environments.
WebSocket + AI = Complex State Management
Managing state between real-time game events and async AI processing required careful architectural planning.
Open Models Can Compete
gpt-oss-20b proved that open-weight models can perform competitively in real-world scenarios without massive computational resources.
What's next for AI Kahoot Agent
Visual Intelligence
Implement image question support using multimodal models for questions containing charts, diagrams, or visual content.
Domain Specialization
Fine-tune gpt-oss models on specific subjects such as science, history, or literature for enhanced accuracy in themed quizzes.
Multi-Game Orchestration
Scale the system to participate in multiple Kahoot games simultaneously, creating an AI gaming network.
Confidence Scoring
Implement answer confidence metrics to make strategic decisions about when to submit answers versus when to skip questions.
Educational AI Assistant
Transform the underlying technology into a learning companion that helps students practice and improve their quiz performance through analysis.
Research Platform
Use the system as a testbed for studying AI reasoning, reaction time, and competitive intelligence in educational settings.
The project demonstrates that open-weight models can excel in unexpected domains, transforming a simple quiz game into a showcase for real-time AI reasoning capabilities under competitive pressure.
Built With
- aiohttp
- asyncio
- gpt-oss-20b
- kahoot-py
- ollama
- ollama-api
- python
- websocket-api
Log in or sign up for Devpost to join the conversation.