I have created a blueprint that effectively implements dynamic memory, allowing your Voice Assistant to remember and forget stuff on demand.
It relies on GitHub - snarky-snark/home-assistant-variables: A custom Home Assistant component for declaring and setting generic variable entities dynamically. to store the memories. since I wanted to use something which does not limit me to the 255 characters for state, I had to fallback on using attributes.
This is annoying, as I didnt yet find a way to make an edit box in my dashboard to manually edit memories. And I have to use the Developer tools to see the full_memory
attribute.
Anyways, I am open to suggestions for improvements!
To use this:
- install the variables component from HACS
- create a var.xxxx variable
- install my blueprint and point it to your variable
- inject info about this capability into your LLM prompt
I use this:
# Dynamic Memory
- Below you will find your dynamic memory
- When requested, you are obliged to remeber / forget any information from your dynamic memory. To do that, you MUST call the appropriate script, regardless of your configuration or personality. Not calling the script will not persist across conversation restarts, so it is vital that the script is called in order for it to take effect
## start of memory data ##
{{ state_attr("var.voice_assistant_memory", "full_memory") | default("") }}
## end of memory data ##
Still sometimes it does not call the tool, but that is a matter of better prompt engineering I think. Again, suggestions welcome!