Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: patched pop (#1232)
Charles Packerbca1f9ba8c74
diff --git a/memgpt/main.py b/memgpt/main.pyindex 5334b4f08..d8d31aae8 100644--- a/memgpt/main.py+++ b/memgpt/main.py@@ -11,6 +11,7 @@ from memgpt.constants import FUNC_FAILED_HEARTBEAT_MESSAGE, JSON_ENSURE_ASCII, Jconsole = Console()+from memgpt.agent import save_agentfrom memgpt.agent_store.storage import StorageConnector, TableTypefrom memgpt.interface import CLIInterface as interface # for printing to terminalfrom memgpt.config import MemGPTConfig@@ -192,7 +193,9 @@ def run_agent_loop(memgpt_agent, config: MemGPTConfig, first, ms: MetadataStore,else:print(f"Popping last {pop_amount} messages from stack")for _ in range(min(pop_amount, len(memgpt_agent.messages))):- memgpt_agent.messages.pop()+ memgpt_agent._messages.pop()+ # Persist the state+ save_agent(agent=memgpt_agent, ms=ms)continueelif user_input.lower() == "/retry":