-
Notifications
You must be signed in to change notification settings - Fork 375
Fix Mem0 plugin to work with v2 API + add mem0 Open Source option #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: JeremyKPark <[email protected]>
Signed-off-by: JeremyKPark <[email protected]>
/ok to test |
@yczhang-nv, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
/ok to test fe7c551 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to the mem0_editor
look great! I have a few questions/recommendations about the memory_local
implementation. I'm wondering if we can generalize further by using the Builder
to work with any embedder and LLM supported by the toolkit.
vec_store_collection_name: str = "DefaultAIQCollectionNew" | ||
vec_store_url: str = "http://localhost:19530" # Default Local Milvus URL, change if needed | ||
vec_store_embedding_model_dims: int = 1024 # Updated to match the actual embedding dimensions | ||
llm_provider: str = "ollama" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would these work only for Ollama
models? I'm wondering if we can abstract this further to use any LLM provider supported by the NeMo Agent Toolkit.
llm_temperature: float = 0.0 | ||
llm_max_tokens: int = 2000 | ||
llm_base_url: str = "http://localhost:11434" # Default Ollama URL, change if needed | ||
embedder_provider: str = "ollama" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wondering we can we use the embedder
interface in the toolkit to support any embedding model supported by the toolkit. If we can generalize to more than Ollama, it would be incredibly valuable
Think it should yes. A local NIM implementation of LLMs and embedder should be achievable too, and would be useful for the upcoming spark release. I did attempt this on some older RTX hardware, but was facing some challenges and just stuck with Ollama, but I feel like if I had a spark it might just work. It would be good to have a version as well, that is setup for models on build.nvidia.com, for those without hardware that still want to experiment with their own models. |
Lmk if you need anything from me to move this forward. I've been distracted with other projects but it would be great to have some street cred contributing to Nvidia AI agents :) |
Description
The current version of the Mem0 plugin located in the packages/aiqtoolkit_mem0ai folder was built for Mem0 v1 API, and some commands have been depreciated in Mem0's V2 API. This prevents it from working correctly. This PR proposes changes to the mem0_editor file, needed to support Mem0 v2 API.
Additionally, we have added a plugin function in a separate file to support a local installation of Mem0, using Ollama and other local services for local development and testing. The cloud version Mem0 plugin file remains unmodified, so developers can choose the best option for them, if they need to switch to a cloud Mem0 version down the road.
More testing should be done with the cloud version (using memory.py), as I have not tested it extensively with these changes. Also mem0_editor.py could be reduced to have less verbose commenting and it may not need all of the field validation provided.
If you wish to test the local version, I have provided a config file here: https://github.com/jeremykpark/aiq-mem0ai-config-samples/tree/main/sample_configs
Closes #384
By Submitting this PR I confirm: