You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
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:
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.
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:
Error Handling: Ensure to add appropriate error handling, especially when interacting with the database and when generating embeddings.
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.
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!
The text was updated successfully, but these errors were encountered:
emrgnt-cmplxty
changed the title
Implement Experimental MemoryEmbeddings
Implement Experimental MemoryEmbeddingJun 21, 2023
emrgnt-cmplxty
changed the title
Implement Experimental MemoryEmbedding
Implement Experimental ConversationMemoryEmbeddingJun 28, 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 fromSymbolEmbeddingHandler
.MemoryEmbeddingHandler
will use an instance ofAutomataAgentDatabase
and anEmbeddingProvider
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:get_embedding(self, session_id: str) -> Any
: This method fetches a conversation from the database using the providedsession_id
, converts it into a string, and generates an embedding using theEmbeddingProvider
. The method then returns this embedding.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 ourAutomataAgentDatabase
class to support the storing and retrieval of conversation embeddings.Points to consider:
Error Handling: Ensure to add appropriate error handling, especially when interacting with the database and when generating embeddings.
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.
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 theAutomataAgentDatabase
.Tasks:
MemoryEmbeddingHandler
get_embedding
andupdate_embedding
methods inMemoryEmbeddingHandler
.AutomataAgentDatabase
to support conversation embeddings.MemoryEmbeddingHandler
.MemoryEmbeddingHandler
andAutomataAgentDatabase
.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!
The text was updated successfully, but these errors were encountered: