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: fix bug in migration script memory for 0.3.18 (#1548)

Sarah Wooders198009c78468
diff --git a/examples/google_search_preset.yaml b/examples/google_search_preset.yaml
deleted file mode 100644
index 2454e1f2e..000000000
--- a/examples/google_search_preset.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-system_prompt: "memgpt_chat"
-functions:
- - "send_message"
- - "pause_heartbeats"
- - "core_memory_append"
- - "core_memory_replace"
- - "conversation_search"
- - "conversation_search_date"
- - "archival_memory_insert"
- - "archival_memory_search"
- - "google_search"
diff --git a/scripts/migrate_0.3.18.py b/scripts/migrate_0.3.18.py
index 5ac681ab9..7bbd8d009 100644
--- a/scripts/migrate_0.3.18.py
+++ b/scripts/migrate_0.3.18.py
@@ -32,10 +32,10 @@ agent_states = []
with engine.connect() as conn:
agents = conn.execute(table.select()).fetchall()
for agent in agents:
- # print(agent)
id = uuid.UUID(agent[0])
user_id = uuid.UUID(agent[1])
name = agent[2]
+ print(f"Migrating agent {name}")
persona = agent[3]
human = agent[4]
system = agent[5]
@@ -46,7 +46,7 @@ with engine.connect() as conn:
state = agent[10]
tools = agent[11]
- state["memory"] = {"human": human, "persona": persona}
+ state["memory"] = {"human": {"value": human, "limit": 2000}, "persona": {"value": persona, "limit": 2000}}
agent_state = AgentState(
id=id,
@@ -67,9 +67,15 @@ with engine.connect() as conn:
agents_model = Table("agents", metadata, autoload_with=engine)
agents_model.drop(engine)
+# remove tool table
+tool_model = Table("toolmodel", metadata, autoload_with=engine)
+tool_model.drop(engine)
+
# re-create tables and add default tools
ms = MetadataStore(config)
add_default_tools(None, ms)
+print("Tools", [tool.name for tool in ms.list_tools()])
+
for agent in agent_states:
ms.create_agent(agent)