Adding FSRS retrievability to AnkiConnect

I would like to modiffy AnkiConnect plugin to include the FSRS retrievability score ( via [0])
Does anyone know where the FSRS retrievability score is calculated?

I know where to change it in the plugin [1], but I don’t know where in Anki-source code it is exactly calculated. All the places I could find were in Rust.
There is an SQL function to calculate it [2], but I am kinda lost on what parameter to pass in [1].

[0] anki-connect#getreviewsofcards
[1] anki-connect/src/branch/master/plugin/init.py#L1582
[2] sqlite.rs#L270

(edit: I would love to add links, but I can’t since this account is new)

1 Like

It’s calculated in the Rust backend:

1 Like

Thank you, that helps; but not sure at this point how to call that function from the Python part.

On the Python side, you only have access to card.memory_state. Apparently you need to re-implement current_retrievability() and days_since_last_review().

1 Like

In the old version of FSRS4Anki Helper add-on, I developed a function to calculate the current retrievability:

I hope it would be helpful.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.