Merged
Size
XL
Change Breakdown
Maintenance55%
Refactor30%
Docs15%
#28234chore(instance-ai): Disable working memory and remove related code (no-changelog)

Working memory disabled and removed across the stack

The Instance AI feature no longer tracks persistent user knowledge across conversations — working memory, its API endpoints, UI panels, tracing infrastructure, and documentation have all been removed.

Working memory let the AI agent remember a user's preferences, frequently used workflows, and instance knowledge across every conversation. It had a structured template covering user context, workflow preferences, active projects, and known issues. The feature was user-scoped, meaning it carried across all threads.

That whole layer is now gone.

The workingMemory.enabled flag is set to false in the Mastra Memory config. The API endpoints for reading and writing memory (GET/PUT /memory/:threadId) have been removed from the controller, along with the corresponding service methods. The InstanceAiUpdateMemoryRequest DTO and workingMemory field on the thread context response have been deleted from api-types.

On the frontend, the memory panel component, its Pinia store, and the brain toggle button in the header are all gone. The debug panel no longer shows a working memory tab.

The tracing infrastructure built around working memory is stripped out entirely. The module (155 lines) is deleted. Synthetic tool trace names for updateWorkingMemory are removed. The internal_state grouping wrapper in LangSmith tracing is gone. The traceWorkingMemoryContext calls that wrapped every agent.stream() invocation in the runtime, orchestration tools, and resumable stream executor are eliminated.

The storage-layer workingMemory column on the resource entity and TypeORM adapter methods are intentionally kept — they implement the Mastra storage interface contract and don't cause problems when the feature is disabled.

This is a significant cleanup: 29 files changed, 1,391 lines removed. The memory system now has fewer tiers and the AI context window is simpler.

View Original GitHub Description

Summary

Disables working memory in instance AI and removes all related infrastructure across the stack.

Working memory is turned off in the Mastra Memory config. The entire tracing layer around it is gone: working-memory-tracing.ts, the internal_state grouping wrapper in LangSmith tracing, isInternalStateTool, synthetic tool trace names for updateWorkingMemory, and traceWorkingMemoryContext calls that wrapped every agent.stream() invocation in the runtime, orchestration tools (delegate, plan-with-agent, data-table-agent, build-workflow-agent), and the resumable stream executor.

On the frontend, the memory panel (InstanceAiMemoryPanel.vue), its Pinia store, the brain toggle button in the header, and the memory API functions are all removed. The debug panel no longer shows a working memory section. The corresponding i18n keys are cleaned up.

On the backend, the GET /memory/:threadId and PUT /memory/:threadId endpoints are removed from the controller along with getWorkingMemory/updateWorkingMemory on the memory service. getThreadContext no longer returns a workingMemory field. The InstanceAiUpdateMemoryRequest DTO and the workingMemory field on InstanceAiThreadContextResponse are removed from api-types.

The "Working Memory" instruction sections are removed from both builder prompt variants.

The storage-layer workingMemory column on the resource entity and the TypeORM adapter methods are intentionally kept, they implement the Mastra storage interface contract and are harmless when the feature is disabled.

Related Linear tickets, Github issues, and Community forum posts

<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/ --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->

Review / Merge checklist

  • PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
  • Docs updated or follow-up ticket created.
  • Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)
© 2026 · via Gitpulse