paperclip: add sharedBankName config for cross-agent memory sharing#1589
Open
SeBru1 wants to merge 1 commit into
Open
paperclip: add sharedBankName config for cross-agent memory sharing#1589SeBru1 wants to merge 1 commit into
SeBru1 wants to merge 1 commit into
Conversation
Adds an optional `sharedBankName` string to the paperclip plugin's
instance config. When set, every agent in the company reads/writes
the same Hindsight bank — overriding `bankGranularity` and the
default `paperclip::{companyId}::{agentId}` derivation.
Why
---
The default `bankGranularity: ["company", "agent"]` isolates each
agent's memory. For multi-agent cohorts that need to collaborate on
a shared pool of project context (e.g. a CEO/CTO/Staff/QA/Researcher
team working a single backlog), there's no first-class way to point
them at a single bank without redefining identity.
What
----
- `src/bank.ts`: extend `BankConfig` with `sharedBankName?: string`;
`deriveBankId` returns the trimmed value verbatim when set, falls
through to the existing granularity logic otherwise.
- `src/manifest.ts`: surface `sharedBankName` in `instanceConfigSchema`
so it's configurable from Settings → Plugins → Hindsight Memory.
- `src/worker.ts`: add the field to the internal `PluginConfig` type.
- `tests/plugin.spec.ts`: add unit tests for the override behavior
(trimming, empty/whitespace fallthrough) and an integration-level
test that verifies recall is routed to the shared bank URL when
configured.
- README: document the field and add a "Shared bank for cross-agent
collaboration" section.
Backwards compatible
--------------------
The field is optional. Existing installs (no `sharedBankName` set)
keep the existing `paperclip::{companyId}::{agentId}` derivation
unchanged. All 19 tests pass (3 pre-existing bank tests + 3 new bank
tests + 1 new worker-routing test + the rest of the suite).
Contributor
|
@SeBru1 thanks! Clean PR and the cross-agent collaboration case is legit. LGTM |
Contributor
|
@SeBru1 — could you rename sharedBankName → bankId and add a dynamicBankId: boolean to match the pattern the other plugins use? same behavior, but a user moving between paperclip/ claude-code / openclaw would see the same field names mean the same thing. otherwise the implementation looks clean. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
sharedBankNamestring to thehindsight-integrations/paperclipplugin's instance config. When set, every agent in the company reads/writes the same Hindsight bank — overridingbankGranularityand the defaultpaperclip::{companyId}::{agentId}derivation.This is a small, additive, backwards-compatible change. No behavior changes for any existing install that doesn't set the new field.
Motivation
The current
bankGranularity: [\"company\", \"agent\"]default isolates each agent's memory. That's the right default — memory shouldn't leak across unrelated agents.But for multi-agent cohorts that need to collaborate on a shared pool of project context (e.g. a CEO/CTO/Staff/QA/Researcher team working a single backlog), there's no first-class way to point them at one bank.
Concrete use case: I run a 5-agent Paperclip company where each agent must see decisions, lessons, and project state created by the others. With current granularity, each agent talks to its own bank —
hindsight_recallreturns nothing the agent didn't write itself, and cross-agent compound knowledge never accrues.Workarounds I considered:
bankGranularity: [\"company\"]collapses to a per-company bank — but the bank ID is stillpaperclip::{companyId}, which is fine for a single deployment but not when you want a human-readable bank name shared across companies or instances.The cleanest fix is a tiny optional config override. That's this PR.
What changed
src/bank.ts: extendBankConfigwith optionalsharedBankName;deriveBankIdreturns the trimmed value verbatim when set, otherwise falls through to the existing granularity logic unchanged.src/manifest.ts: addsharedBankNametoinstanceConfigSchemaso it's configurable from Settings → Plugins → Hindsight Memory.src/worker.ts: add the field to the internalPluginConfigtype.tests/plugin.spec.ts: 4 new tests — 3 unit tests for the override semantics (trimming, empty/whitespace fallthrough, normal override) + 1 integration test that verifies recall routes to the shared bank URL.README.md: document the field and add a Shared bank for cross-agent collaboration section.Backwards compatibility
The field is optional. Existing installs without
sharedBankNamekeep the existingpaperclip::{companyId}::{agentId}derivation untouched.Test plan
npm run typecheck— cleannpm test— 19/19 tests pass (15 existing + 4 new)npm run build— clean esbuild outputsharedBankName: \"spool-farm\", recall/retain from all 5 agents now route to the singlespool-farmbank.Notes for review
Happy to adjust naming (
sharedBankNamevsbankNamevsbankOverride), schema placement, or split into smaller commits if preferred. The full change is +89/-8 across 5 files.