cpacker / MemGPT

Create LLM agents with long-term memory and custom tools 📚🦙
https://memgpt.readme.io
Apache License 2.0
11.19k stars 1.22k forks source link

Allow editable system prompts #1372

Open sarahwooders opened 3 months ago

sarahwooders commented 3 months ago

Currently we do not support editing the system prompt of AgentState, however there is a user request to make this editable so that the system prompt can be tuned for a live agent:

 The system prompt appears to be saved in the agent, so I have to attempt to use pgAdmin to edit it and it's not easy as its a long json.  This is why I asked about the dev portal as it would be really great if we could edit the system prompt of the agent.  
MrFCow commented 3 months ago

I am seeing there is the function at server's Agent class "_swap_system_message", and it try to replace the very first message (the system message) and append the rest. I do not see this being used

on the other hand, a lot of time, the situation is not replacing the system message (which is the core instruction of how MemGPT should react to user message in general like calling send_message function or using other tools...), but more to update the persona I suppose.

I tried the other function at server, the "update_agent_core_memory", it work sometimes and sometimes don't, I suppose that's the previous message history that interfere, my example is like:

  1. Agent's persona having alias = John
  2. Ask Agent's name
  3. "update_agent_core_memeory" , change persona and agent have alias Susan
  4. Ask Agent's name again

The step 4 above have 80% chance saying John and 20% saying Susan, while if step 2 not happen (agent don't have history of alis being John spoken, it is more likely saying alias is Susan [the new alias of updated persona])