feat: Single-DB Multi-Agent Isolation with Shared Memory Support#96
Open
witplay wants to merge 2 commits into
Open
feat: Single-DB Multi-Agent Isolation with Shared Memory Support#96witplay wants to merge 2 commits into
witplay wants to merge 2 commits into
Conversation
added 2 commits
May 27, 2026 03:20
- Add 'agent_id' column to SQLite store for logical isolation.
- Logic: instruction/persona types -> 'shared' (global), episodic -> '{profile}' (private).
- Update Hermes Plugin to prefix session keys with 'agent:{profile}:'.
- Update Gateway Recall to include 'prependContext' (L1 memories) in response.
- Implement agent identity filtering in FTS and Vector search.
- Includes automatic migration logic for legacy data.
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.
Description | 描述
This PR implements Single-DB Multi-Agent Isolation with a Shared Memory area, solving the data mixing issue in multi-profile setups (Issue #31347).
💡 Core Design
Instead of using multiple databases (heavy), we use a single SQLite database with an
agent_idcolumn:instructionandpersonatypes are marked asshared. All profiles (default, xiaoxiao, zhi, etc.) share user profile and global rules.episodictypes are strictly isolated byagent:{profile}.defaultprofile).📂 Modified Files
hermes-plugin/...: Prefix session keys withagent:{profile}:.src/core/store/sqlite.ts: Addagent_idcolumn, implement shared/private logic, filter FTS/Vector search.src/core/hooks/auto-recall.ts: ParsesessionKeyto passagentId.src/gateway/server.ts: IncludeprependContext(L1 memories) in recall response.🛡️ Benefits
Related Issue | 关联 Issue
Related to #31347
Change Type | 修改类型
Self-test Checklist | 自测清单
Additional Notes | 其他说明
This approach is lightweight compared to the proposed multi-DB solution and works perfectly with SQLite's local architecture.