Skip to content
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

python sdk update memory bug #1917

Closed
YZF-Myself opened this issue Sep 27, 2024 · 5 comments
Closed

python sdk update memory bug #1917

YZF-Myself opened this issue Sep 27, 2024 · 5 comments

Comments

@YZF-Myself
Copy link

🐛 Describe the bug

def update(self, memory_id, data):
    """
    Update a memory by ID.

    Args:
        memory_id (str): ID of the memory to update.
        data (dict): Data to update the memory with.

    Returns:
        dict: Updated memory.
    """
    capture_event("mem0.update", self, {"memory_id": memory_id})
    existing_embeddings = { data: self.embedding_model.embed(data) }  # add existing_embeddings 
    self._update_memory(memory_id, data, existing_embeddings)
    return {"message": "Memory updated successfully!"}
@YZF-Myself
Copy link
Author

def _update_memory(self, memory_id, data, existing_embeddings, metadata=None):

so, need add existing_embeddings in def update(self, memory_id, data)

parshvadaftari added a commit to parshvadaftari/mem0 that referenced this issue Sep 27, 2024
@parshvadaftari
Copy link
Contributor

@YZF-Myself I have raised a PR for this issue.

@parshvadaftari
Copy link
Contributor

@YZF-Myself The issue is solved with the PR #1939 you can check out the latest commit.

@YZF-Myself
Copy link
Author

ok, I get it.

@Dev-Khant
Copy link
Collaborator

Closing this issue as it has been fixed. Please feel free to open again if same problem occurs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants