reset_memory.py 462 B

12345678910111213141516
  1. # reset_memory.py
  2. import sys
  3. import requests
  4. base = "http://192.168.0.200:8001/api/v1"
  5. mem0_base = "http://192.168.0.200:8420"
  6. name = sys.argv[1]
  7. requests.delete(f"{base}/collections/{name}")
  8. requests.post(f"{base}/collections", json={"name": name})
  9. print(f"collection reset: {name}")
  10. # Bounce the mem0 server so it re-acquires the fresh collection
  11. import subprocess
  12. subprocess.run(["docker", "compose", "restart", "mem0server"])
  13. print("mem0server restarted")