fix:memory create collection bug

This commit is contained in:
aries_ckt 2025-04-14 21:29:41 +08:00
parent 4c6386ad3f
commit 2991c7e437
2 changed files with 5 additions and 2 deletions

View File

@ -311,7 +311,7 @@ class OceanBaseStore(VectorStoreBase):
def create_collection(self, collection_name: str, **kwargs) -> Any:
"""Create the collection."""
embeddings = self.embedding_function.embed_documents([collection_name])
raise self._create_table_with_index(embeddings)
return self._create_table_with_index(embeddings)
def load_document(self, chunks: List[Chunk]) -> List[str]:
"""Load document in vector database."""

View File

@ -142,7 +142,10 @@ class MultiAgents(BaseComponent, ABC):
).create()
storage_manager = StorageManager.get_instance(self.system_app)
vector_store = storage_manager.create_vector_store(index_name="_agent_memory_")
index_name = "_agent_memory_"
vector_store = storage_manager.create_vector_store(index_name=index_name)
if not vector_store.vector_name_exists():
vector_store.create_collection(collection_name=index_name)
embeddings = EmbeddingFactory.get_instance(self.system_app).create()
short_term_memory = EnhancedShortTermMemory(
embeddings, executor=executor, buffer_size=10