Skip to content

Enabled Shared Harness Memory#45

Merged
MinuraPunchihewa merged 30 commits into
stagingfrom
feature/shared_memory
Jun 20, 2026
Merged

Enabled Shared Harness Memory#45
MinuraPunchihewa merged 30 commits into
stagingfrom
feature/shared_memory

Conversation

@MinuraPunchihewa

@MinuraPunchihewa MinuraPunchihewa commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This PR enables shared memory across harnesses.

The core concept for enabling shared memory across harnesses is as follows:

  • The Anton Hippocampus will be treated as the source of truth. This means that there are three canonical slots (files) involved (defined in the registry module).
  • Each harness will follow two integration rules:
    1. Direct mapping when possible: 1:1 file ↔ canonical file via symlink.
    2. Prompt injection for extras: when a harness reads more than it writes (Anton's memory stores more context), inject read-only canonical content via system prompt.

Each harness will need to define its own memory adapter. For the most part, this only requires specifying the following:

  • RUNTIME_SYMLINKS: the direct mapping between the harness's memory files and the canonical slots. This is used to create the symlinks in the harness's memory directory.
  • PROMPT_INJECT_SLOTS: the slots that will be injected into the system prompt. This is used to inject the read-only canonical content into the system prompt.

The Symlinks will be created automatically based on the given definitions. The prompt, however, will need to be injected within each harness.

Project memory is also injected into the system prompt as part of the above.

As a result of the above changes, the execution flow of the API endpoints has changed as follows:
Previously, since each harness maintained it's own set of files for memory, UI reads and writes had to go through the harness. However, now that a shared set of canonical files are available, these operations are simpler and can act directly on the files.

The API contract has also been updated to a cleaner form that does not rely on any file or project paths. The corresponding UI updates have been made here: mindsdb/cowork#176.

@MinuraPunchihewa MinuraPunchihewa force-pushed the feature/shared_memory branch 2 times, most recently from d282b9d to b837f9c Compare June 16, 2026 19:35
@MinuraPunchihewa MinuraPunchihewa marked this pull request as ready for review June 16, 2026 20:50
MinuraPunchihewa and others added 2 commits June 17, 2026 13:00
Creating a symlink on Windows requires Administrator or Developer Mode and
otherwise raises OSError (WinError 1314), which would crash memory layout
setup. _ensure_symlink now catches that and falls back to a one-time copy
so the app still starts, logging a clear warning that this harness's
memory will NOT be shared on such a platform (enable Developer Mode for
sharing). POSIX behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@torrmal torrmal changed the base branch from main to staging June 18, 2026 05:58
Comment thread tests/test_memory_runtime.py Outdated
)(),
)

context = HermesMemoryAdapter().build_prompt_context()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line fails when I run it locally,
Looks like tests are not run on staging (should be enabled in CI)

@MinuraPunchihewa

Copy link
Copy Markdown
Collaborator Author

@ea-rus I have fixed the failing test. I will create a separate PR to ensure that the workflows (and tests) run when a PR is created.

@MinuraPunchihewa

Copy link
Copy Markdown
Collaborator Author

@ea-rus Added another PR here to run tests via a workflow:
#74

@MinuraPunchihewa MinuraPunchihewa merged commit 833bd9f into staging Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants