Knowledge Bases
Description
With MindsDB, you can create and deploy AI agents that comprise AI models and customizable skills such as knowledge bases and text-to-SQL.
Learn more about AI Agents here.
There are two types of skills available in MindsDB:
- Text2SQL skill translates users’ questions into SQL queries and fetches relevant information from data sources assigned to this skill.
- Knowledge Bases store data from databases, files, or webpages, and use different retrieval methods to fetch relevant information and present it as answers.
Syntax
To feed an agent with data from different sources, use the knowledge_base skills.
Here is how to create a knowledge base:
Here is how to insert data into a knowledge base:
- Inserting data from files:
Note that the file should be uploaded to MindsDB before inserting it into the knowledge base.
- Inserting data from the web:
Optionally, you can specify the crawl depth as the second argument. For example, the crawl depth of 1 indicates that all links present on https://docs.mindsdb.com/
will be crawled, and the crawl depth of 2 indicates that all links present on those pages will be crawled, and so on.
- Inserting data from data sources connected to MindsDB:
- Inserting raw data:
When inserting data to a knowledge base, you can specify the partition_size
parameter to split data into partitions and run prediction on different workers. Note that the ML task queue needs to be enabled to use this parameter.
To use the partition_size
parameter, provide the below argument to the insert
function, specifying the partition size, like this:
Here is how to query data from a knowledge base using specified keywords:
Here is how to list all available knowledge bases:
Here is how to get a knowledge base by name:
Here is how to drop a knowledge base:
Was this page helpful?