Skip to content

Repository files navigation

Mnemo

A study toolkit. Upload your notes, get spaced-repetition decks, scenario-based quizzes, and navigable ontologies. Study in-browser or take it offline.

Demo

Try it now

Open the published Claude Artifact: single-file version that runs in your browser, no setup.

What it does

  1. Start the backend + frontend.
  2. From the homepage, click + New deck and upload a notes file. The backend calls an AI provider to generate Q/A pairs grounded in your notes, saves a JSON deck, and the new deck appears in the grid.
  3. Pick a deck and hit Start. A short countdown plays, then the first question appears.
  4. Control the session: Show Answer flips the card, Next / Previous move through the deck, Shuffle reorders the remaining cards.
  5. Keyboard shortcuts during study: Space (flip), ← / → (prev / next), S (shuffle).

There's also a CLI path (backend/cli.py) for generating decks, quizzes, or ontologies from the terminal.

Features

  • Upload .md / .txt notes through the UI
  • AI-generated Q/A pairs grounded in the source notes
  • Multi-provider support (Gemini, Anthropic, OpenAI), set in config
  • Multiple decks, picked from a homepage grid
  • Study controls: flip, next, previous, shuffle
  • 3D card flip animation on reveal
  • Keyboard shortcuts during study (Space / arrows / S)
  • 3-2-1 countdown before the first card
  • A single-file Claude Artifact version (artifact/flashcards.jsx) that runs the study experience in a sandboxed iframe, no backend required

Tech stack

Layer Choice
Backend Python 3.13 + FastAPI
Frontend React (Vite) + CSS Modules
Package manager (Python) uv
Package manager (JS) npm
Data format JSON (decks on disk)
AI providers Gemini / Anthropic / OpenAI

Project structure

mnemo/
├── backend/
│   ├── main.py                 # FastAPI app entrypoint
│   ├── cli.py                  # `python -m backend.cli {flashcards|quiz|ontology} <file>`
│   ├── ai.py                   # AIClient — provider abstraction (Gemini/Anthropic/OpenAI)
│   ├── parsing.py              # Shared LLM-output helpers (strip_code_fence, parse_json)
│   ├── renderer.py             # Jinja2 wrapper for HTML export
│   ├── makers/
│   │   ├── base.py             # Maker (ABC), SingleCallMaker (template method)
│   │   ├── flashcards.py       # FlashcardMaker
│   │   ├── quiz.py             # QuizMaker
│   │   └── ontology.py         # OntologyMaker (outline → parallel fill)
│   └── api/
│       ├── _upload.py          # Shared upload + generate + write-artifact helper
│       ├── decks.py            # /api/decks{,/{id},/upload}
│       ├── quizzes.py          # /api/quizzes{,/{id},/{id}/download,/upload}
│       └── ontologies.py       # /api/ontologies{,/{id},/{id}/download,/upload}
├── frontend/
│   ├── src/
│   │   ├── pages/              # Home, Study, Quiz, Ontology
│   │   ├── components/         # Flashcard, StudyControls, Create*Modal, *Card, ...
│   │   ├── api.js              # Frontend API client
│   │   └── ...
│   └── ...
├── templates/                  # Jinja2 templates for standalone HTML export
│   ├── quiz.html.j2
│   └── ontology.html.j2
├── artifact/
│   └── flashcards.jsx          # Single-file Claude Artifact version
├── notes/                      # Source notes (input), gitignored
├── decks/                      # Generated decks (output), gitignored
├── quizzes/                    # Generated quizzes (output), gitignored
├── ontologies/                 # Generated ontologies (output), gitignored
├── pyproject.toml
└── README.md

Setup

Prerequisites: Python 3.13, Node.js 20+, uv, an API key for one of the supported AI providers.

# Python dependencies
uv sync

# Frontend dependencies
cd frontend && npm install && cd ..

# Configure environment, fill in values
cp .env.example .env
cp frontend/.env.example frontend/.env

The .env.example files document the variables. The real .env files are gitignored.

Usage

./dev.sh

Starts the backend on http://localhost:8000 and the frontend on http://localhost:5173 in one terminal. Ctrl+C stops both.

Or run them separately:

# Terminal 1
uv run uvicorn backend.main:app --reload

# Terminal 2
cd frontend && npm run dev

Open http://localhost:5173. Click + New deck, pick a .md or .txt file, hit Create. Wait ~30 seconds while cards generate. Pick the new deck from the grid and hit Start.

To generate from the CLI instead of the UI:

uv run python -m backend.cli flashcards notes/my_notes.md
uv run python -m backend.cli quiz       notes/my_notes.md
uv run python -m backend.cli ontology   notes/my_notes.md

Possible next steps

  • Mark cards as known / needs-review and re-quiz only the latter
  • Spaced-repetition scheduling (FSRS or SM-2)
  • Export decks to Anki
  • Persistent study session history
  • Multi-user accounts + a deployed instance

About

Turn study notes into interactive flashcards. Upload a `.md` or `.txt` file, the app generates question/answer pairs with an AI, then you study the deck through a web UI: flip, next, previous, shuffle.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages