Delete Knowledgebase
The Tror Gen AI SDK empowers you to manage your knowledge bases, including the ability to delete those that are no longer required (Note: Knowledge base management is an optional feature). This section guides you through the process of deleting a knowledge base using its unique identifier.
When to Delete a Knowledge Base?
-
Evolving Needs: As your application's focus or the information landscape changes, you might have knowledge bases that are no longer relevant. Deleting these frees up resources and keeps your knowledge base collection organized.
-
Unused Knowledge Bases: If you've created knowledge bases that are not actively used within your LLM interactions, you can delete them to declutter your knowledge base management.
Deleting a Knowledge Base with ID
The delete_knowledgebase function within the SDK allows you to remove a knowledge base using its ID. Here's what you need to know:
- Argument: The function requires one argument, knowledgebase_id (str), which is the unique identifier assigned to the knowledge base you want to delete.
Simple Deletion Example
import trorgenai
knowledgebase_to_delete_id = "kb_12345" # Replace with the actual ID
trorgenai.delete_knowledgebase(knowledgebase_to_delete_id)
This code snippet removes the knowledge base with the ID "kb_12345" from your application.
Important Considerations
-
Permanent Deletion: Once you delete a knowledge base using its ID, it's permanently removed from the SDK. The knowledge base name, content, and any associations with past LLM interactions are deleted.
-
Double-check the ID: Before deletion, it's recommended to verify the knowledge base ID to avoid accidentally removing an important one.
By effectively managing your knowledge bases through creation and deletion, you can ensure that your LLM interactions consistently leverage the most up-to-date and relevant information, enhancing the overall user experience.