Make home and mem0 dirs configurable so that the service can work on AWS lambda. (#1726)

This commit is contained in:
Max von Hippel
2024-08-20 23:52:37 -07:00
committed by GitHub
parent 515fb86497
commit 2d66c23116

View File

@@ -4,7 +4,7 @@ import uuid
# Set up the directory path
home_dir = os.path.expanduser("~")
mem0_dir = os.path.join(home_dir, ".mem0")
mem0_dir = os.environ.get("MEM0_DIR") or os.path.join(home_dir, ".mem0")
os.makedirs(mem0_dir, exist_ok=True)