When adding a new project using uvx basic-memory project add project-name '~/path/project/memory', the process fails if the project's directory contains a dotenv file (ie. : ~/path/project/.env) with a LOG_LEVEL=debug entry. It seems basic-memory reads this environment variable and expects the value to be uppercase, causing an error. I'm personally encountering this with a Laravel project, but I'm expecting a lot more instance could be found of a dotenv file with this value.
This is problematic especially when using it as MCP in editors like Roo Code's mcp.json, as it seems it will run the uvx command in the root of its project, and it then catches said project's .env, failing to start because of the above.
Steps to Reproduce
- Create a folder with a
.env file (~/path/project/.env)
- Add a line to .env:
LOG_LEVEL=debug
- Add a project :
uvx basic-memory project add project-name '~/path/project/memory'
cd ~/path/project && uvx basic-memory project list should be failing.
- For my Roo Code example, having a
~/path/project/.roo/mcp.json with basic-memory in it will fail if the LOG_LEVEL value is present and lowercase.
Expected Behavior
basic-memory should not be affected by environment variables defined in a project's .env file, especially if they are unrelated to basic-memory's functionality. The project should be added successfully, regardless of the log level value or casing.
What could be done
Make it so basic-memory accepts the debug string regardless of casing.
Prefix BM's environment variables names could be an option too.
When adding a new project using
uvx basic-memory project add project-name '~/path/project/memory', the process fails if the project's directory contains a dotenv file (ie. :~/path/project/.env) with aLOG_LEVEL=debugentry. It seems basic-memory reads this environment variable and expects the value to be uppercase, causing an error. I'm personally encountering this with a Laravel project, but I'm expecting a lot more instance could be found of a dotenv file with this value.This is problematic especially when using it as MCP in editors like Roo Code's
mcp.json, as it seems it will run theuvxcommand in the root of its project, and it then catches said project's.env, failing to start because of the above.Steps to Reproduce
.envfile (~/path/project/.env)LOG_LEVEL=debuguvx basic-memory project add project-name '~/path/project/memory'cd ~/path/project && uvx basic-memory project listshould be failing.~/path/project/.roo/mcp.jsonwith basic-memory in it will fail if the LOG_LEVEL value is present and lowercase.Expected Behavior
basic-memory should not be affected by environment variables defined in a project's .env file, especially if they are unrelated to basic-memory's functionality. The project should be added successfully, regardless of the log level value or casing.
What could be done
Make it so basic-memory accepts the debug string regardless of casing.
Prefix BM's environment variables names could be an option too.