-
Notifications
You must be signed in to change notification settings - Fork 44.2k
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/weaviate memory #424
Feature/weaviate memory #424
Conversation
…are absent in the latest version of execute_command therefore the corresponding handlers commit_memory, delete_memory and overwrite_memory have been removed also because they assume a memory with a different interface than the proposed one.
I have noticed that the latest commands list in commands.py no longer supports the memory-related command ( |
Thank you so much I was actually working on a similar branch last week! 😃 |
I have now merged the memory strategy from the master branch and added weaviate to the supported providers. I have also added tests for the weaviate integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but needs whitespace fixes.
README.md
Outdated
@@ -185,13 +185,15 @@ Pinecone enables the storage of vast amounts of vector-based memory, allowing fo | |||
2. Choose the `Starter` plan to avoid being charged. | |||
3. Find your API key and region under the default project in the left sidebar. | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert the unrelated whitespace changes
scripts/commands.py
Outdated
@@ -298,4 +298,4 @@ def delete_agent(key): | |||
result = agents.delete_agent(key) | |||
if not result: | |||
return f"Agent {key} does not exist." | |||
return f"Agent {key} deleted." | |||
return f"Agent {key} deleted." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional, but add an extra line feed at the end of file to remove this (-) sign from the diff. I will still approve if you won't
scripts/memory/pinecone.py
Outdated
@@ -1,4 +1,3 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this
scripts/memory/pinecone.py
Outdated
@@ -48,4 +47,4 @@ def get_relevant(self, data, num_relevant=5): | |||
return [str(item['metadata']["raw_text"]) for item in sorted_results] | |||
|
|||
def get_stats(self): | |||
return self.index.describe_index_stats() | |||
return self.index.describe_index_stats() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you removed the final line feed. Just revert
@nponeccop - applied all requests. |
@cs0lar what are your thoughts on adding support for embedded weaviate too as part of this PR? |
@hsm207 Thanks for spotting that. I have added weaviate embedded support now. Please check it out. |
.env.template
Outdated
OPENAI_AZURE_API_BASE=your-base-url-for-azure | ||
OPENAI_AZURE_API_VERSION=api-version-for-azure | ||
OPENAI_AZURE_DEPLOYMENT_ID=deployment-id-for-azure | ||
IMAGE_PROVIDER=dalle | ||
HUGGINGFACE_API_TOKEN= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undo the relocation of the HUGGINGFACE line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! there were also some dupes I have now removed.
Thanks, @nponeccop, I think it's the merging of other PRs. Seems we are almost there. Your help is appreciated in keeping this PR up-to-date 🙏 Almost there, it seems: #424 (comment)
Yup, thanks @nponeccop |
Awesome! I think the PR can be merged 🥳 |
scripts/memory/weaviate.py
Outdated
|
||
def _build_auth_credentials(self, cfg): | ||
if cfg.weaviate_username and cfg.weaviate_password: | ||
return weaviate_auth.AuthClientPassword(cfg.weaviate_username, cfg.weaviate_password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cs0lar this line will throw an error as weaviate_auth
is not defined anymore in this module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return weaviate_auth.AuthClientPassword(cfg.weaviate_username, cfg.weaviate_password) | |
return weaviate.AuthClientPassword(cfg.weaviate_username, cfg.weaviate_password) | |
```@cs0lar this line will throw an error as `weaviate_auth` is not defined anymore in this module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cs0lar I think you missed this change
@cs0lar, I think we need your help again. People on the Auto-GPT Discord are asking for this merge 😂 |
Hi @nponeccop and @richbeales. I think the merge conflict is resolved. Would be awesome if you could review and merge. Thanks 🙏 |
Thanks for reaching out @bobvanluijt - we'll get to this shortly. I'll ping you when ready. |
I think Milvus and Weaviate should also be appended here, right? https://github.com/Significant-Gravitas/Auto-GPT/blob/master/.env.template#L53 Weaviate integration is mentioned in its own section, but Milvus doesn't have that mention and rather than being scathered all around the config, they should all be neatly gathered at the top (imho). |
🎉 thanks all for the help and merge 🎉 Added a minor change here: #1813 Basically, so that people don't have to install the Weaviate client manually. |
…ate-memory Feature/weaviate memory
Background
This change allows the use of different vector-based memories for Auto-GPT as long as the
Memory
interface is implemented. As an example, this change integrates Weaviate as an alternative to Pinecone that can be instantiated locally.Changes
providers
directory which is meant to hold the various memory implementations.scripts/memory.py
file has been moved into theproviders
module and it declaresMemory
as an interface to be implemented.scripts/factory.py
file has been added which declares a factory method for creating the appropriate memory support class. A new environment variable,MEMORY_PROVIDER
allows to configure which provider to use.providers
module.Memory
interface has been added.Test Plan
Added factory tests in
tests/memory_tests.py
Change Safety