MindsDB is the world’s most effective solution for building AI applications that talk to messy enterprise data sources. Think of it as a librarian Marie Kondo.

A federated query engine that tidies up your data-sprawl chaos while meticulously answering every single question you throw at it. From structured to unstructured data, whether it’s scattered across SaaS applications, databases, or… hibernating in data warehouses like that $100 bill in your tuxedo pocket from prom night, lost, waiting to be discovered.

Install MindsDB Server

MindsDB is an open-source server that can be deployed anywhere - from your laptop to the cloud, and everywhere in between. And yes, you can customize it to your heart’s content.

  • Using Docker Desktop. This is the fastest and recommended way to get started and have it all running.
  • Using Docker. This is also simple, but gives you more flexibility on how to further customize your server.
  • Using PyPI. This option enables you to contribute to MindsDB.

Connect Your Data

You can connect to hundreds of data sources (learn more). This is just an example of a Postgres database.

-- Connect to demo postgres DB
CREATE DATABASE demo_postgres_db
WITH ENGINE = "postgres",
PARAMETERS = {
  "user": "demo_user",
  "password": "demo_password",
  "host": "samples.mindsdb.com",
  "port": "5432",
  "database": "demo",
  "schema": "demo_data"
};

Once you’ve connected your data sources, you can combine, slice it, dice it, and transform it however your heart desires using good ol’ standard SQL (learn more).

After you’ve whipped your data into shape, it’s time to build AI that actually learns!

Build AI Knowledge

Our Knowledge Bases are state-of-the-art autonomous RAG systems that can digest data from any source MindsDB supports. Whether your data is structured and neater than a Swiss watch factory or unstructured and messy as a teenager’s bedroom, our Knowledge Base engine will figure out how to find the relevant information.

In this example we will create a knowledge base that knows everything about amazon reviews.

-- first create a knowledge base
CREATE KNOWLEDGE_BASE mindsdb.reviews_kb;

-- now insert everything from the amazon reviews table into it, so it can learn it
INSERT INTO mindsdb.reviews_kb (
  SELECT review as content FROM demo_pg_db.amazon_reviews
);

-- check the status of your loads here
SELECT * FROM information_schema.knowledge_bases;

-- query the content of the knowledge base
SELECT * FROM mindsdb.reviews_kb;

For the tinkerers and optimization enthusiasts out there, you can dive as deep as you want. (Learn more about knowledge Bases)

But if you’d rather spend your time on other things (like finally building that billion-dollar AI App), that’s perfectly fine too. By default, it’s all handled automatically - you don’t need to worry about the nitty-gritty details like data embedding, chunking, vector optimization, etc.

Now that your knowledge base is loaded and ready. Let’s hunt for some juicy info!

Via SQL

-- Find the reviews that about Iphone in beast of lights
SELECT *  FROM mindsdb.reviews_kb
WHERE content LIKE 'what are the best kindle reviews'
LIMIT 10;

Via Python SDK

Install MindsDB SDK

pip install mindsdb_sdk

You can call this AI knowledge base from your app with the following code:

import mindsdb_sdk


# connects to the specified host and port
server = mindsdb_sdk.connect('http://127.0.0.1:47334')

wiki_kb = server.knowledge_bases.get('mindsdb.reviews_kb');
df = my_kb.find('what are the best kindle reviews').fetch()