From 9fbd0882e49af2f9229d1ba32e5df2c2fc1a2c2e Mon Sep 17 00:00:00 2001 From: Gijs Segerink Date: Mon, 6 Jan 2025 09:18:58 +0100 Subject: [PATCH] Store LanceDB on Storage Account --- graphrag/config/defaults.py | 3 +++ graphrag/vector_stores/lancedb.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/graphrag/config/defaults.py b/graphrag/config/defaults.py index 73f27dbe33..bc374ed5cf 100644 --- a/graphrag/config/defaults.py +++ b/graphrag/config/defaults.py @@ -96,6 +96,9 @@ type: {VectorStoreType.LanceDB.value} db_uri: '{(Path(STORAGE_BASE_DIR) / "lancedb")!s}' container_name: default + # storage_options: # https://lancedb.github.io/lancedb/guides/storage/#azure-blob-storage + # account_name: + # account_key: overwrite: true\ """ diff --git a/graphrag/vector_stores/lancedb.py b/graphrag/vector_stores/lancedb.py index b334f4753b..bbfc196737 100644 --- a/graphrag/vector_stores/lancedb.py +++ b/graphrag/vector_stores/lancedb.py @@ -26,7 +26,11 @@ def __init__(self, **kwargs: Any) -> None: def connect(self, **kwargs: Any) -> Any: """Connect to the vector storage.""" - self.db_connection = lancedb.connect(kwargs["db_uri"]) + self.db_connection = lancedb.connect( + uri=kwargs.get("db_uri"), + storage_options=kwargs.get("storage_options") + ) + if ( self.collection_name and self.collection_name in self.db_connection.table_names()