docs.mindsdb.comAI tool

MindsDB

docs.mindsdb.com
Planos de precos

Ainda nao ha planos de preco detalhados para esta ferramenta.

Visao detalhada
Skip to main contentMindsDB home pageDocumentationAsk AICopy pageSearch...MindsDB home pageSearch...NavigationSentiment Analysis with MindsDB and OpenAI using SQLGet StartedIntroductionQuickstartReleasesSetupInstallationConfigurationLearn moreWatch VideoSlackGitHubWebsiteOn this pageIntroductionPrerequisitesTutorialLeverage the NLP Capabilities with MindsDBWhat’s Next?​Introduction In this blog post, we present how to create OpenAI models within MindsDB. This example is a sentiment analysis where we infer emotions behind a text. The input data is taken from our sample MySQL database. ​Prerequisites To follow along, install MindsDB locally via Docker or Docker Desktop. ​Tutorial In this tutorial, we create a predictive model to infer emotions behind a text, a task also known as sentiment analysis. We use a table from our MySQL public demo database, so let’s start by connecting MindsDB to it: CopyAsk AICREATE DATABASE mysql_demo_db WITH ENGINE = 'mysql', PARAMETERS = { "user": "user", "password": "MindsDBUser123!", "host": "samples.mindsdb.com", "port": "3306", "database": "public" }; Now that we’ve connected our database to MindsDB, let’s query the data to be used in the example: CopyAsk AISELECT * FROM mysql_demo_db.amazon_reviews LIMIT 3; Here is the output: CopyAsk AI+-----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | product_name | review | +-----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+ | All-New Fire HD 8 Tablet, 8 HD Display, Wi-Fi, 16 GB - Includes Special Offers, Magenta | Late gift for my grandson. He is very happy with it. Easy for him (9yo ). | | All-New Fire HD 8 Tablet, 8 HD Display, Wi-Fi, 16 GB - Includes Special Offers, Magenta | I'm not super thrilled with the proprietary OS on this unit, but it does work okay and does what I n | | All-New Fire HD 8 Tablet, 8 HD Display, Wi-Fi, 16 GB - Includes Special Offers, Magenta | I purchased this Kindle Fire HD 8 was purchased for use by 5 and 8 yer old grandchildren. They basic | +-----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+ Let’s create a model table to identify sentiment for all reviews: Before creating an OpenAI model, please create an engine, providing your OpenAI API key:CopyAsk AICREATE ML_ENGINE openai_engine FROM openai USING openai_api_key = 'your-openai-api-key'; CopyAsk AICREATE MODEL sentiment_classifier_model PREDICT sentiment USING engine = 'openai_engine', 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}}.":'; In practice, the CREATE MODEL statement triggers MindsDB to generate an AI table called sentiment_classifier_model that uses the OpenAI integration to predict a column named sentiment. The model lives inside the default mindsdb project. In MindsDB, projects are a natural way to keep artifacts, such as models or views, separate according to what predictive task they solve. You can learn more about MindsDB projects here. The USING clause specifies the parameters that this handler requires. The engine parameter defines that we use the openai engine. The prompt_template parameter conveys the structure of a message that is to be completed with additional text generated by the model. Follow this instruction to set up the OpenAI integration in MindsDB. Once the CREATE MODEL statement has started execution, we can check the status of the creation process with the following query: CopyAsk AIDESCRIBE sentiment_classifier_model; It may take a while to register as complete depending on the internet connection. Once the creation is complete, the behavior is the same as with any other AI table – you can query it either by specifying synthetic data in the actual query: CopyAsk AISELECT review, sentiment FROM sentiment_classifier_model WHERE review = 'It is ok.'; Here is the output data: CopyAsk AI+-----------+-----------+ | review | sentiment | +-----------+-----------+ | It is ok. | neutral | +-----------+-----------+ Or by joining with another table for batch predictions: CopyAsk AISELECT input.review, output.sentiment FROM mysql_demo_db.amazon_reviews AS input JOIN sentiment_classifier_model AS output LIMIT 3; Here is the output data: CopyAsk AI+------------------------------------------------------------------------------------------------------+-----------+ | review | sentiment | +------------------------------------------------------------------------------------------------------+-----------+ | Late gift for my grandson. He is very happy with it. Easy for him (9yo ). | positive | | I'm not super thrilled with the proprietary OS on this unit, but it does work okay and does what I n | positive | | I purchased this Kindle Fire HD 8 was purchased for use by 5 and 8 yer old grandchildren. They basic | positive | +------------------------------------------------------------------------------------------------------+-----------+ The amazon_reviews table is used to make batch predictions. Upon joining the sentiment_classifier_model model with the amazon_reviews table, the model uses all values from the review column. ​Leverage the NLP Capabilities with MindsDB By integrating databases and OpenAI using MindsDB, developers can easily extract insights from text data with just a few SQL commands. These powerful natural language processing (NLP) models are capable of answering questions with or without context and completing general prompts. Furthermore, these models are powered by large pre-trained language models from OpenAI, so there is no need for manual development work. Ultimately, this provides developers with an easy way to incorporate powerful NLP capabilities into their applications while saving time and resources compared to traditional ML development pipelines and methods. All in all, MindsDB makes it possible for developers to harness the power of OpenAI efficiently! MindsDB is now the fastest-growing open-source applied machine-learning platform in the world. Its community continues to contribute to more than 70 data-source and ML-framework integrations. Stay tuned for the upcoming features - including more control over the interface parameters and fine-tuning models directly from MindsDB! Experiment with OpenAI models within MindsDB and unlock the ML capability over your data in minutes. Finally, if MindsDB’s vision to democratize ML sounds exciting, head to our community Slack, where you can get help and find people to chat about using other available data sources, ML frameworks, or writing a handler to bring your own! Follow our introduction to MindsDB’s OpenAI integration here. Also, we’ve got a variety of tutorials that use MySQL and MongoDB: Question Answering in MySQL Text Summarization in MySQL Sentiment Analysis in MongoDB Question Answering in MongoDB Text Summarization in MongoDB ​What’s Next? Have fun while trying it out yourself! Bookmark MindsDB repository on GitHub. Engage with the MindsDB community on Slack or GitHub to ask questions and share your ideas and thoughts. If this tutorial was helpful, please give us a GitHub star here.Was this page helpful?YesNoSuggest editsRaise issueAssistantResponses are generated using AI and may contain mistakes. --- Skip to main contentMindsDB home pageDocumentationAsk AICopy pageSearch...MindsDB home pageSearch...NavigationGet StartedMindsDB, an AI Data SolutionGet StartedIntroductionQuickstartReleasesSetupInstallationConfigurationLearn moreWatch VideoSlackGitHubWebsiteOn this pageCore PhilosophyInstall MindsDBMindsDB enables humans, AI, agents, and applications to get highly accurate answers across sprawled and large scale data sources. ​Core Philosophy MindsDB is built around three fundamental capabilities that form the foundation of MindsDB, enabling seamless integration, organization, and utilization of data. 1ConnectConnect data from hundreds of data sources that integrate with MindsDB, including databases, data warehouses, applications, and vector databases.Learn more here.2UnifyUnify and organize data from one or multiple (structured and unstructured) data sources, by creating knowledge bases, views and jobs.Learn more here.3RespondGenerate accurate, context-aware responses from unified data using agents or MCP API, making insights easily accessible across applications and teams.Learn more here. ​Install MindsDB MindsDB is an open-source server that can be deployed anywhere, including local machines and clouds, and customized to fit the purpose. Use MindsDB via Docker Desktop. This is the fastest and recommended way to get started. Use MindsDB via Docker. This provides greater flexibility in customizing the MindsDB instance by rebuilding Docker images. Use MindsDB via AWS Marketplace. This enables running MindsDB in cloud. Use MindsDB via PyPI. This option enables contributions to MindsDB. Was this page helpful?YesNoSuggest editsRaise issueQuickstartAssistantResponses are generated using AI and may contain mistakes. By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Accept All Cookies Reject AllCookies SettingsPrivacy Preference CenterWhen you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer. More informationAllow All Manage Consent PreferencesPerformance Cookies Performance Cookies These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.Functional Cookies Functional Cookies These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.Targeting Cookies Targeting Cookies These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.Strictly Necessary CookiesAlways ActiveThese cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.Cookie List Clear checkbox label labelApply CancelConsent Leg.Interest checkbox label label checkbox label label checkbox label labelReject All Confirm My Choices --- Skip to main contentMindsDB home pageDocumentationAsk AICopy pageSearch...MindsDB home pageSearch...NavigationGet StartedTutorial to Get Started with MindsDBGet StartedIntroductionQuickstartReleasesSetupInstallationConfigurationLearn moreWatch VideoSlackGitHubWebsiteOn this pageStep 1. ConnectStep 2. UnifyStep 3. RespondBefore we start, install MindsDB locally via Docker or Docker Desktop. Get started with MindsDB in a few simple steps: 1ConnectConnect one or more data sources. Explore all available data sources here.2UnifyUnify your data with knowledge bases.3RespondRespond to questions over your data with AI agents. ​Step 1. Connect MindsDB enables connecting data from various data sources and operating on data without moving it from its source. Learn more here. Connecting Structured Data Use the CREATE DATABASE statement to connect a data source to MindsDB. CopyAsk AICREATE DATABASE mysql_demo_db WITH ENGINE = 'mysql', PARAMETERS = { "user": "user", "password": "MindsDBUser123!", "host": "samples.mindsdb.com", "port": "3306", "database": "public" }; This is the input data used in the following steps: CopyAsk AISELECT * FROM mysql_demo_db.home_rentals LIMIT 3; The sample contains contains information about properties for rent. Connecting Unstructured Data Extract data from webpages using the web crawler or upload files to MindsDB. In this example, we fetch data from MindsDB Documentation webpage using the web crawler. CopyAsk AICREATE DATABASE my_web WITH ENGINE = 'web'; SELECT url, text_content FROM my_web.crawler WHERE url = 'https://docs.mindsdb.com/' Now we save this data into a view which is saved in the default mindsdb project. CopyAsk AICREATE VIEW mindsdb_docs ( SELECT url, text_content FROM my_web.crawler WHERE url = 'https://docs.mindsdb.com/' ); SELECT * FROM mindsdb.mindsdb_docs; ​Step 2. Unify MindsDB enables unifying data from structured and unstructured data sources into a single, queryable interface. This unified view allows seamless querying and model-building across all data without consolidation into one system. Learn more here. Create a knowledge base to store all your data in a single location. Learn more about knowledge bases here. CopyAsk AICREATE KNOWLEDGE_BASE my_kb USING embedding_model = { "provider": "openai", "model_name" : "text-embedding-3-large", "api_key": "your-openai-api-key" }, reranking_model = { "provider": "openai", "model_name": "gpt-4o", "api_key": "your-openai-api-key" }, content_columns = ['content']; Insert data from Step 1 into the knowledge base. CopyAsk AIINSERT INTO my_kb SELECT 'number_of_rooms: ' || number_of_rooms || ', ' || 'number_of_bathrooms' || number_of_bathrooms || ', ' || 'sqft' || sqft || ', ' || 'location' || location || ', ' || 'days_on_market' || days_on_market || ', ' || 'neighborhood' || neighborhood || ', ' || 'rental_price' || rental_price AS content FROM mysql_demo_db.home_rentals; INSERT INTO my_kb SELECT text_content AS content FROM mindsdb.mindsdb_docs; Query the knowledge base to search your data. CopyAsk AISELECT * FROM my_kb WHERE content = 'what is MindsDB'; SELECT * FROM my_kb WHERE content = 'rental price lower than 2000'; In order to keep the knowledge base up-to-date with your data, use jobs to automate data inserts every time your data is modified.CopyAsk AICREATE JOB update_kb ( INSERT INTO my_kb SELECT 'number_of_rooms: ' || number_of_rooms || ', ' || 'number_of_bathrooms' || number_of_bathrooms || ', ' || 'sqft' || sqft || ', ' || 'location' || location || ', ' || 'days_on_market' || days_on_market || ', ' || 'neighborhood' || neighborhood || ', ' || 'rental_price' || rental_price AS content FROM mysql_demo_db.home_rentals WHERE created_at > LATEST ) EVERY 1 day; ​Step 3. Respond MindsDB enables generating insightful and accurate responses from unified data using natural language. Learn more here. Create an agent that can answer questions over your unified data from Step 2. CopyAsk AICREATE AGENT my_agent USING model = { "provider": "openai", "model_name" : "gpt-4o", "api_key": "your-openai-api-key" }, data = { "knowledge_bases": ["mindsdb.my_kb"], "tables": ["mysql_demo_db.home_rentals"] }, prompt_template = 'mindsdb.my_kb stores data about mindsdb and home rentals, mysql_demo_db.home_rentals stores data about home rentals'; Now you can ask questions over your data. CopyAsk AISELECT * FROM my_agent WHERE question = 'what is MindsDB?'; Visit the Respond tab in the MindsDB Editor to chat with an agent.Was this page helpful?YesNoSuggest editsRaise issueIntroductionReleasesAssistantResponses are generated using AI and may contain mistakes. --- Skip to main contentMindsDB home pageDocumentationAsk AICopy pageSearch...MindsDB home pageSearch...NavigationGet StartedMindsDB ReleasesGet StartedIntroductionQuickstartReleasesSetupInstallationConfigurationLearn moreWatch VideoSlackGitHubWebsiteOn this pageRelease Types and VersioningRelease ProcessMindsDB releases new features, functionalitites, and fixes on regular cadence. This document outlines the release process, versioning, and naming conventions. ​Release Types and Versioning MindsDB uses semantic versioning to name all releases. This format is applied consistently across our GitHub tags, Python packages, and Docker images. Each release name follows the structure: CopyAsk AIv..() Where: MAJOR indicates the major version, which introduces significant changes or backward-incompatible updates. MINOR indicates the minor version, which introduces new features that remain backward-compatible. PATCH indicates the patch version, which introduces small fixes or improvements. TYPE is an optional component, which informs about the nature of the (pre-)release. NUMBER is an optional component used when TYPE is provided that indicates the pre-release version. The following are the release types and their naming conventions. Release TypeSample VersionDescriptionGA (General Availability)v25.9.3The stable public release. 25 is the major version, 9 is the minor version, and 3 is the patch number.Pre-GA (Release Candidate)v25.9.3rc1A release candidate that is nearly ready for GA. rc stands for release candidate, and 1 indicates the version number of the pre-release.Alphav25.9.3alpha1An early testing version with limited features or stability. alpha denotes an initial stage for internal or early feedback.Betav25.9.3beta1A version close to final release. beta indicates a feature-complete build shared for broader testing and feedback. ​Release Process The main branch of the MindsDB repository contains the latest stable version of MindsDB and represents the GA (General Availability) release. MindsDB adheres to the release process as follows. 1Release PreparationA short-lived release/x.x.x branch is created for each release where all code changes for that release are pushed.2Development PhaseDevelopers create feature PRs that target the release/x.x.x branch. This branch is used for testing and validation of the release.3Pre-GA ReleasePre-GA artifacts are built, including both the Python package and the Docker image, and shared for broader testing and feedback.4GA ReleaseAfter successful testing and validation, the release/x.x.x branch is merged into the main branch, making it an official GA release. The final GA versions of the Python package and Docker image are released. If you are interested in contributing to MindsDB, follow this link.Was this page helpful?YesNoSuggest editsRaise issueQuickstartDocker DesktopAssistantResponses are generated using AI and may contain mistakes.