Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix cli delete agent

madgrizzle752110bb32df
diff --git a/memgpt/cli/cli_config.py b/memgpt/cli/cli_config.py
index bca42b9af..94245ab5e 100644
--- a/memgpt/cli/cli_config.py
+++ b/memgpt/cli/cli_config.py
@@ -1211,7 +1211,9 @@ def delete(option: str, name: str):
assert source is not None, f"Source {name} does not exist"
client.delete_source(source_id=source.id)
elif option == "agent":
- client.delete_agent(name=name)
+ agent = client.get_agent(agent_name=name)
+ assert agent is not None, f"Agent {name} does not exist"
+ client.delete_agent(agent_id=agent.id)
elif option == "human":
human = client.get_human(name=name)
assert human is not None, f"Human {name} does not exist"