Skip to content

Commit 2991c7e

Browse files
committed
fix:memory create collection bug
1 parent 4c6386a commit 2991c7e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/oceanbase_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def _create_table_with_index(self, embeddings: list) -> None:
311311
def create_collection(self, collection_name: str, **kwargs) -> Any:
312312
"""Create the collection."""
313313
embeddings = self.embedding_function.embed_documents([collection_name])
314-
raise self._create_table_with_index(embeddings)
314+
return self._create_table_with_index(embeddings)
315315

316316
def load_document(self, chunks: List[Chunk]) -> List[str]:
317317
"""Load document in vector database."""

packages/dbgpt-serve/src/dbgpt_serve/agent/agents/controller.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ def get_or_build_agent_memory(self, conv_id: str, dbgpts_name: str) -> AgentMemo
142142
).create()
143143

144144
storage_manager = StorageManager.get_instance(self.system_app)
145-
vector_store = storage_manager.create_vector_store(index_name="_agent_memory_")
145+
index_name = "_agent_memory_"
146+
vector_store = storage_manager.create_vector_store(index_name=index_name)
147+
if not vector_store.vector_name_exists():
148+
vector_store.create_collection(collection_name=index_name)
146149
embeddings = EmbeddingFactory.get_instance(self.system_app).create()
147150
short_term_memory = EnhancedShortTermMemory(
148151
embeddings, executor=executor, buffer_size=10

0 commit comments

Comments
 (0)