A gamified Q&A adventure built using Streamlit, CrewAI, and LangChain with a LLM-powered cast of agents guiding the player through trivia challenges. Players battle through levels, collect points, and survive with limited livesโall while being guided by a virtual narrator and hint system.
- โ Dynamic Question Generation based on player level using LLMs.
- ๐ง Semantic Answer Checking using sentence embeddings (
MiniLM) for flexible answer matching. - ๐ก Hint System for each question.
- ๐ Narrator Agent for immersive storytelling.
- ๐ฎ Gamified Progression: 10 levels, limited lives, and point tracking.
- ๐พ Persistent Question History to avoid repetition across sessions.
- Streamlit โ UI framework.
- LangChain with Groq โ LLM agent orchestration.
- CrewAI โ Agent management.
- sentence-transformers โ Embedding-based answer validation.
- LLM Used:
meta-llama/llama-4-maverick-17b-128e-instruct(viaChatGroq).
-
Launch the app:
streamlit run app.py
-
Read the narrator's introduction.
-
Answer general knowledge questions.
- Use the hint if you're stuck (once per question).
- Be carefulโwrong answers cost a life!
-
Score points for each correct answer.
- Every 3 correct answers = level up.
- Reach Level 10 to win!
| File | Purpose |
|---|---|
app.py |
Main game logic |
history.txt |
Stores asked questions (avoid repeats) |
README.md |
You are reading it ๐ |
| Agent | Role |
|---|---|
NarratorAgent |
Welcomes the player with story context |
QuestionAgent |
Creates fresh, level-based trivia questions |
HintAgent |
Generates helpful but vague hints |
AnswerCheckerAgent |
Validates answers with semantic comparison |
Install with:
pip install streamlit langchain crewai sentence-transformers scikit-learn