shibing624 / agentica

Agentica: Build Multi-Agent Workflow with 10 lines code.
Apache License 2.0
62 stars 6 forks source link

Fix "KnowledgeBase.load()" recreates database regardless of param "recreate" #7

Closed GuanYixuan closed 1 month ago

GuanYixuan commented 1 month ago

The method KnowledgeBase.load now recreates the vector database (and discards contents) regardless of the recreate parameter, which does not follow its signature:

def load(self, recreate: bool = False, upsert: bool = False, skip_existing: bool = True) -> None:
    ...

    if recreate:
        logger.info("Deleting collection")
        self.vector_db.delete()

    logger.info("Creating collection")
    self.vector_db.create()

    ...

Therefore this patch aims to fix this, as well as the same "always recreating" behavior in KnowledgeBase.load_documents