How the ecosystem works, in one page.
mneme is a local-first study ecosystem. The LLM runs on your machine via Ollama, the cards live in your browser, and the only network call is the one-time Ollama model download. Everything below is what you get on day one.
Nothing leaves your machine
Source parsing, fact extraction, card writing, dedup, difficulty rating: all on your computer. Frontend talks only to local backend; backend talks only to local Ollama. No telemetry, no analytics, no third-party script.
Grounded in your source
Cards aren't free-form. They're derived from atomic facts the LLM extracted from your text, and each card carries its source so future-you can audit "where did this come from?"
Built on Ollama
Pull any model from the Ollama library (Qwen 2.5, Llama 3.x, Gemma 3, Phi 3, ...) and mneme uses it. A 7B model is enough for most sources; a 12-14B model is noticeably better on dense chapters.
Interpretable difficulty
Every card gets an easy/medium/hard label with a plain-English reason ('sentence-length answer; contains a number'). Opt in to a Tsetlin Machine classifier for fully interpretable difficulty rules.
The ecosystem
One map of the whole thing
From a raw file to mastery. Every box is a feature you can use today.
Your source
PDF, EPUB, MD, URL
Pipeline
atomic facts -> cards
Library
all your decks
Deck
edit, favorite, tag
Study modes
5 ways to drill
Progress
streak, heatmap, FSRS
Mastery
achievements
Every piece runs on your machine. Solid arrows = same browser session. Dashed arrows = work persists in localStorage between sessions.
The pipeline
From file to deck in eight steps
Each box runs in process. Anything tagged 'LLM' is an Ollama call; everything else is pure Python.
Load
Read the PDF, EPUB, Markdown, HTML, or URL into plain text.
Chunk
Split the text on headings and paragraphs, capped at ~600 tokens with a small overlap.
Atomic facts
Local LLM (Ollama) extracts up to 8 atomic claims from each chunk.
LLMQ/A generation
For each fact the LLM writes one or two question-answer pairs following the minimum-information principle.
LLMQuality filter
Heuristic drops yes/no cards, definitional loops, and low-information answers.
Dedup + difficulty
Cosine-similarity de-duplication via local embeddings; per-card difficulty with a plain-English rationale.
TM optionalAnki deck
Write a portable .apkg file or push directly into a running Anki via AnkiConnect.
Study
Either in the browser flip-card mode (this site) or in Anki itself with FSRS scheduling.
Atomic-fact grounding
One paragraph -> many cards
The LLM never writes cards directly. It extracts atomic facts first; then a second pass writes a question and answer for each fact. This 'minimum information principle' is what spaced-repetition research has linked to the highest long-term recall.
Photosynthesis is the process by which green plants convert sunlight, water, and carbon dioxide into glucose and oxygen. It occurs primarily in the chloroplasts of plant cells, where the green pigment chlorophyll absorbs light energy.
What are the primary inputs for photosynthesis?
Sunlight, water, and carbon dioxide
What two substances does photosynthesis produce?
Glucose and oxygen
What pigment do chloroplasts contain?
Chlorophyll
Five ways to study
Different modes, different cognitive workouts
Each mode hits a different memory mechanism. Mix them across the week to build durable retention.
Flip
Classic. Reveal, grade, repeat.
Quiz
Multiple choice. Distractors come from your deck.
What gas do plants release?
Cloze
Blank a key term in context. Type to fill it.
Water boils at ____ degrees Celsius at sea level.
Write
Free recall. Scored by key-term overlap.
Define osmosis.
Match
Pair Q with A in rounds of six.
Speed
5s per face. Builds automatic recall.
Mitosis vs meiosis?
Cram
Only your misses + due cards.
Test
Timed mixed-format exam. Scored at the end.
12:48 left - 7/10 correct
Why five modes?
Recall under recognition (quiz) is different from free recall (cloze) is different from speeded recall (speed). Research shows that practicing the same material under varied retrieval conditions yields stronger long-term retention than drilling one mode. mneme lets you switch modes without leaving the deck.
Progress & retention
Every grade you give compounds
The browser tracks every review so you can see exactly how mastery builds, without sending anything to anyone.
Daily streak
A card reviewed any time on a given day extends your streak. We don't punish missed days; your longest streak stays as a badge of honor.
FSRS-lite scheduling
Each grade adjusts the card's ease and next-due date using a simplified SM-2-style algorithm. Cram mode auto-queues only the ones that come due.
90-day heatmap
A GitHub-style activity grid colored by the number of cards you reviewed each day. Patterns become obvious within two weeks.
12 achievements
From First Spark (one card) through Card Connoisseur (1,000 cards). Bronze, silver, gold, and platinum tiers.
Per-deck mastery
Each deck shows due-now, learned, mastered, and lapses. Mastered = 4+ correct repetitions with no lapses.
Card edit + favorites
Tweak any generated card, add personal notes, favorite the ones you love, archive ones you don't need. All overlays live in the browser; the source deck never changes.
On a Tesla V100, Gemma 3 12B, real run
A one-page chapter, end to end.
Numbers from the photosynthesis sample shipped in examples/sample.md.
Wall clock
46 s
load + chunk + LLM + filter + dedup + write
Atomic facts
13
2 chunks, ~6 facts each
Final cards
17
after dedup at threshold 0.85
Architecture
Two halves, one box
The Python backend handles generation; the Next.js frontend is the entire study experience. They share a strict API contract; either could be replaced.
Backend
FastAPI + uvicorn, ~400 LOC
POST /api/jobsupload a file and start a generationGET /api/jobs/{id}/eventsServer-Sent Events stream of pipeline progressGET /api/jobs/{id}/cardsJSON list of generated cardsGET /api/jobs/{id}/apkgportable Anki package downloadGET /api/healthliveness + Ollama discovery
Frontend
Next.js 15, TypeScript, Tailwind
- Library dashboard with stats, search, sort, filters
- Per-deck detail page with editable card list, tags, favorites
- Five study modes (Flip, Quiz, Cloze, Speed, Cram)
- FSRS-lite scheduling in localStorage, no server round-trip
- Streak counter, 90-day heatmap, 12 achievements
- Pomodoro timer, custom card author, CSV/JSON/TSV exports
Questions
Plain answers.
Where do my stats live?
Only in your browser's localStorage. Clear your storage and the streak goes with it. There's no account, no sync, no server-side stats.
What's the difference between FSRS-lite (in mneme) and Anki's FSRS?
Anki's FSRS-5 fits a per-user retention model from your full review history. mneme's in-browser scheduler is a simplified SM-2-style algorithm (ease + interval) that's good enough for in-session prioritization but doesn't try to compete with Anki for long-term scheduling. Push the deck to Anki for the real thing.
Do I need a GPU?
For the mneme pipeline itself, no - it's pure Python. For the LLM, Ollama uses your GPU if you have one and falls back to CPU otherwise. CPU works but is slower; a 7B model on CPU takes ~5-10 minutes per chapter.
Which Ollama model should I use?
Qwen 2.5 7B Instruct is the smallest model that produces good cards. Gemma 3 12B is noticeably better on dense chapters; Llama 3.1 8B is a fine alternative. Anything below 4B tends to hallucinate.
Will it work with cloud LLMs like GPT-4?
The library is local-first by design. Hooking up a cloud backend is a one-file change (implement the LLMBackend protocol in mneme.llm.backend) but is not enabled by default and never will be the default.
How does difficulty rating work?
Each card is scored by a small rules-based classifier that checks for numerical answers, named entities, negation, sentence-length answers, and a few more signals. An optional interpretable Tsetlin Machine classifier (mneme.difficulty.tsetlin) learns from your own grades over time.
Is my data sent anywhere?
No. The frontend speaks only to the local FastAPI backend; the backend speaks only to local Ollama. There is no telemetry, no analytics, no third-party script.
Try it on a real chapter.
Drop a PDF in, watch the pipeline run, then pick a study mode. Cards are yours to keep, the code is MIT, the AI is local.