diff --git a/src/memory/README.md b/src/memory/README.md index 3fd59bbd79..777a3e21e1 100644 --- a/src/memory/README.md +++ b/src/memory/README.md @@ -180,7 +180,7 @@ The server can be configured using the following environment variables: } ``` -- `MEMORY_FILE_PATH`: Path to the memory storage JSON file (default: `memory.json` in the server directory) +- `MEMORY_FILE_PATH`: Path to the memory storage JSON file (default: `memory.json` in the current working directory) # VS Code Installation Instructions diff --git a/src/memory/index.ts b/src/memory/index.ts index 4590a1db6f..0fd9604996 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -11,7 +11,7 @@ import path from 'path'; import { fileURLToPath } from 'url'; // Define memory file path using environment variable with fallback -const defaultMemoryPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'memory.json'); +const defaultMemoryPath = path.join(process.cwd(), 'memory.json'); // If MEMORY_FILE_PATH is just a filename, put it in the same directory as the script const MEMORY_FILE_PATH = process.env.MEMORY_FILE_PATH