Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fixed merge conflicts

cs0lar2678a5a74b5f
diff --cc .env.template
index f9d1ec103a,b8140dd84c..d137223649
--- a/.env.template
+++ b/.env.template
@@@ -77,27 -77,13 +77,34 @@@ REDIS_PASSWORD
WIPE_REDIS_ON_START=False
MEMORY_INDEX=auto-gpt
+### WEAVIATE
+# MEMORY_BACKEND - Use 'weaviate' to use Weaviate vector storage
+# WEAVIATE_HOST - Weaviate host IP
+# WEAVIATE_PORT - Weaviate host port
+# WEAVIATE_PROTOCOL - Weaviate host protocol (e.g. 'http')
+# USE_WEAVIATE_EMBEDDED - Whether to use Embedded Weaviate
+# WEAVIATE_EMBEDDED_PATH - File system path were to persist data when running Embedded Weaviate
+# WEAVIATE_USERNAME - Weaviate username
+# WEAVIATE_PASSWORD - Weaviate password
+# WEAVIATE_API_KEY - Weaviate API key if using API-key-based authentication
+# MEMORY_INDEX - Name of index to create in Weaviate
+WEAVIATE_HOST="127.0.0.1"
+WEAVIATE_PORT=8080
+WEAVIATE_PROTOCOL="http"
+USE_WEAVIATE_EMBEDDED=False
+WEAVIATE_EMBEDDED_PATH="/home/me/.local/share/weaviate"
+WEAVIATE_USERNAME=
+WEAVIATE_PASSWORD=
+WEAVIATE_API_KEY=
+MEMORY_INDEX=AutoGpt
+
+ ### MILVUS
+ # MILVUS_ADDR - Milvus remote address (e.g. localhost:19530)
+ # MILVUS_COLLECTION - Milvus collection,
+ # change it if you want to start a new memory and retain the old memory.
+ MILVUS_ADDR=your-milvus-cluster-host-port
+ MILVUS_COLLECTION=autogpt
+
################################################################################
### IMAGE GENERATION PROVIDER
################################################################################
diff --cc autogpt/config/config.py
index 7629910eac,667c817820..e9176342a8
--- a/autogpt/config/config.py
+++ b/autogpt/config/config.py
@@@ -62,16 -62,10 +62,20 @@@ class Config(metaclass=Singleton)
self.pinecone_api_key = os.getenv("PINECONE_API_KEY")
self.pinecone_region = os.getenv("PINECONE_ENV")
+ self.weaviate_host = os.getenv("WEAVIATE_HOST")
+ self.weaviate_port = os.getenv("WEAVIATE_PORT")
+ self.weaviate_protocol = os.getenv("WEAVIATE_PROTOCOL", "http")
+ self.weaviate_username = os.getenv("WEAVIATE_USERNAME", None)
+ self.weaviate_password = os.getenv("WEAVIATE_PASSWORD", None)
+ self.weaviate_scopes = os.getenv("WEAVIATE_SCOPES", None)
+ self.weaviate_embedded_path = os.getenv("WEAVIATE_EMBEDDED_PATH")
+ self.weaviate_api_key = os.getenv("WEAVIATE_API_KEY", None)
+ self.use_weaviate_embedded = os.getenv("USE_WEAVIATE_EMBEDDED", "False") == "True"
+
+ # milvus configuration, e.g., localhost:19530.
+ self.milvus_addr = os.getenv("MILVUS_ADDR", "localhost:19530")
+ self.milvus_collection = os.getenv("MILVUS_COLLECTION", "autogpt")
+
self.image_provider = os.getenv("IMAGE_PROVIDER")
self.huggingface_api_token = os.getenv("HUGGINGFACE_API_TOKEN")
diff --cc autogpt/memory/__init__.py
index 7b545ea359,670efda166..7caa0d54ad
--- a/autogpt/memory/__init__.py
+++ b/autogpt/memory/__init__.py
@@@ -21,12 -21,12 +21,18 @@@ except ImportError
print("Pinecone not installed. Skipping import.")
PineconeMemory = None
+try:
+ from memory.weaviate import WeaviateMemory
+except ImportError:
+ print("Weaviate not installed. Skipping import.")
+ WeaviateMemory = None
+
+ try:
+ from memory.milvus import MilvusMemory
+ except ImportError:
+ print("pymilvus not installed. Skipping import.")
+ MilvusMemory = None
+
def get_memory(cfg, init=False):
memory = None
@@@ -48,15 -48,14 +54,21 @@@
)
else:
memory = RedisMemory(cfg)
+ elif cfg.memory_backend == "weaviate":
+ if not WeaviateMemory:
+ print("Error: Weaviate is not installed. Please install weaviate-client to"
+ " use Weaviate as a memory backend.")
+ else:
+ memory = WeaviateMemory(cfg)
+
elif cfg.memory_backend == "no_memory":
memory = NoMemory(cfg)
+ elif cfg.memory_backend == "milvus":
+ if not MilvusMemory:
+ print("Error: Milvus sdk is not installed."
+ "Please install pymilvus to use Milvus as memory backend.")
+ else:
+ memory = MilvusMemory(cfg)
if memory is None:
memory = LocalCache(cfg)
@@@ -69,4 -68,4 +81,4 @@@ def get_supported_memory_backends()
return supported_memory
- __all__ = ["get_memory", "LocalCache", "RedisMemory", "PineconeMemory", "WeaviateMemory", "NoMemory"]
-__all__ = ["get_memory", "LocalCache", "RedisMemory", "PineconeMemory", "NoMemory", "MilvusMemory"]
++__all__ = ["get_memory", "LocalCache", "RedisMemory", "PineconeMemory", "WeaviateMemory", "MilvusMemory", "NoMemory"]