Public Beta
Not set

Experience

Changes how pages explain things, never what you can do.

More

Experience

Changes how pages explain things, never what you can do.

Sign inGet started

Study Assistant v0.2.1 · generic

Archive SHA-256 536deca3b50ebaa926488a4a9df7410b559c62f42190fb06d23b1e5b1cdfae14 · 27.4 KB · built Nov 27, 2026

README.md

# Study Assistant (AgentRove native agent)

Turns your own markdown notes into flashcards, schedules reviews with the SM-2 spaced-repetition
algorithm, and builds multiple-choice quizzes. Cards are copied from your notes, never generated by an
AI model, and quizzes only use answers that exist in your deck. Offline and deterministic.

- ID: `agentrove.study-assistant` · version 0.2.1 · MIT
- Published by AgentRove (provisional, configurable name). Package identifiers keep the agentrove prefix for compatibility.
- Runtime: Node.js 20 or newer, no npm dependencies
- Permissions: no filesystem access by tools, no network, no credentials
- External costs: none

## Tools

| Tool | What it does |
| --- | --- |
| `make_flashcards` | Extracts cards from markdown (outside fenced code blocks): `Q:` / `A:` pairs (also `Question:` / `Answer:`, bold markers allowed, multi-line answers until a blank line, one blank line allowed between Q and A); `term — definition` lines (also `–`, ` -- ` and `::`; the term must be at most 8 words and the line must contain exactly one dash separator, so prose with paired dashes is ignored); bold-colon definitions on any line (`**term**: definition`, `**term:** definition`, also `__term__:`); `term: definition` list items (term at most 5 words; labels such as `Note:`, `Tip:`, `Example:`, `Remember:` and times such as `10:30` are not terms); and each heading with the first sentence of the prose paragraph directly under it (if the first block under a heading is a list, table, term line, Q/A or code, the heading gets no card, so it is never paired with a later, unrelated paragraph). Cards get stable content-derived ids, your `tags` plus the section heading as a tag, and SM-2 defaults (due now, ease 2.5). Orphan questions/answers and duplicates are listed in `skipped` with line numbers. |
| `review` | One SM-2 step: `card` state + `quality` 0–5 + `now` → new `repetitions`, `interval_days`, `ease`, `lapses`, `due`, `last_reviewed`; also `lapse` and `repeat_today`. |
| `quiz` | Multiple-choice questions (`count`, default 10; `choices`, default 4). Distractors are other cards' answers, preferring cards of the same kind (definition vs Q/A answer) that share a section tag, then the same kind, then a shared tag (tags carried by every card, such as a course tag, are ignored for this); cards are picked and choices shuffled with a seeded RNG (FNV-1a + mulberry32), so the same cards and `seed` always give the same quiz. `due_only` limits questions to cards due at `now`. |

All tools have `side_effects: "none"`.

### SM-2 as implemented

Quality: 5 perfect, 4 correct after hesitation, 3 correct with difficulty, 2 / 1 / 0 incorrect.

- Ease: `EF' = EF + (0.1 − (5 − q) × (0.08 + (5 − q) × 0.02))`, never below 1.3, rounded to 2 decimals.
- q ≥ 3: interval 1 day after the first successful repetition, 6 after the second, then
  `ceil(previous interval × EF)` using the ease before this review; repetitions + 1.
- q < 3 (a lapse): repetitions restart at 0, next interval 1 day, `lapses` + 1. The ease is still
  updated by the formula (as most SM-2 implementations do; the original paper is ambiguous here).
- `repeat_today` is true for q < 4 (SM-2 step 7: re-drill those items in the same session).
- `due = now + interval × 24 h` in UTC, so daylight-saving changes never shift reviews.

## Typed IO (AgentRove composition)

| Name | Type | Where |
| --- | --- | --- |
| input `text` | `text` | `make_flashcards.text` |
| input `cards` | `flashcards` | `quiz.cards` (and one card at a time in `review.card`) |
| output `cards` | `flashcards` | `make_flashcards` → `cards` |

## Usage (Node CLI)

```sh
node -e "const fs=require('node:fs');fs.writeFileSync('input.json',JSON.stringify({text:fs.readFileSync(process.argv[1],'utf8'),tags:['biology']}))" notes.md
node bin/cli.js make_flashcards --input input.json > cards.json

node bin/cli.js review --json '{"card":{"id":"c-1","ease":2.5,"repetitions":2,"interval_days":6},"quality":4,"now":"2026-11-25T09:00:00Z"}'

node -e "const fs=require('node:fs');const c=JSON.parse(fs.readFileSync('cards.json','utf8')).cards;fs.writeFileSync('quiz-in.json',JSON.stringify({cards:c,count:5,seed:'week-48'}))"
node bin/cli.js quiz --input quiz-in.json
node bin/cli.js --help
```

Store the cards (and each `review` result) yourself, for example in a JSON file; the agent keeps no
state between calls. `--input -` reads the input JSON from stdin instead of a file. Output is JSON on stdout; errors are JSON on stderr with exit code 1.

## Use as an MCP server (stdio)

`bin/mcp.js` implements MCP over stdio (`initialize`, `tools/list`, `tools/call`). Register it with an
absolute path, for example in Claude Code:

```sh
claude mcp add study-assistant -- node /absolute/path/to/study-assistant/bin/mcp.js
```

or in a project `.mcp.json`:

```json
{ "mcpServers": { "study-assistant": { "command": "node", "args": ["/absolute/path/to/study-assistant/bin/mcp.js"] } } }
```

`claude-code/SKILL.md` is an optional Claude Code skill that drives the CLI instead.

**Status:** tested with Node.js (unit tests plus MCP message handling). Not yet verified inside Claude
Code by AgentRove.

## Limitations

- Extraction is pattern-based. Notes that do not use Q:/A:, term–definition or term: definition lines
  or headings with prose produce few cards; plain `Term: definition` lines outside lists are not read
  (too often ordinary labels); heading cards use the heading text as the prompt, which may be vague.
- No persistence, no review history or statistics; you keep the card JSON.
- Distractors are other answers from your deck, so with very few cards, or cards whose answers are
  much longer or shorter than the rest, quizzes can be easy to guess. Cards whose answer duplicates
  every other answer are skipped (see `notes`).
- Answers are compared case- and whitespace-insensitively when choosing distractors.
- Limits: 2 M characters of notes, 5000 cards per quiz, 200 questions.

## Security and privacy

See [SECURITY.md](SECURITY.md). Notes are untrusted data: pattern-matched only, never executed or
followed. Nothing leaves your machine.

## License

MIT, see [LICENSE](LICENSE).

Find an agent

Do not include passwords, keys, customer data or other confidential details.
Rule-based matching is free during the public beta (fair use).