Multi-environment bank strategies: shared banks across integration types
Use Case
I run two environments against the same project — Claude Code for implementation, and a separate Claude-based environment for research and design. Both need long-term memory over the same domain, but they produce different content: one generates code decisions, the other generates design rationale.
The Claude Code plugin's dynamicBankId (#651) handles isolation well. The harder problem is intentional sharing — when two environments should read from and write to the same bank with different retention patterns.
Problem Statement
When multiple environments write to the same bank, three tensions emerge:
-
Cross-environment feedback loops. #360's fix addressed self-reinforcement via tag stripping before retain. But cross-environment reinforcement is the same risk at a different layer — Environment A recalls what B retained, re-retains a derivative. Tag stripping doesn't help because the content isn't tagged as injected recall.
-
Retention cadence collision. The chunked retention model from #451 assumes a single writer. Two environments retaining at different cadences produce unpredictable interleaving — duplicate extraction on overlap, potential gaps between windows.
-
No provenance on memories. A bank is symmetric — anything that connects can recall and retain equally. In practice, an implementation environment produces reliable facts about what was built; a research environment produces reliable facts about why. Flattening both through the same extraction pipeline loses that signal.
How This Feature Would Help
Practitioners running specialized agents could share context without duplicate accumulation, feedback loops, or provenance loss. This seems likely to grow more relevant as the integration surface expands — Claude Code, OpenClaw, and MCP are three write paths into the same bank infrastructure.
Proposed Solution
Directions that might be worth exploring:
- Retain-source metadata: Memories carry which integration produced them, enabling source-aware recall filtering
- Bank connection roles: An environment connects as retain-only, recall-only, or full — reducing cross-write risk for asymmetric setups
- Bank-level dedup: Convergence check when multiple sources retain to the same bank, extending what #360 does at the integration level
Alternatives Considered
Current workaround: separate banks per environment, manual cross-pollination via export/import. Works but loses real-time recall and scales poorly.
Priority
Important - affects my workflow
Additional Context
dynamicBankGranularity handles single-environment isolation well. This is about the next layer — when isolation isn't what you want. #360, #451, and #611 touch adjacent edges but the cross-environment coordination question hasn't surfaced yet.
- [x] I would be willing to contribute this feature
This would be very powerful: central knowledge based, shared amongst agents. An AI hive mind :)
all the integrations writes both tags and document metadata so you can just pinpoint to the same bank - there's nothing to do here - closing
Thanks for the triaging @nicoloboschi ! If I read correctly, the feature request above mentioned
with different retention patterns.
I guess that's a niche case, and is not something I need personally at the moment, just thought it might be useful to flag for reference if this request comes up again from others.
@jucor Coming back to this because your follow-up turned out to be the right read — "different retention patterns" was the real core of what I was asking for, and I've spent the months since finding out just how deep that clause goes.
Running the two-environment setup since March, the surprise was that the hard problem isn't shared storage at all — tags and metadata solve "point both environments at the same bank," as nicoloboschi said. The problem is that the two environments produce content with completely different consumption shapes. Implementation decisions get read back within days or never. Design rationale gets read back months later, usually at exactly the moment nobody remembers it exists. A retention policy written in terms of time (TTL, decay windows) rots either way, because time isn't what distinguishes them — whether anything ever consumes the memory is.
So what I've been building and testing on my own setup: each stored decision carries a condition, written at the moment of storage, for what "this got used" would look like — and a separate check that reads the consuming side's state to see whether it ever happened. Stored-and-used versus stored-and-orphaned become visibly different states instead of both counting as "remembered."
Testing it the slow way, deliberately: predictions written down and hashed before observing anything, a planted control entry with known ground truth, and a re-check scheduled after weeks of unrelated work. The reason for that last part is the finding itself — a memory convention that only works while someone remembers to maintain it is exactly the failure I'm trying to measure, so the test isn't allowed to depend on the tester's memory either. One person, two environments — small n, so I hold the claims accordingly.
On your "AI hive mind" note: I think shared banks make this sharper, not easier. Every agent reading a shared bank is a different consumer with a different decay curve, so the interesting layer isn't more storage — it's whatever decides what got used and what just accumulated.
Curious whether you've run into other projects treating retention as a consumption-evidence problem rather than a time problem — that's the framing I've failed to find much prior art for, and I'd genuinely value pointers or pushback if you have either.
Ooh, very interesting reframing of what's needed for the hive mind indeed. You make a convincing arguments why different retention patterns seems needed for that!