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.

Allow overriding config location with `MEMGPT_CONFIG_PATH` (#383)

Sarah Woodersf47247d4b464
diff --git a/docs/config.md b/docs/config.md
index d6f5d1bb8..1a390495d 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -1,5 +1,5 @@
### Configuring the agent
-You can set agent defaults by running `memgpt configure`.
+You can set agent defaults by running `memgpt configure`, which will store config information at `~/.memgpt/config` by default.
The `memgpt run` command supports the following optional flags (if set, will override config defaults):
@@ -13,6 +13,12 @@ The `memgpt run` command supports the following optional flags (if set, will ove
* `--no-verify`: (bool) Bypass message verification (default=False)
* `--yes`/`-y`: (bool) Skip confirmation prompt and use defaults (default=False)
+#### Updating the config location
+You can override the location of the config path by setting the enviornment variable `MEMGPT_CONFIG_PATH`:
+```
+export MEMGPT_CONFIG_PATH=/my/custom/path/config # make sure this is a file, not a directory
+```
+
### Adding Custom Personas/Humans
You can add new human or persona definitions either by providing a file (using the `-f` flag) or text (using the `--text` flag).
diff --git a/memgpt/config.py b/memgpt/config.py
index 30fe53068..4dfe1640a 100644
--- a/memgpt/config.py
+++ b/memgpt/config.py
@@ -228,6 +228,8 @@ class MemGPTConfig:
config_path = os.getenv("MEMGPT_CONFIG_PATH")
else:
config_path = MemGPTConfig.config_path
+
+ assert not os.path.isdir(config_path), f"Config path {config_path} cannot be set to a directory."
return os.path.exists(config_path)
@staticmethod