This video was great inspiration. I've worked with a few of the ideas in here and further refined them.

The idea of adding prompting the AI to output both "message" and "memory" as JSON is really good.

The issue we face is that by default the agents memory only captures what it says to the user in its message.

However there may be many other things it needs to remember such as pubkeys, eventIds, etc.

The e.g. being:

User – Get my latest mention

AI – Here it is, Y says "Z"

User – Zap that note

AI – Sorry I don't have the Id of the note

Without extra memory the last instruction will fail because the AI won't have remembered the eventId, even though it previously had it, as, since it wasn't expressly said by the AI to the user the AI did not commit it to memory.

Instead we prompt the AI to output both a "message" for the user, and also a "memory" for itself. We only pass the message to the user, and we ask the AI to use the memory field extensively for anything it thinks it may need to recall later.

A few refinements vs that video–

- no need to use the extra memory write node, the AI node alone works better, and,

- no need to be prescriptive with the memory format, allowing the AI to specify whatever it thinks it needs works great, and is less prone to JSON parsing errors.

nostr:nevent1qqsv0g4apmlqt0ys94mg698g8jt2lt0ymr2nx37dx8d8z70t4t4e6yqpz9mhxue69uhkummnw3ezuamfdejj7q3qr0d8u8mnj6769500nypnm28a9hpk9qg8jr0ehe30tygr3wuhcnvsxpqqqqqqz95842r

Reply to this note

Please Login to reply.

Discussion

I've not watched the vid so apologies in advance...but would something like this help? https://github.com/doobidoo/mcp-memory-service

I'll take a look!

The solution I outlined is actually a very good solution too. Explicitly prompting it to give an output for its own memory works really well.