Metadata-Version: 2.1
Name: MindsDB
Version: 24.7.4.1
Summary: MindsDB's AI SQL Server enables developers to build AI tools that need access to real-time data to perform their tasks
Home-page: https://github.com/mindsdb/mindsdb
Download-URL: https://pypi.org/project/mindsdb/
Author: MindsDB Inc
Author-email: jorge@mindsdb.com
License: ELv2
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8,<3.11
Description-Content-Type: text/markdown
Provides-Extra: dev
Provides-Extra: test
Provides-Extra: all_extras
Provides-Extra: access
Provides-Extra: aerospike
Provides-Extra: altibase
Provides-Extra: anomaly_detection
Provides-Extra: anthropic
Provides-Extra: anyscale_endpoints
Provides-Extra: apache_doris
Provides-Extra: aurora
Provides-Extra: autogluon
Provides-Extra: autokeras
Provides-Extra: autosklearn
Provides-Extra: bigquery
Provides-Extra: binance
Provides-Extra: byom
Provides-Extra: cassandra
Provides-Extra: chromadb
Provides-Extra: ckan
Provides-Extra: clickhouse
Provides-Extra: cloud_spanner
Provides-Extra: cloud_sql
Provides-Extra: cockroach
Provides-Extra: cohere
Provides-Extra: coinbase
Provides-Extra: confluence
Provides-Extra: couchbase
Provides-Extra: crate
Provides-Extra: d0lt
Provides-Extra: databend
Provides-Extra: databricks
Provides-Extra: datastax
Provides-Extra: db2
Provides-Extra: derby
Provides-Extra: discord
Provides-Extra: documentdb
Provides-Extra: dremio
Provides-Extra: druid
Provides-Extra: dspy
Provides-Extra: edgelessdb
Provides-Extra: elasticsearch
Provides-Extra: email
Provides-Extra: empress
Provides-Extra: eventbrite
Provides-Extra: faunadb
Provides-Extra: file
Provides-Extra: firebird
Provides-Extra: flaml
Provides-Extra: frappe
Provides-Extra: github
Provides-Extra: gitlab
Provides-Extra: gmail
Provides-Extra: google_analytics
Provides-Extra: google_books
Provides-Extra: google_calendar
Provides-Extra: google_content_shopping
Provides-Extra: google_fit
Provides-Extra: google_gemini
Provides-Extra: google_search
Provides-Extra: hana
Provides-Extra: hive
Provides-Extra: hsqldb
Provides-Extra: hubspot
Provides-Extra: huggingface_api
Provides-Extra: huggingface
Provides-Extra: huggingface-cpu
Provides-Extra: ignite
Provides-Extra: impala
Provides-Extra: influxdb
Provides-Extra: informix
Provides-Extra: ingres
Provides-Extra: jira
Provides-Extra: kinetica
Provides-Extra: lancedb
Provides-Extra: langchain_embedding
Provides-Extra: langchain
Provides-Extra: leonardoai
Provides-Extra: libsql
Provides-Extra: lightfm
Provides-Extra: lightwood
Provides-Extra: lindorm
Provides-Extra: litellm
Provides-Extra: llama_index
Provides-Extra: ludwig
Provides-Extra: luma
Provides-Extra: mariadb
Provides-Extra: materialize
Provides-Extra: matrixone
Provides-Extra: maxdb
Provides-Extra: mediawiki
Provides-Extra: mendeley
Provides-Extra: merlion
Provides-Extra: milvus
Provides-Extra: minds_endpoint
Provides-Extra: mlflow
Provides-Extra: monetdb
Provides-Extra: mongodb
Provides-Extra: monkeylearn
Provides-Extra: ms_teams
Provides-Extra: mssql
Provides-Extra: mysql
Provides-Extra: neuralforecast
Provides-Extra: neuralforecast-extra
Provides-Extra: newsapi
Provides-Extra: notion
Provides-Extra: nuo_jdbc
Provides-Extra: oceanbase
Provides-Extra: openai
Provides-Extra: openbb
Provides-Extra: opengauss
Provides-Extra: openstreetmap
Provides-Extra: oracle
Provides-Extra: orioledb
Provides-Extra: palm
Provides-Extra: paypal
Provides-Extra: pgvector
Provides-Extra: phoenix
Provides-Extra: pinecone
Provides-Extra: pinot
Provides-Extra: plaid
Provides-Extra: planetscale
Provides-Extra: popularity_recommender
Provides-Extra: pycaret
Provides-Extra: qdrant
Provides-Extra: questdb
Provides-Extra: quickbooks
Provides-Extra: rag
Provides-Extra: reddit
Provides-Extra: redshift
Provides-Extra: replicate
Provides-Extra: rocket_chat
Provides-Extra: rockset
Provides-Extra: scylla
Provides-Extra: sendinblue
Provides-Extra: sentence_transformers
Provides-Extra: shopify
Provides-Extra: singlestore
Provides-Extra: slack
Provides-Extra: snowflake
Provides-Extra: solace
Provides-Extra: solr
Provides-Extra: spacy
Provides-Extra: sqlany
Provides-Extra: sqreamdb
Provides-Extra: stabilityai
Provides-Extra: starrocks
Provides-Extra: statsforecast
Provides-Extra: statsforecast-extra
Provides-Extra: strava
Provides-Extra: stripe
Provides-Extra: supabase
Provides-Extra: surrealdb
Provides-Extra: symbl
Provides-Extra: tdengine
Provides-Extra: teradata
Provides-Extra: tidb
Provides-Extra: timegpt
Provides-Extra: timescaledb
Provides-Extra: tpot
Provides-Extra: trino
Provides-Extra: twelve_labs
Provides-Extra: twilio
Provides-Extra: twitter
Provides-Extra: vertex
Provides-Extra: vertica
Provides-Extra: vitess
Provides-Extra: weaviate
Provides-Extra: web
Provides-Extra: webz
Provides-Extra: whatsapp
Provides-Extra: writer
Provides-Extra: xata
Provides-Extra: youtube
Provides-Extra: yugabyte
Provides-Extra: zotero
Provides-Extra: all_handlers_extras
License-File: LICENSE

<a name="readme-top"></a>

<div align="center">
	<a href="https://pypi.org/project/MindsDB/" target="_blank"><img src="https://badge.fury.io/py/MindsDB.svg" alt="MindsDB Release"></a>
	<a href="https://www.python.org/downloads/" target="_blank"><img src="https://img.shields.io/badge/python-3.8.x%7C%203.9.x%7C%203.10.x%7C%203.11.x-brightgreen.svg" alt="Python supported"></a>
	<a href="https://ossrank.com/p/630"><img src="https://shields.io/endpoint?url=https://ossrank.com/shield/630"></a>
	<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/Mindsdb">
	<a href="https://hub.docker.com/u/mindsdb" target="_blank"><img src="https://img.shields.io/docker/pulls/mindsdb/mindsdb" alt="Docker pulls"></a>

  <br />
  <br />

  <a href="https://github.com/mindsdb/mindsdb">
    <img src="/docs/assets/mindsdb_logo.jpg" alt="MindsDB" width="300">
  </a>

  <p align="center">
    <br />
    <a href="https://www.mindsdb.com?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo">Website</a>
    ·
    <a href="https://docs.mindsdb.com?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo">Docs</a>
    ·
    <a href="https://mindsdb.com/joincommunity?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo">Community Slack</a>
  </p>
</div>

----------------------------------------

