Skip to content

Memory feature throws error when specifying agent.id in librechat.yaml #11511

Description

@hisas32

Description

I'm using an agent created with the Agent Builder, and when I try to use the memory feature by specifying agent.id, I encounter an error. The error log indicates a syntax error in librechat.yaml, but I cannot identify what is wrong with my configuration.
According to the official documentation on Using Predefined Agents, specifying an agent ID should enable memory for that agent. However, this results in an error.

Version

  • LibreChat: 0.8.1-rc2

Configuration

Here is my librechat.yaml configuration:

endpoints:
  bedrock:
    titleModel: "jp.anthropic.claude-haiku-4-5-20251001-v1:0"
    streamRate: 35
    availableRegions:
      - "ap-northeast-1"
  agents:
    recursionLimit: 50
    maxRecursionLimit: 100
    disableBuilder: false

memory:
  agent:
    id: "agent_aEdJgF09y6oJ0USpwNn3u"

Error Details

Error Log

The following error appears in the error log:

"Cannot read properties of undefined (reading 'id')"

Full stack trace from /root/LibreChat/logs/error-2026-01-11.log:

{"level":"error","message":"[handleAbortError] AI response error; aborting request: Cannot read properties of undefined (reading 'id')","stack":"TypeError: Cannot read properties of undefined (reading 'id')\n    at AgentClient.useMemory (/app/api/server/controllers/agents/client.js:552:23)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async AgentClient.buildMessages (/app/api/server/controllers/agents/client.js:452:25)\n    at async AgentClient.sendMessage (/app/api/app/clients/BaseClient.js:647:9)\n    at async AgentController (/app/api/server/controllers/agents/request.js:210:20)\n    at async controller (/app/api/server/routes/agents/chat.js:38:3)","timestamp":"2026-01-11T07:28:28.539Z"}

UI Error

When chatting through the LibreChat UI, the following error message is displayed:

"Something went wrong. Here's the specific error message we encountered: An error occurred while processing your request. Please contact the Admin."

Steps to Reproduce

  1. Create an agent using the Agent Builder
  2. Configure librechat.yaml with the memory.agent.id setting as shown above
  3. Restart LibreChat
  4. Attempt to chat with the agent

Expected Behavior

The memory feature should work with the specified agent ID as described in the documentation.

Actual Behavior

The application throws a TypeError: Cannot read properties of undefined (reading 'id') error, and the chat fails.

Additional Context

I followed the documentation at https://www.librechat.ai/docs/features/memory#using-predefined-agents but the configuration does not work as expected. It appears there may be an issue with how the agent.id is being parsed or accessed in the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions