databasedmcp gives your AI assistant databases it keeps between conversations, so everything in this article works from the day you connect it. Free to start, no card.
Get started freeWhy build it yourself
Flashcards come down to three things: the cards, when each one is next due, and how you did last time. Quizlet and Anki wrap that in apps, shared decks and sync. If you study in short sessions at your desk, a chat can do the asking.
ChatGPT is good at the slow part: turning a page of notes into clean question and answer pairs. With the cards and schedule in a database, it can quiz you on what's due today. It takes your answer and pushes the card further out when you knew it.
Connect ChatGPT to databasedmcp
databasedmcp is a remote MCP server that gives AI assistants private SQLite databases, with nothing to install.
ChatGPT connects to remote MCP servers as custom connectors in developer mode. That's on paid plans, on the web. Turn on developer mode in ChatGPT's settings, then create a connector: give it a name, enter https://databasedmcp.com/mcp as the URL and choose OAuth. When ChatGPT opens a databasedmcp page, sign in and select Allow. In a new chat, turn the connector on from the tools menu.
ChatGPT moves these menus between releases. If yours look different, search its settings for developer mode and custom connectors.
Any other MCP client works the same way; the docs have the details.
Copy this prompt to build it
Paste this into ChatGPT to set up the database, its tables and its guide in one go. The rest of this article walks through what it makes and how you use it.
Set up flashcards with spaced repetition for me in databasedmcp, in one go. 1. Create a database called flashcards, described as "Flashcards with spaced repetition: decks, cards with their next due date, and every review". 2. Create three tables: - decks: id, name (required, unique), one per subject. - cards: id, deck_id (references decks, required), front (the question, required), back (the answer, required), interval_days (the current gap in days, defaults to 0), due (date of the next review, defaults to today), created_at (defaults to now). - reviews: id, card_id (references cards, required), grade (again, hard, good or easy), at (defaults to now). 3. Write the database a guide that says what each table is for and how a quiz works: ask the front, wait for my answer, show the back, ask me to grade it, then log the review and reschedule the card. The rule: again is 1 day, hard keeps the same interval, good doubles it (at least 2 days), easy triples it (at least 4 days), and due moves that many days from today. Include the query for "due now": up to 20 cards in a deck with due on or before today, earliest first. From then on: when I give you notes, turn them into cards in the deck I name. When I say quiz me, take the due cards one at a time and keep the back to yourself until I've answered. After each grade, log the review and reschedule the card. Show me the tables when you're finished.
Ask for the database
You don't write the schema. Describe what you want:
Set up flashcards in databasedmcp with spaced repetition: decks, cards with a front and back, and a log of every review. When I study, quiz me on what's due, one card at a time, and after each answer reschedule the card: again is tomorrow, hard keeps the interval, good doubles it, easy triples it.
ChatGPT creates a database called flashcards and its tables:
CREATE TABLE decks (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL UNIQUE
);
CREATE TABLE cards (
id INTEGER PRIMARY KEY,
deck_id INTEGER NOT NULL REFERENCES decks(id),
front TEXT NOT NULL,
back TEXT NOT NULL,
interval_days INTEGER NOT NULL DEFAULT 0,
due TEXT NOT NULL DEFAULT (date('now')),
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE reviews (
id INTEGER PRIMARY KEY,
card_id INTEGER NOT NULL REFERENCES cards(id),
grade TEXT NOT NULL CHECK (grade IN ('again', 'hard', 'good', 'easy')),
at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);
It also writes the database a guide on how the tables are meant to be used. The guide comes back with the schema whenever an assistant looks the database up. ChatGPT files things the same way next week as today, and so does any other assistant you connect.
# flashcards: spaced repetition
- **decks**: one per subject.
- **cards**: front (the question) and back (the answer). `interval_days` is the current gap, `due` the next review date. New cards are due today.
- **reviews**: one row per answer. grade: again, hard, good, easy.
Quiz: ask the front, wait for my answer, show the back, ask me to grade it. Then log the review and reschedule:
again = 1 day, hard = same interval (at least 1), good = double (at least 2), easy = triple (at least 4).
Due now: `SELECT c.id, c.front FROM cards c JOIN decks d ON d.id = c.deck_id WHERE d.name = ? AND c.due <= date('now') ORDER BY c.due, c.id LIMIT 20`
Use it
From here on you talk, and ChatGPT writes the rows. Each request below is one statement:
Start a deck called Spanish verbs.
INSERT INTO decks (name) VALUES (?) RETURNING id -- params: ["Spanish verbs"]
Make cards from these: tener is to have, poder is to be able to, querer is to want.
INSERT INTO cards (deck_id, front, back) SELECT ?, json_extract(value, '$.front'), json_extract(value, '$.back') FROM json_each(?)
-- params: [1,"[{\"front\":\"tener\",\"back\":\"to have\"},{\"front\":\"poder\",\"back\":\"to be able to, can\"},{\"front\":\"querer\",\"back\":\"to want, to love\"}]"]
One statement adds the whole batch, however many cards there are.
Quiz me on Spanish verbs.
SELECT c.id, c.front FROM cards c JOIN decks d ON d.id = c.deck_id WHERE d.name = ? AND c.due <= date('now') ORDER BY c.due, c.id LIMIT 20
-- params: ["Spanish verbs"]
ChatGPT asks the fronts one at a time and keeps the backs to itself until you answer.
Tener: to have. Good.
INSERT INTO reviews (card_id, grade) VALUES (?, ?) -- params: [1,"good"]
ChatGPT reschedules the card.
UPDATE cards SET interval_days = CASE ? WHEN 'again' THEN 1 WHEN 'hard' THEN max(1, interval_days) WHEN 'good' THEN max(2, interval_days * 2) ELSE max(4, interval_days * 3) END, due = date('now', '+' || CASE ? WHEN 'again' THEN 1 WHEN 'hard' THEN max(1, interval_days) WHEN 'good' THEN max(2, interval_days * 2) ELSE max(4, interval_days * 3) END || ' days') WHERE id = ?
-- params: ["good","good",1]
Both columns read the old interval, so the new due date is computed from the same rule. A card you know drifts out to weeks, then months.
Ask it questions
Once there's data, each report you'd pay for is a single query:
How many cards are due today and this week, per deck?
SELECT d.name, sum(c.due <= date('now')) AS due_today, sum(c.due <= date('now', '+7 days')) AS due_this_week, count(*) AS cards FROM decks d JOIN cards c ON c.deck_id = d.id GROUP BY d.id ORDER BY due_today DESC
Which cards do I keep getting wrong?
SELECT c.front, c.back, count(*) AS misses FROM reviews r JOIN cards c ON c.id = r.card_id WHERE r.grade = 'again' GROUP BY c.id ORDER BY misses DESC LIMIT 10
How have my study sessions gone over the last two weeks?
SELECT date(at) AS day, count(*) AS reviewed, round(100.0 * sum(grade != 'again') / count(*)) AS pct_right FROM reviews WHERE at >= datetime('now', '-14 days') GROUP BY day ORDER BY day
You can also open the database on the website, page through its rows and run read-only SQL yourself.
What you give up
This is text only, in a chat. Anki and Quizlet show images, play audio, run on your phone offline and sync between devices. Quizlet also has a library of decks other people made. Here every card is one you asked for, and you review where you can talk to ChatGPT.
The schedule is a simple rule, not Anki's scheduler, which tunes each card from your history. And nothing reminds you to study: cards fall due in the database, but you have to open a chat and ask. If a daily streak on your phone keeps you going, Anki or Quizlet suits you better.
Try it
databasedmcp is free to start, with no card. Free has 100 tool calls a week, enough to set this up and try it for a week. Starter has 1,000 for everyday use.