piazzatron / anki-smart-notes

Superchange your anki flashcards with ✨AI✨
GNU General Public License v3.0
8 stars 2 forks source link

Smart Notes - Anki + AI generated fields ✨


Use AI / ChatGPT to automatically generate any field in your notes.

For example, ChatGPT is very powerful for language learners, who might use it to generate example sentences for new vocab. This plugin brings that whole process into Anki: set it up once, and every new piece of vocab will automatically receive an AI generated example sentence.

Write a prompt, associate it with a note type and field, and Smart Notes will automatically generate that field for you at review time – or generate groups of notes with a single click





Language learning, summarization, you name it – automate the busywork of card creation so you have more time for studying!


Usage


1. Installation:

Tools > Addons > Get Addon, paste in plugin id 1531888719. Restart Anki.

2. Set your OpenAI API Key:

This plugin requires a paid OpenAI API key: get one here.

Tools > Smart Notes > API key.

3. Add Smart Fields (AI generated fields):


Smart fields are AI generated fields associated with a particular card type. They may reference other fields, and you can have as many smart fields as you like.


  1. Click Tools > Smart Notes > Add

  2. Pick the card type and target field you want to automatically generate.

  3. Then, write the prompt that will be automatically sent to OpenAI/ChatGPT to generate the target field.


Writing a Prompt

A prompt may reference any other field on the card via {{double curly braces}}.

For example, if you're studying a language and want to generate a mmemonic to aid in memorization, you might make a prompt like this (assuming you have a field called "vocab"):

Create a simple, memorable mmemonic in Japanese for the word {{vocab}}. Reply with only the mmemonic.

It's often useful to tell language model to "only reply" with the phrase you care about.

You can't reference the target field, or other smart fields – but the addon will validate your prompt, so don't worry!


4. Automatically generate notes 😎

Generate smart notes during review, in edit or add flows, or batched in the card browser.



Generate during review

Smart fields are automatically generated in the background at review time.

This is approach is super useful if you import notes via AnkiConnect (Yomichan, etc) - simply set up your smart fields and no further effort required.

A sparkle emoji will briefly show (we love sparkle).

Note that you can turn automatic generation off in Smart Notes > Advanced.



Generate when adding or editing cards

Smart fields can also be generated prior to review. To (re)generate all smart fields on a note, press ctrl+shift+g (on Mac: cmd+shift+g) or click the ✨ button in the editor:



Alternatively, to generate a single smart field and leave the rest of the note untouched, right click an individual field in the editor and click "Generate Smart Field":



Generating Multiple Notes

In the notes browser, select a group of notes and then right click > generate smart fields to generate multiple notes with speedy batch processing (it's v fast)!

Generate an entire deck or note type by right clicking it in the browser.


Additional Features

Use any OpenAI model

Tools > Smart Notes > Advanced: Select from the newest gpt-4o to cheapest gpt-3.5-turbo (default).


Create complex prompts

Smart fields can reference as many other fields on your card as you like.


Additional Info

Smart Notes owes a debt of gratitude for inspiration to Intellifiller.

Cost (to OpenAI, not to me 😢)

Prices are per token - expect to pay a few tenths of a penny per call, but YMMV.


Crash Reporting

Smart Notes uses Sentry as a crash reporter to help me improve the software. No personally identifying information is collected by myself or by Sentry.

Changelog

v1.2.0

v1.1.0

Help and Support

Found a bug or want to request a feature? File an issue on Github .

Enjoying this addon? Please rate it to help others find it.👍