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

[Feature] Add memory properties to StrayCat #870

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

valentimarco
Copy link
Collaborator

Description

Related to issue #818, point 3

With this PR, I added new properties to StrayCat and some types (YES):

  1. user_message(self) -> str, return the query of the user
  2. memory_vector_client(self) -> QdrantClient, return the QdrantClient (Is is useful? personally yes, if i want to do some strange stuff...)
  3. <name collection>_memory(self) -> VectorMemoryCollection, return a VectorMemoryCollection instance of the selected memory. Usuful to search, add or destroy vectors in a specific collection.

Nothing new is added, "old piero" did a great job when designing the VectorMemory!

To search points use recall_memories_from_embedding(embedding, metadata=None, k=5, threshold=None ).

Maybe #848 should be method of VectorMemoryCollection??

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@zAlweNy26
Copy link
Member

zAlweNy26 commented Jul 9, 2024

What if in the future we want to give the possibility to add other collections to the memory?
I'd suggest something like:

@property
def memory(self):
    return CheshireCat().memory.vectors

@valentimarco
Copy link
Collaborator Author

valentimarco commented Jul 9, 2024

What if in the future we want to give the possibility to add other collections to the memory? I'd suggest something like:

@property
def memory(self):
    return CheshireCat().memory.vectors

Great question! I only thought about the 3 collections...
The name should be vector_memory

@property
def vector_memory(self):
   return CheshireCat().memory.vectors

So you have:

  1. direct access to the main collections.
  2. direct access to the VectorMemory.
    At the moment you can access it like so : cat.memory.vectors.<something>.

@pieroit
Copy link
Member

pieroit commented Jul 9, 2024

Sounds good @valentimarco, will review in the next days thanks :D

Nothing new is added, "old piero" did a great job when designing the VectorMemory!

Old?
No U
plx

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

Successfully merging this pull request may close these issues.

3 participants