Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Implement Experimental ConversationMemoryEmbedding #25

Open
5 tasks
emrgnt-cmplxty opened this issue Jun 21, 2023 · 0 comments
Open
5 tasks

Implement Experimental ConversationMemoryEmbedding #25

emrgnt-cmplxty opened this issue Jun 21, 2023 · 0 comments

Comments

@emrgnt-cmplxty
Copy link
Owner

emrgnt-cmplxty commented Jun 21, 2023

Issue:

In order to provide a more interactive and context-aware agent experience, we should integrate "MemoryEmbedding" functionality. The main idea behind this feature is to vectorize each conversation using our pre-existing embedding providers and store it into a relevant database. This would effectively create a "memory" for the system where past conversations are represented as vectors (embeddings), and can be utilized for future interactions.

If used correctly, these memories could help the system draw more context from previous interactions and bring the system closer to self-improvement.

Implementation:

The first step might be to create a new class MemoryEmbeddingHandler that inherits from SymbolEmbeddingHandler. MemoryEmbeddingHandler will use an instance of AutomataAgentDatabase and an EmbeddingProvider to vectorize a conversation and store it in the database. I say might be because it is a bit strange for the MemoryEmbeddingHandler to inherit from the SymbolEmbeddingHandler when these memories do not correspond to symbols. This seems to indicate that we want to re-think the inheritance structure in embedding_types.

The MemoryEmbeddingHandler class should at minimum contain the following methods:

  1. get_embedding(self, session_id: str) -> Any: This method fetches a conversation from the database using the provided session_id, converts it into a string, and generates an embedding using the EmbeddingProvider. The method then returns this embedding.

  2. update_embedding(self, session_id: str, new_message: OpenAIChatMessage) -> None: This method adds a new message to a conversation in the database and updates the corresponding conversation embedding.

We can use our existing embedding providers such as OpenAIEmbedding for this task. In addition to this, we may need to update our AutomataAgentDatabase class to support the storing and retrieval of conversation embeddings.

Points to consider:

  1. Error Handling: Ensure to add appropriate error handling, especially when interacting with the database and when generating embeddings.

  2. Performance: We should consider how the system will perform as the number of conversations grows. It might be useful to think about how to periodically clean up old conversations from the database if they are no longer needed, or consider using a more scalable storage solution if necessary.

  3. Testing: Thorough testing should be performed to ensure the system's performance and reliability, especially since this is an experimental feature. We need to test both the MemoryEmbeddingHandler functionality and the changes made to the AutomataAgentDatabase.

Tasks:

  • Create a new class MemoryEmbeddingHandler
  • Implement get_embedding and update_embedding methods in MemoryEmbeddingHandler.
  • Update AutomataAgentDatabase to support conversation embeddings.
  • Implement unit tests for MemoryEmbeddingHandler.
  • Implement integration tests for MemoryEmbeddingHandler and AutomataAgentDatabase.

For further inspiration, we can investigate how auto-gpt is using memories here.

As always, don't hesitate to ask if you have any questions or need further clarification. Your contributions to this project are highly valued!

@emrgnt-cmplxty emrgnt-cmplxty changed the title Implement Experimental MemoryEmbeddings Implement Experimental MemoryEmbedding Jun 21, 2023
@emrgnt-cmplxty emrgnt-cmplxty changed the title Implement Experimental MemoryEmbedding Implement Experimental ConversationMemoryEmbedding Jun 28, 2023
emrgnt-cmplxty added a commit that referenced this issue Aug 28, 2023
…l-scripts

Feature/add cleaned up eval scripts
Huntemall pushed a commit to Huntemall/automata-dev that referenced this issue Oct 30, 2023
Huntemall pushed a commit to Huntemall/automata-dev that referenced this issue Oct 30, 2023
…symbol-search-tool

revive symbol search tool
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant