v2rockets / Loyal-Elephie

Your Trusty Memory-enabled AI Companion - Simple RAG chatbot optimized for local LLMs | 12 Languages Supported | OpenAI API Compatible
MIT License
236 stars 19 forks source link

Feature ask #13

Open hennas-waifson opened 3 months ago

hennas-waifson commented 3 months ago
Screenshot 2024-06-18 at 5 09 59 PM

"Ongoing concerns" - a listing of topics of top interest in the prompt.

From the agent prompt in settings.py= ...

  1. Ongoing concerns or items of note from prior sessions to possibly bring up career changes, moving to a new city, planning a dream vacation, date with Anna</Ongoing Concerns>. Consider searching up and bringing up one of those topics. ...

The AI would be able to amend the listing of 'ongoing concerns' by itself (when the convo is saved, review the convo for anything to add to ongoing concerns) or when user requests it, by placing a new listing in the output similar to a search or think tool. I tried with kunoichi-7b-DPO (the one answering in the screenshot) and it is able to figure out hot to use the tool. However, I have not been able to figure out hot to fish out the updated listing from between the in the AI output and update that info between the tags in the settings.py.

Having such a user/AI editable 'agenda' list will nicely supplement the long-term memory.

v2rockets commented 3 months ago

Sounds like a good idea, thanks! I've also thought about a relevant but kind of different idea which would keep a "working memory" context which would be useful to interpret frequently used special context (Like special people, special locations). This one is definitely interesting and if you know programming, I'm looking forward to see you explore further and share the result.

hennas-waifson commented 3 months ago

Hey, thanks for your kind words of encouragement! I don't know coding, but I am trying to have openai help me figure this out. No luck so far, lol. But yeah, I think you are right - there is a need for some sort of editable listing of topics. Long term memory would not show if something got resolved (an issue), or completed (a task), or some important deadline is no longer relevant. "ongoing concerns" seems like an all-encompassing name for a variety of things, that AI can quickly use as queries to pull up relevant info. More testing is surely needed, too.

The process that you came up with (of thinking plus multiple search queries) is nicely flexible. AI can do a search on one 'ongoing concern' or many at once, and then pick which one to bring up based on its own judgement or prompt instructions. Very cool!

hennas-waifson commented 3 months ago

Edit: had to reverse < the tags, else their disappear in the post. Prompt segment:

  1. Ongoing concerns are items to bring up/follow up on of high importance mentioned in prior conversations: Scooch training,upcoming Amira's birthday,bee swarming expected in July</Ongoing_concerns< {NICK_NAME} requests that you use these to search your memory.

Actual Example of question-response: ...{'role': 'user', 'content': 'lol. any issues for us to ponder about?'}]

<THINK<To assist Andy, I need to search my memory for the questions: Are there any ongoing concerns mentioned in prior conversations?</THINK< <SEARCH< Ongoing_concerns Scooch training,upcoming Amira's birthday,bee swarming expected in Julyqueries: ['Ongoing_concerns', "Scooch training,upcoming Amira's birthday,bee swarming expected in July"] {'ids': [['Conversation on 2024-06-18 17:07:12_1',...

Response: "Hey Andy, I see we have a few ongoing concerns to address. Firstly, let's not forget about Scooch training. How are you feeling about your progress so far? Secondly, Amira's birthday is coming up soon. Have you thought about any plans or gifts for her? Lastly, bee swarming is expected in July. Do we need to make any preparations for that? References Conversation on 2024-06-18 17:07:12"

Note: It seems to work, not 100% of the time, but that's expected. I mean, if one really needs to know, asking the Elephie directly to list the important issues works 100% of the time (with KunoichiDPO 7b). Populating between the tags in settings.py is something I have not figured out yet. However, if prompted with something like "finding a present for Amira can be marked off the list", Elephie can generate a new listing of ongoing concerns without that item, between the tags in her output - to then be 'fished out' and updated in settings.py prompt.

The 'Ongoing_concerns' can also be branded as 'Action_Items' for example. It has an equally universal ring to it.

Removing an item from ongoing concerns actual example: ...{'role': 'user', 'content': 'Please remove Scooch from ongoing concerns.'}]

Upcoming Amira's birthday, bee swarming expected in July

<SEARCH< Remove Scooch training from ongoing concernsqueries: ['Remove Scooch training from ongoing concerns']...

Removing an item - AI response Alright, Andy. I have removed Scooch training from our ongoing concerns list. Now, our current ongoing concerns are Amira's birthday and the bee swarming expected in July. If you need any assistance or reminders related to these matters, just let me know