Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: added /summarize command (#667)
Charles Packerd366e91c7065
diff --git a/memgpt/main.py b/memgpt/main.pyindex af2033b14..d456bf925 100644--- a/memgpt/main.py+++ b/memgpt/main.py@@ -21,6 +21,7 @@ from memgpt.interface import CLIInterface as interface # for printing to terminimport memgpt.agent as agentimport memgpt.system as systemimport memgpt.constants as constants+import memgpt.errors as errorsfrom memgpt.cli.cli import run, attach, version, server, open_folder, quickstartfrom memgpt.cli.cli_config import configure, list, addfrom memgpt.cli.cli_load import app as load_app@@ -205,6 +206,22 @@ def run_agent_loop(memgpt_agent, first, no_verify=False, cfg=None, strip_ui=Falsbreakcontinue+ elif user_input.lower() == "/summarize":+ try:+ memgpt_agent.summarize_messages_inplace()+ typer.secho(+ f"/summarize succeeded",+ fg=typer.colors.GREEN,+ bold=True,+ )+ except errors.LLMError as e:+ typer.secho(+ f"/summarize failed:\n{e}",+ fg=typer.colors.RED,+ bold=True,+ )+ continue+# No skip optionselif user_input.lower() == "/wipe":memgpt_agent = agent.Agent(interface)