A Python-based study assistant that generates and iteratively improves multiple-choice quizzes from lecture notes using the Groq API and a reflection loop.
- Quiz Generation: Automatically creates concise, high-quality multiple-choice quizzes from your study notes.
- Reflection Loop: Evaluates quizzes for clarity, accuracy, and quality, then regenerates improved versions based on feedback.
- Configurable Model: Uses Groq's LLM (default:
openai/gpt-oss-120b). - Environment Variable Support: API keys and secrets managed via
.envfile.
Reflection-Study/
│
├── reflection_agent.py # Main agent code
├── README.md # Project documentation
├── myreflectionstudy/
│ ├── .env # API keys (ignored by git)
│ ├── .gitignore # Ignore venv and sensitive files
│ ├── pyvenv.cfg # Virtual environment config
│ ├── Include/ # venv include files
│ ├── Lib/ # venv libraries
│ └── Scripts/ # venv scripts
-
Clone the repository:
git clone <your-repo-url> cd Reflection-Study
-
Create a virtual environment (if not already present):
python -m venv myreflectionstudy
-
Activate the virtual environment:
- Windows:
myreflectionstudy\Scripts\activate
- macOS/Linux:
source myreflectionstudy/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txt
(Create
requirements.txtwith needed packages:groq,python-dotenv) -
Set up your
.envfile:GROQ_API_KEY="your_groq_api_key_here"
Edit reflection_agent.py to provide your lecture notes.
Run the script:
python reflection_agent.pyThe agent will generate a quiz, reflect on its quality, and iteratively improve it.