feat(pi-memory-mem0): add agentId support for memory isolation#71
Open
sirusdas wants to merge 2 commits into
Open
feat(pi-memory-mem0): add agentId support for memory isolation#71sirusdas wants to merge 2 commits into
sirusdas wants to merge 2 commits into
Conversation
Add agentId configuration option to pi-memory-mem0 extension to allow memory isolation between different agents or profiles. Changes: - Add agentId to Mem0ExtensionConfig type - Update Mem0Provider interface to accept agentId in opts - Update PlatformProvider to pass agentId in filters - Update OSSProvider to pass agentId in filters - Update Prefetch class to accept agentId - Update createMem0Tools to accept agentId - Update index.ts to load and pass agentId from config - Update README.md to document agentId configuration This allows multiple agents to share the same mem0 server while maintaining separate memory spaces based on agent_id.
Add support for dynamic agent_id selection based on the current working
directory. This allows pi to automatically use the correct agent_id
when working on different projects.
Changes:
- Add resolveAgentId function with project mapping support
- Load project mapping from ~/.pi/agent/mem0-project-mapping.json
- Match current directory against patterns to determine agent_id
- Update README.md to document dynamic agent_id selection
Configuration:
Create ~/.pi/agent/mem0-project-mapping.json with project patterns:
{
"mappings": [
{
"pattern": "*farmneed*|*hrms*",
"agentId": "hermes-fhrms",
"description": "Farmneed HRMS project"
},
{
"pattern": "*",
"agentId": "pi",
"description": "Default pi agent"
}
]
}
d1853ac to
79b4720
Compare
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
This PR adds configuration support to the pi-memory-mem0 extension, allowing memory isolation between different agents or profiles.
Changes
Configuration
Add the following to your :
Usage
Once configured, pi will:
This allows pi to have its own isolated memory space while sharing the same mem0 server as other agents.
Testing
The changes have been tested and verified to: