MindsDB
MindsDB is an AI automation platform for building AI/ML powered features and applications. It works by connecting any source of data with any AI/ML model or framework and automating how real-time data flows between them.
With the MindsDB-Qdrant integration, you can now select Qdrant as a database to load into and retrieve from with semantic search and filtering.
MindsDB allows you to easily:
- Connect to any store of data or end-user application.
- Pass data to an AI model from any store of data or end-user application.
- Plug the output of an AI model into any store of data or end-user application.
- Fully automate these workflows to build AI-powered features and applications
Usage
To get started with Qdrant and MindsDB, the following syntax can be used.
CREATE DATABASE qdrant_test
WITH ENGINE = "qdrant",
PARAMETERS = {
"location": ":memory:",
"collection_config": {
"size": 386,
"distance": "Cosine"
}
}
The available arguments for instantiating Qdrant can be found here.
Creating a new table
- Qdrant options for creating a collection can be specified as
collection_config
in theCREATE DATABASE
parameters. - By default, UUIDs are set as collection IDs. You can provide your own IDs under the
id
column.
CREATE TABLE qdrant_test.test_table (
SELECT embeddings,'{"source": "bbc"}' as metadata FROM mysql_demo_db.test_embeddings
);
Querying the database
Perform a full retrieval using the following syntax.
SELECT * FROM qdrant_test.test_table
By default, the LIMIT
is set to 10 and the OFFSET
is set to 0.
Perform a similarity search using your embeddings
SELECT * FROM qdrant_test.test_table
WHERE search_vector = (select embeddings from mysql_demo_db.test_embeddings limit 1)
Perform a search using filters
SELECT * FROM qdrant_test.test_table
WHERE `metadata.source` = 'bbc';
Delete entries using IDs
DELETE FROM qtest.test_table_6
WHERE id = 2
Delete entries using filters
DELETE * FROM qdrant_test.test_table
WHERE `metadata.source` = 'bbc';
Drop a table
DROP TABLE qdrant_test.test_table;
Next steps
- You can find more information pertaining to MindsDB and its datasources here.
- Source Code