Skip to content

Memory Server not adding to JSON Array #1481

Description

@bbarrington0099

Describe the bug
Running the server locally with no changes to the repo, have env set to a custom MEMORY_FILE_PATH. I have tried starting the server with the memory.json being both an empty JSON Object and Array. When a new entity is created, it removes the existing structure of the empty file and adds a new entity, then when another entity is created it just adds a new JSON Object so there are 2 JSON Objects in the file but nothing wrapping them so the file is invalid

To Reproduce
Steps to reproduce the behavior:

  1. Have one entity created
  2. Have a second entity created
  3. See that the .json file is errored

Expected behavior
I expect multiple entities to go into and be pulled from a valid JSON Array

Logs
{"type":"entity","name":"Brandon","entityType":"User","observations":["Primary user as provided by himself."]}
{"type":"entity","name":"MCP","entityType":"Self","observations":["This is the self entity for the assistant, created as per server instructions."]}

Additional context
Client created to use OpenAI API, other tools are working as expected, when only one entity is present the Memory tools work as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserver-memoryReference implementation for the Memory MCP server - src/memory

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions