You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for memory_type in ("archival", "recall", "metadata"):
if settings.memgpt_pg_uri:
# override with env
setattr(self.config, f"{memory_type}_storage_uri", settings.memgpt_pg_uri)
self.config.save()
I don't understand why this routine is here because it appears to just override any configuration settings entered in by memgpt configure with what's in settings but it never gets initialized with anything other than hardcoded default memgpt_pg_uri of: postgresql+pg8000://memgpt:memgpt@localhost:5432/memgpt.
You can test this by using postgres docker and in set the configuration set the connection string as follows: ? Enter postgres connection string (e.g. postgresql+pg8000://{user}:{password}@{ip}:5432/{database}): postgresql+pg8000://memgpt:memgpt@localhost:8888/memgpt
To verify its written, check the config file: cat ~/.memgpt/config
[archival_storage]
type = postgres
path = /home/john/.memgpt/chroma
uri = postgresql+pg8000://memgpt:memgpt@localhost:8888/memgpt
Run the server with memgpt server and connection will be refused by the server because the connection string will be overwritten with a port of 5432, and then the config file gets saved!
Run: cat ~/.memgpt/config
and you'll see the 5432 has been written in place of 8888.
[archival_storage]
type = postgres
path = /home/john/.memgpt/chroma
uri = postgresql+pg8000://memgpt:memgpt@localhost:5432/memgpt
I tracked it down to the referenced routine, it just seems maybe it's something unfinished?
The text was updated successfully, but these errors were encountered:
Ok, thanks, that helps a lot. I'll have to figure out where those get imported in.. I think I'll work on a change to only do the substitution if those values are set.
uggh.. my solution is a bit more hacky than what it already is. Since tests may rely upon a default being returned by setting.memgpt_pg_uri and I didn't see an easy way to make it NOT return the default, then I added a new property called setting.memgpt_pg_uri_no_default and it only returns a uri if the environment variables are set. Otherwise, it returns None and the config file uri continues to be used and not overwritten.
MemGPT/memgpt/server/server.py
Line 218 in 7e5cf3e
I don't understand why this routine is here because it appears to just override any configuration settings entered in by
memgpt configure
with what's insettings
but it never gets initialized with anything other than hardcoded default memgpt_pg_uri of:postgresql+pg8000://memgpt:memgpt@localhost:5432/memgpt
.You can test this by using postgres docker and in set the configuration set the connection string as follows:
? Enter postgres connection string (e.g. postgresql+pg8000://{user}:{password}@{ip}:5432/{database}): postgresql+pg8000://memgpt:memgpt@localhost:8888/memgpt
To verify its written, check the config file:
cat ~/.memgpt/config
Run the server with
memgpt server
and connection will be refused by the server because the connection string will be overwritten with a port of 5432, and then the config file gets saved!Run:
cat ~/.memgpt/config
and you'll see the 5432 has been written in place of 8888.
I tracked it down to the referenced routine, it just seems maybe it's something unfinished?
The text was updated successfully, but these errors were encountered: