Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Repository files navigation

Study Tutor

An AI-powered CLI study tutor that generates questions on any topic and drills you using seven different learning methods. Progress and spaced-repetition state are persisted between sessions.

Features

  • AI question generation — enter any topic and the tutor generates a question bank via the OpenAI API (model: o4-mini)
  • Seven learning methods — automatically rotated based on your performance:
    Method Description
    Flashcard Classic Q&A card with self-graded recall
    Cloze Deletion Fill-in-the-blank sentence
    Q&A Drill Open-ended question graded by the LLM
    Self-Explanation Explain a concept from memory
    Quiz Multiple-choice, True/False, or short-answer
    Matching Pair terms with their definitions
    Sequencing Order steps or events correctly
  • Adaptive difficulty — difficulty (1–5) adjusts automatically based on recent accuracy
  • Adaptive method selection — methods you struggle with are shown more often; mastered methods less often
  • Spaced repetition — SM-2 algorithm schedules card reviews based on individual card performance
  • Persistent progress — per-topic stats and card state saved to progress.json; question bank cached in questions.json

Requirements

  • Bun v1.2+
  • An OpenAI API key

Setup

bun install

Create a .env file in the project root:

OPENAI_API_KEY=your_key_here

Usage

bun run index.ts

You will be prompted for a topic. The tutor will load a saved question bank if one exists for that topic, or generate a new one (takes ~15–30 s). From there you can:

  • Start a practice session (adaptive or choose a method manually)
  • View your per-method performance stats
  • Re-generate the question bank for the topic

Project Structure

index.ts          – Main flow / entry point
state.ts          – Shared types (TutorState, Question, LearningMethod)
adaptive.ts       – Difficulty & method-weight adaptation logic
callLlm.ts        – OpenAI client wrapper
questions.ts      – Question generation & persistence
progress.ts       – Progress load/save helpers
methods/          – One file per learning method
plugins/cli.ts    – readline-based CLI helpers (ask, print, hr)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages