1
Connect a data source
Explore all available data sources here.
2
Configure an AI engine
Explore all available AI engines here.
3
Create and deploy an AI model
MindsDB abstracts AI Models as AI Tables. This step uses the configured AI engine.
4
Query for predictions
Join the data table with the AI table to get predictions.
Step 1. Connect a data source
Use theCREATE DATABASE statement to connect a data source to MindsDB.
Step 2. Configure an AI engine
Use theCREATE ML_ENGINE command to configure an AI engine. Here we use the OpenAI engine.
Step 3. Create and deploy an AI model
Use theCREATE MODEL statement to create, train, and deploy an AI model based on the AI engine created in step 2.
{{question}} and {{article_title}} as input, and generates answer as output.
Step 4. Query for predictions
Query for predictions by joining the AI Table (from step 3) with the data table (from step 1).Step 5. Automate customized workflows
With MindsDB, you can create custom automation workflows. Let’s set up a workflow that uses Jobs and (re)creates a table with predicted answers to all questions. CREATE JOB answer_questions ( CREATE OR REPLACE TABLE data_source.questions_answers ( SELECT input.article_title, input.question, output.answer FROM mysql_demo_db.questions AS input JOIN question_answering_model AS output ) ) EVERY 1 day; Thedata_source connection should be made using the CREATE DATABASE statement to a data source with a user that has the write access.
This job creates the questions_answers table inside the connected data source. This table is filled with questions from the input data table and answers generated by the AI table. Considering that new questions are added daily to the input data table, this job executes once a day.
Alternatively, you could use the LAST keyword to fetch only the newly added questions to the input data table. That would enable you to insert new question-answer pairs into the questions_answers table instead of recreating it. But to do that, the input data table must provide either a date/time or integer/float column that would be used in the condition like datetime > LAST. Learn more about the LAST keyword here.
Next StepsFollow the links below to explore MindsDB.