[MindsDB](https://mindsdb.com?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo) is the platform for building AI from enterprise data. You can create, serve, and fine-tune models in real-time from your database, vector store, and application data.
 [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=The%20platform%20for%20building%20AI,%20from%20enterprise%20data&url=https://github.com/mindsdb/mindsdb&via=mindsdb&hashtags=ai,opensource)

## 📖 About us

MindsDB is the platform for building AI from enterprise data.

With MindsDB, you can deploy, serve, and fine-tune models in real-time, utilizing data from databases, vector stores, or applications, to build AI-powered apps - using universal tools developers already know.

<p align="center">
  <img src="/docs/assets/mindsdb_homepage_diagram.png"/>
</p>

MindsDB integrates with numerous [data sources](https://docs.mindsdb.com/integrations/data-overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo), including databases, vector stores, and applications, and popular [AI/ML frameworks](https://docs.mindsdb.com/integrations/ai-overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo), including AutoML and LLMs. MindsDB connects data sources with AI/ML frameworks and automates routine workflows between them. By doing so, we bring data and AI together, enabling the intuitive implementation of customized AI systems.

Learn more about [features and use cases of MindsDB here](https://docs.mindsdb.com/what-is-mindsdb?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

## 🚀 Get Started

To get started, install MindsDB locally via [Docker](https://docs.mindsdb.com/setup/self-hosted/docker?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo) or [Docker Desktop](https://docs.mindsdb.com/setup/self-hosted/docker-desktop?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo), following the instructions in linked doc pages.

MindsDB enhances SQL syntax to enable seamless development and deployment of AI-powered applications. Furthermore, users can interact with MindsDB not only via [SQL API](https://docs.mindsdb.com/mindsdb_sql/overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo) but also via [REST APIs](https://docs.mindsdb.com/rest/overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo), [Python SDK](https://docs.mindsdb.com/sdks/python/overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo), [JavaScript SDK](https://docs.mindsdb.com/sdks/javascript/overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo), and [MongoDB-QL](https://docs.mindsdb.com/sdks/mongo/mindsdb-mongo-ql-overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

| 🎯  Solutions                 | ⚙️ SQL Query Examples |
|---------------------------|-----------|
| 🤖 [Fine-Tuning](https://docs.mindsdb.com/sql/api/finetune#example-3-openai-model?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo)            |  <code> FINETUNE mindsdb.hf_model FROM postgresql.table; </code>  |
| 📚 [Knowledge Base](https://docs.mindsdb.com/agents/knowledge-bases?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo)         | <code> CREATE KNOWLEDGE_BASE my_knowledge FROM (SELECT contents FROM drive.files); </code> |
| 🔍 [Semantic Search](https://docs.mindsdb.com/integrations/ai-engines/rag?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo)        |  <code> SELECT * FROM rag_model WHERE question='What product is best for treating a cold?';  </code>   |
| ⏱️ [Real-Time Forecasting](https://docs.mindsdb.com/sql/tutorials/eeg-forecasting?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo) | <code> SELECT * FROM binance.trade_data WHERE symbol = 'BTCUSDT'; </code> |
| 🕵️ [Agents](https://docs.mindsdb.com/agents/agent?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo)                | <code> CREATE AGENT my_agent USING model='chatbot_agent', skills = ['knowledge_base']; </code>    |
| 💬 [Chatbots](https://docs.mindsdb.com/agents/chatbot?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo)               |  <code> CREATE CHATBOT slack_bot USING database='slack',agent='customer_support'; </code>|
| ⏲️ [Time Driven Automation](https://docs.mindsdb.com/sql/create/jobs?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo)      |  <code> CREATE JOB twitter_bot ( <sql_query1>, <sql_query2> ) START '2023-04-01 00:00:00';   </code>           |
| 🔔 [Event Driven Automation](https://docs.mindsdb.com/sql/create/trigger?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo)      | <code> CREATE TRIGGER data_updated ON mysql.customers_data (sql_code)           |

## 💡 Examples

MindsDB enables you to deploy AI/ML models, send predictions to your application, and automate AI workflows.

[Discover more tutorials and use cases here](https://docs.mindsdb.com/use-cases/overview?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

### AI Workflow Automation

This category of use cases involves tasks that get data from a data source, pass it through an AI/ML model, and write the output to a data destination.

<p align="center">
  <img src="/docs/assets/ai_workflow_automation.png"/>
</p>

Common use cases are anomaly detection, data indexing/labeling/cleaning, and data transformation.

This example showcases the data enrichment flow, where input data comes from a PostgreSQL database and is passed through an OpenAI model to generate new content which is saved into a data destination.

We take customer reviews from a PostgreSQL database. Then, we deploy an OpenAI model that analyzes all customer reviews and assigns sentiment values. Finally, to automate the workflow for incoming customer reviews, we create a job that generates and saves AI output into a data destination.

```sql
-- Step 1. Connect a data source to MindsDB
CREATE DATABASE data_source
WITH ENGINE = "postgres",
PARAMETERS = {
    "user": "demo_user",
    "password": "demo_password",
    "host": "samples.mindsdb.com",
    "port": "5432",
    "database": "demo",
    "schema": "demo_data"
};

SELECT *
FROM data_source.amazon_reviews_job;

-- Step 2. Deploy an AI model
CREATE ML_ENGINE openai_engine
FROM openai
USING
    openai_api_key = 'your-openai-api-key';

CREATE MODEL sentiment_classifier
PREDICT sentiment
USING
    engine = 'openai_engine',
    model_name = 'gpt-4',
    prompt_template = 'describe the sentiment of the reviews
						strictly as "positive", "neutral", or "negative".
						"I love the product":positive
						"It is a scam":negative
						"{{review}}.":';

DESCRIBE sentiment_classifier;

-- Step 3. Join input data with AI model to get AI output
SELECT input.review, output.sentiment
FROM data_source.amazon_reviews_job AS input
JOIN sentiment_classifier AS output;

-- Step 4. Automate this workflow to accomodate real-time and dynamic data
CREATE DATABASE data_destination
WITH ENGINE = "engine-name",      -- choose the data source you want to connect to save AI output
PARAMETERS = {                    -- list of available data sources: https://docs.mindsdb.com/integrations/data-overview
    "key": "value",
	...
};

CREATE JOB ai_automation_flow (
	INSERT INTO data_destination.ai_output (
		SELECT input.created_at,
			   input.product_name,
			   input.review,
			   output.sentiment
		FROM data_source.amazon_reviews_job AS input
		JOIN sentiment_classifier AS output
		WHERE input.created_at > LAST
	);
);
```

### AI System Deployment

This category of use cases involves creating AI systems composed of multiple connected parts, including various AI/ML models and data sources, and exposing such AI systems via APIs.

<p align="center">
  <img src="/docs/assets/ai_system_deployment.png"/>
</p>

Common use cases are agents and assistants, recommender systems, forecasting systems, and semantic search.

This example showcases AI agents, a feature developed by MindsDB. AI agents can be assigned certain skills, including text-to-SQL skills and knowledge bases. Skills provide an AI agent with input data that can be in the form of a database, a file, or a website.

We create a text-to-SQL skill based on the car sales dataset and deploy a conversational model, which are both components of an agent. Then, we create an agent and assign this skill and this model to it. This agent can be queried to ask questions about data stored in assigned skills.

```sql
-- Step 1. Connect a data source to MindsDB
CREATE DATABASE data_source
WITH ENGINE = "postgres",
PARAMETERS = {
    "user": "demo_user",
    "password": "demo_password",
    "host": "samples.mindsdb.com",
    "port": "5432",
    "database": "demo",
    "schema": "demo_data"
};

SELECT *
FROM data_source.car_sales;

-- Step 2. Create a skill
CREATE SKILL my_skill
USING
    type = 'text2sql',
    database = 'data_source',
    tables = ['car_sales'],
    description = 'car sales data of different car types';

SHOW SKILLS;

-- Step 3. Deploy a conversational model
CREATE ML_ENGINE langchain_engine
FROM langchain
USING
      openai_api_key = 'your openai-api-key';
      
CREATE MODEL my_conv_model
PREDICT answer
USING
    engine = 'langchain_engine',
    model_name = 'gpt-4',
    mode = 'conversational',
    user_column = 'question' ,
    assistant_column = 'answer',
    max_tokens = 100,
    temperature = 0,
    verbose = True,
    prompt_template = 'Answer the user input in a helpful way';

DESCRIBE my_conv_model;

-- Step 4. Create an agent
CREATE AGENT my_agent
USING
    model = 'my_conv_model',
    skills = ['my_skill'];

SHOW AGENTS;

-- Step 5. Query an agent
SELECT *
FROM my_agent
WHERE question = 'what is the average price of cars from 2018?';

SELECT *
FROM my_agent
WHERE question = 'what is the max mileage of cars from 2017?';

SELECT *
FROM my_agent
WHERE question = 'what percentage of sold cars (from 2016) are automatic/semi-automatic/manual cars?';

SELECT *
FROM my_agent
WHERE question = 'is petrol or diesel more common for cars from 2019?';

SELECT *
FROM my_agent
WHERE question = 'what is the most commonly sold model?';
```

[Agents are accessible via API endpoints](https://docs.mindsdb.com/rest/agents/agent?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

## 🤝 Contribute

If you’d like to contribute to MindsDB, install MindsDB for development following [this instruction](https://docs.mindsdb.com/contribute/install?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

You’ll find the [contribution guide here](https://docs.mindsdb.com/contribute/contribute?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

We are always open to suggestions, so feel free to open new issues with your ideas, and we can guide you!

This project is released with a [Contributor Code of Conduct](https://github.com/mindsdb/mindsdb/blob/main/CODE_OF_CONDUCT.md). By participating in this project, you agree to follow its terms.

Also, check out the [rewards and community programs here](https://mindsdb.com/community?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

## 🤍 Support

If you find a bug, please submit an [issue on GitHub here](https://github.com/mindsdb/mindsdb/issues/new/choose).

Here is how you can get community support:

* Post a question at [MindsDB Slack Community](https://mindsdb.com/joincommunity?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).
* Ask for help at our [GitHub Discussions](https://github.com/mindsdb/mindsdb/discussions).
* Ask a question at [Stackoverflow](https://stackoverflow.com/questions/tagged/mindsdb) with a MindsDB tag.

If you need commercial support, please [contact the MindsDB team](https://mindsdb.com/contact?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo).

## 💚 Current contributors

<a href="https://github.com/mindsdb/mindsdb/graphs/contributors">
  <img src="https://contributors-img.web.app/image?repo=mindsdb/mindsdb" />
</a>

Made with [contributors-img](https://contributors-img.web.app).

## 🔔 Subscribe to updates

Join our [Slack community](https://mindsdb.com/joincommunity?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo) and subscribe to the monthly [Developer Newsletter](https://mindsdb.com/newsletter?utm_medium=community&utm_source=github&utm_campaign=mindsdb%20repo) to get product updates, information about MindsDB events and contests, and useful content, like tutorials.

## ⚖️ License 

For detailed licensing information, please refer to the [LICENSE file](https://github.com/mindsdb/mindsdb/blob/master/LICENSE).
