Agents enable conversation with data, including structured and unstructured data connected to MindsDB.Connect your data to MindsDB by connecting databases or applications or uploading files. Users can opt for using knowledge bases to store and retrieve data efficiently.Create an agent, passing the connected data and defining the underlying model.
Copy
Ask AI
CREATE AGENT my_agentUSING model = { "provider": "openai", "model_name" : "gpt-4o", "api_key": "sk-abc123" }, data = { "knowledge_bases": ["mindsdb.sales_kb", "mindsdb.orders_kb"], "tables": ["postgres_conn.customers", "mysql_conn.products"] }, prompt_template=' mindsdb.sales_kb stores sales analytics data mindsdb.orders_kb stores order data postgres_conn.customers stores customers data mysql_conn.products stores products data ';
Query an agent and ask question over the connected data.
Copy
Ask AI
SELECT answerFROM my_agent WHERE question = 'What is the average number of orders per customers?';