Query Engine for AI Analytics that builds self-reasoning AI agents across 200+ data sources using SQL.
MindsDB provides a core workflow of Connect → Unify → Respond. In the Connect phase, it supports federated access to 200+ data sources like Postgres, MongoDB, BigQuery, and Salesforce without ETL. In the Unify phase, it offers a dynamic context engine that fuses structured tables with vectorized data (text, PDF) for hybrid search combining semantic search and metadata filtering. In the Respond phase, it uses CREATE AGENT SQL syntax to create self-reasoning agents bound to LLMs and data sources, with Jobs/Triggers for automated workflows.
Built with Python 3.10+, it adopts a Handler pattern for highly modular data source extensions (organized under /mindsdb/integrations/handlers/ as {name}_handler), exposes HTTP API (port 47334, Flask-based) and MySQL protocol interfaces (port 47335), and supports standards like MCP (Model Context Protocol) and OpenTelemetry. Core is under Elastic License 2.0; integration modules use MIT License.
Suitable for enterprise knowledge search, CRM analytics, customer support automation, real-time financial data insights, and compliance review.
Installation
Docker (recommended):
docker run --name mindsdb_container \
-e MINDSDB_APIS=http,mysql \
-p 47334:47334 -p 47335:47335 \
mindsdb/mindsdb:latest
PyPI:
pip install mindsdb
Usage Examples
Cross-source JOIN to create a view:
CREATE VIEW risky_renewals AS (
SELECT *
FROM mongodb.support_tickets AS reviews
JOIN salesforce.opportunities AS deals
ON reviews.customer_domain = deals.customer_domain
WHERE deals.type = "renewal"
AND reviews.sentiment = "negative"
);
Create a Knowledge Base:
CREATE KNOWLEDGE_BASE customers_issues
USING
storage = my_vector.db,
content_columns = ['ticket_description'],
metadata_columns = ['customer_name', 'segment', 'revenue', 'is_pending_renewal'];
Create an AI Agent:
CREATE AGENT my_agent
USING
model = {
"provider": "openai",
"model_name": "gpt-xx",
"api_key": "sk-..."
},
data = {
"knowledge_bases": ["mindsdb.customer_issues"],
"tables": ["salesforce.opportunities", "postgres.sales", "mongodb.support_tickets"]
},
prompt_template = 'my prompt template and agent guidance';