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

[MRG] clean chromadb and add manage api for lancedb memory #269

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

leeeizhang
Copy link
Collaborator

@leeeizhang leeeizhang commented Nov 19, 2024

Closes #266

list all data in a memory table (only list the key, not all raw data)
from mle.utils import LanceDBMemory
memory = LanceDBMemory("./")
memory.add("hello world", metadata={"file": "/path/to/file"})

print(memory.list_all_keys())
print(memory.get(record_id='xxx'))
provide a CLI interface to add/remove a file from the memory
from mle.utils import LanceDBMemory
memory = LanceDBMemory("./")

memory.get_by_metadata(key="file", value="/path/to/file")
memory.delete_by_metadata(key="file", value="/path/to/file")

Before submitting this PR, please make sure you have:

  • confirmed all checks still pass OR confirm CI build passes.
  • verified that any code or assets from external sources are properly credited in comments and/or in
    the credit file.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Nov 19, 2024
@leeeizhang leeeizhang changed the title [WIP] clean chromadb and add more lancedb api [MRG] clean chromadb and add more lancedb api Nov 19, 2024
@leeeizhang leeeizhang changed the title [MRG] clean chromadb and add more lancedb api [MRG] clean chromadb and add manage api for lancedb memory Nov 19, 2024
Copy link
Member

@huangyz0918 huangyz0918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Looks good!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 19, 2024
@huangyz0918 huangyz0918 merged commit ea7393b into MLSysOps:main Nov 19, 2024
3 checks passed
@huangyz0918
Copy link
Member

Cloud you add a set of new CLI commands, called mle memory which provides memory CRUD?

  • mle memory --add <file/or dir>
  • mle memory --rm <file_key>: right now the file key is the absolute file path when saving, can the code will be divided into several chunks, --rm should remove all chunks with the same file name.
  • mle memory --update <file_key>: just remove all related chunks and add the file again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add manage API for the memory
2 participants