Replace Memori with Mem0 for memory management: - Delete memori_config.py, memori_manager.py, memori_middleware.py - Add mem0_config.py, mem0_manager.py, mem0_middleware.py - Update environment variables (MEMORI_* -> MEM0_*) - Integrate Mem0 with LangGraph middleware - Add sync connection pool for Mem0 in DBPoolManager - Move checkpoint message prep to config creation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
602 B
Python
28 lines
602 B
Python
#!/usr/bin/env python
|
|
"""删除所有 mem0 相关的表"""
|
|
|
|
import psycopg2
|
|
from utils.settings import CHECKPOINT_DB_URL
|
|
|
|
conn = psycopg2.connect(CHECKPOINT_DB_URL)
|
|
cursor = conn.cursor()
|
|
|
|
# 查找所有 mem0 开头的表
|
|
cursor.execute("""
|
|
SELECT tablename FROM pg_tables
|
|
WHERE schemaname = 'public' AND tablename LIKE 'mem0_%'
|
|
""")
|
|
|
|
tables = cursor.fetchall()
|
|
print('找到的表:', tables)
|
|
|
|
# 删除每个表
|
|
for (table,) in tables:
|
|
cursor.execute(f'DROP TABLE IF EXISTS {table} CASCADE')
|
|
print(f'已删除: {table}')
|
|
|
|
conn.commit()
|
|
cursor.close()
|
|
conn.close()
|
|
print('删除完成')
|