Skip to content

Feature: Extensible core memory file registry #501

@chubes4

Description

@chubes4

Problem

Core memory files (SOUL.md, USER.md, MEMORY.md) are hardcoded in two places:

  1. MemoryFileRegistry in bootstrap.php — registers the three files at priorities 10, 20, 30
  2. MemoryFilesSelector / PipelineMemoryFiles React component — hardcodes EXCLUDED_FILES = ['SOUL.md', 'USER.md', 'MEMORY.md'] to hide them from the picker

This means plugins can't register their own core memory files that get treated as first-class citizens (always injected, excluded from the optional picker).

Proposed

Make the core memory file registry dynamic so plugins can register additional always-on memory files:

PHP side

  • MemoryFileRegistry::register() already exists and works — plugins can call it today
  • Expose a filter or action at a well-known hook so plugins register their files cleanly
  • Add a method like MemoryFileRegistry::get_core_filenames() that returns the list of always-injected files

JS/React side

  • Instead of hardcoding EXCLUDED_FILES, fetch the core file list from the REST API (or from a localized script variable)
  • New endpoint or extend existing: GET /files/agent could return { files: [...], core_files: ['SOUL.md', ...] }
  • MemoryFilesSelector excludes whatever the backend says is core, not a hardcoded array

Use cases

  • A plugin registers PLUGIN_CONTEXT.md as a core memory file at priority 25
  • It always injects into AI calls, appears in the "core" section, and is excluded from the pipeline/flow picker
  • If the plugin is deactivated, the file stops injecting automatically

Related

  • Feature: Flow-scoped memory files #471 (flow-scoped memory files) — introduced the shared MemoryFilesSelector with the hardcoded exclusion
  • Core directive: CoreMemoryFilesDirective (priority 20)
  • Registry: MemoryFileRegistry in inc/Engine/AI/MemoryFileRegistry.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions