MindsDB is the worldβs most widely used platform for building AI that can learn from and answer questions across federated data.
MindsDB is a federated query engine designed for AI agents and applications that need to answer questions from one or multiple data sources, including both structured and unstructured data..
- Install MindsDB using Docker or Docker Desktop.
- Connect Your Data β Connect and query hundreds of different data sources.
- Prepare Your Data β Prepare, organize, and automate data transformations using AI and ML to fit your needs.
After connecting and preparing your data, you can leverage MindsDB to implement the following use cases:
π― Use Case | βοΈ Description | Python SDK | SQL |
---|---|---|---|
RAG | Comprehensive RAG that can be populated from numerous data sources | (Python) | (SQL) |
Agents | Equip agents to answer questions over structured and unstructured data in MindsDB | (Python) | (SQL) |
Automation | Automate AI-data workflows using Jobs | (Python) | (SQL) |
A common use case involves connecting agents to data. The following example shows how to connect an AI agent to a database so it can perform search over structured data:
First we connect the datasource, in this case we connect a postgres database (you can do this via the SQL editor or SDK)
-- Step 1: Connect a data source to MindsDB
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"
};
-- See some of the data in there
SELECT * FROM demo_postgres_db.car_sales;
Now you can create an egent that can answer questions over unstructued information in this database (let's use the Python SDK)
import mindsdb_sdk
# connects to the default port (47334) on localhost
server = mindsdb_sdk.connect()
# create an agent (lets create one that can answer questions over car_sales table
agent = server.agents.create('my_agent')
agent.add_database(
database='demo_postgres_db',
tables=['car_sales'], # alternatively, all tables will be taken into account if none specified []
description='The table "car_sales" contains car sales data')
# send questions to the agent
agent = agents.get('my_agent')
answer = agent.completion([{'question': 'What cars do we have with normal transmission and gas?'}])
print(answer.content)
You add more data to the agent, lets add some unstructured data:
agent.add_file('./cars_info.pdf', 'Details about the cars')
answer = agent.completion([{'question': 'What cars do we have with normal transmission and gas? also include valuable info for a buyer of these cars?'}])
print(answer.content)
Agents are also accessible via API endpoints.
Interested in contributing to MindsDB? Follow our installation guide for development.
You can find our contribution guide here.
We welcome suggestions! Feel free to open new issues with your ideas, and weβll guide you.
This project adheres to a Contributor Code of Conduct. By participating, you agree to follow its terms.
Also, check out our community rewards and programs.
If you find a bug, please submit an issue on GitHub.
Hereβs how you can get community support:
- Ask a question in our Slack Community.
- Join our GitHub Discussions.
- Post on Stack Overflow with the MindsDB tag.
For commercial support, please contact the MindsDB team.
Generated with contributors-img.
Join our [Slack community](https://mindsdb.com/j