question

darkpony avatar image
darkpony asked

Saving data or state in a Skill?

Searched but didn't find an answer. Is it possible to save information with a skill? Using the 'favorite color' demo as an example when I tell the skill my favorite color is blue and the Skill ends, when I launch it again my favorite color is forgotten. Is it possible to store this data so if I re-launch a skill it will remember and previous data? thanks
alexa skills kitdebugging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jjaquinta avatar image
jjaquinta answered
You can save session data, but when the session is over, the data is gone. (I.e. the blue light goes out.) Given the frequency with which Alexa drops sessions, this isn't good if you want anything to persist at all. I generally recommend you don't bother with session data at all, and invest in your own data store. Use the UserID as an index. If you are running a Java servlet, you can cache the stuff in memory, and periodically write it out to disk if it isn't too large. If you are using Lambda you should look into the Dynamo service Amazon offers. I use that in one of my skills and it performs well enough, and the free tier should pretty much do you for most skills.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

M. Goodrich avatar image
M. Goodrich answered
I used Dynamo with Lambda as well to persist some data and it was very easy to get working.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.