Class KnowledgeBases

java.lang.Object
mindsdb.services.KnowledgeBases

public class KnowledgeBases extends Object
Service class for managing knowledge bases in a MindsDB project.
  • Constructor Details

    • KnowledgeBases

      public KnowledgeBases(Project project, RestAPI api)
      Constructs a new KnowledgeBases instance with the provided project and API.
      Parameters:
      project - The project associated with the knowledge bases.
      api - The API instance used to interact with the backend.
  • Method Details

    • list

      public List<KnowledgeBase> list()
      List all knowledge bases in the project.
      Returns:
      List of knowledge bases.
    • get

      public KnowledgeBase get(String name)
      Get a knowledge base by name.
      Parameters:
      name - The name of the knowledge base.
      Returns:
      The knowledge base with the specified name.
      Throws:
      IllegalArgumentException - if the knowledge base does not exist.
    • create

      public KnowledgeBase create(String name, Model model, MDBTable storage, List<String> metadataColumns, List<String> contentColumns, String idColumn, Map<String,Object> params)
      Create a new knowledge base.
      Parameters:
      name - The name of the knowledge base.
      model - The model to use for the knowledge base.
      storage - The storage to use for the knowledge base.
      metadataColumns - The metadata columns for the knowledge base.
      contentColumns - The content columns for the knowledge base.
      idColumn - The ID column for the knowledge base.
      params - Additional parameters for the knowledge base.
      Returns:
      The created knowledge base.
    • drop

      public void drop(String name)
      Drop a knowledge base by name.
      Parameters:
      name - The name of the knowledge base to drop.