We’re thrilled to announce that Couchbase is now supported as a vector store in MindsDB, bringing together the best of both worlds: MindsDB’s cutting-edge machine learning capabilities and Couchbase’s high-performance vector storage. With this new integration, users can seamlessly combine data and AI, unlocking powerful new possibilities for their applications.
MindsDB is an open-source tool that integrates various artificial intelligence (AI) models with databases or other data management systems, enabling easy creation and deployment of new AI-based solutions. With its intuitive interface and broad compatibility with popular data sources, MindsDB facilitates the implementation of advanced machine learning models without requiring deep technical knowledge
In the following sections, we’ll explore some details of this integration.
Setting up MindsDB with Couchbase
To get started with the MindsDB and Couchbase, you’ll need to follow a few simple steps
Installing MindsDB
Run the MindsDB Docker container. Execute the following command to create a Docker container for MindsDB:
docker run --name mindsdb_container -p 47334:47334 -p 47335:47335 mindsdb/mindsdb
Once the container is up and running, you can access the MindsDB editor by navigating to http://127.0.0.1:47334
in your web browser.
Alternative: Use MindsDB’s Docker Desktop extension to manage the container directly within Docker Desktop.
Installing Couchbase inside MindsDB
There are two ways to install the dependencies needed for Couchbase integration:
Method 1: Install via MindsDB Editor
-
- Open the MindsDB editor.
- Go to Settings and then Manage Integrations.
- Select the CouchbaseVector integration.
- Click Install.
Method 2: Install via Command Line
-
- Start the MindsDB Docker container:
docker start mindsdb_container
- Start an interactive shell in the container:
docker exec -it mindsdb_container sh
- Install the Couchbase dependencies:
pip install .[couchbasevector]
- Exit the interactive shell:
exit
- Restart the container:
docker restart mindsdb_container
- Start the MindsDB Docker container:
Now you will have Couchbase installed as a dependency in your MindsDB editor!
Connecting to Couchbase and performing vector search
Now that MindsDB and Couchbase are integrated, you can connect Couchbase as a vector store and perform vector searches. Here’s how:
1. Establish a database connection
Use the following SQL-like syntax to create a connection to your Couchbase instance. The example below connects to the travel-sample bucket (you can enable this bucket from the Couchbase UI).
1 2 3 4 5 6 7 8 9 10 |
CREATE DATABASE couchbase_vectorsource WITH engine='couchbasevector', parameters={ "connection_string": "couchbase://localhost", "bucket": "travel-sample", "user": "admin", "password": "password", "scope": "inventory" }; |
2. Create a table in Couchbase
You can create a collection (or table) in Couchbase and populate it with data from another MindsDB data source. For instance, to store vector embeddings from a MySQL database:
1 2 3 4 |
CREATE TABLE couchbase_vectorsource.test_embeddings ( SELECT embeddings FROM mysql_datasource.test_embeddings ); |
In this example, mysql_datasource refers to another MindsDB data source connected to a MySQL database. The test_embeddings table contains the embeddings you wish to store in Couchbase.
3. Performing vector search
To perform a vector search, use a query like the one below.
1 2 3 4 5 6 7 |
SELECT * FROM couchbase_vectorsource.test_embeddings WHERE embeddings = ( SELECT embeddings FROM mysql_datasource.test_embeddings LIMIT 1 ); |
Conclusion
This integration allows you to easily combine Couchbase’s high-performance vector storage with MindsDB’s machine learning capabilities, enabling the development of intelligent, scalable applications with minimal effort. Whether you’re building recommendation systems, semantic search, or other AI-driven solutions, this powerful combination provides the tools needed to succeed.
Next steps
More information is available in the MindsDB documentation, including an integration guide to Couchbase.
Happy coding!