Skip to content

CrewAI Integration

Dinobase provides CrewAI tools that let your agents query business data from 100+ SaaS APIs, databases, and files via SQL.

Terminal window
pip install crewai dinobase

Set up your data sources:

Terminal window
dinobase init
dinobase add stripe --api-key sk_test_...
dinobase add hubspot --api-key pat-...
dinobase sync

See Connecting Sources for the full list of 100+ supported sources, and Syncing & Scheduling for background sync options.

Four tools are available:

ToolDescription
dinobase_queryExecute SQL queries (DuckDB dialect)
dinobase_describeGet table schema, types, and sample data
dinobase_list_sourcesList connected sources with freshness status
dinobase_refreshRe-sync a stale data source
from crewai import Agent, Crew, Process, Task
from integrations.crewai.tools import (
dinobase_query,
dinobase_list_sources,
dinobase_describe,
)
analyst = Agent(
role="Data Analyst",
goal="Answer business questions by querying data with SQL",
backstory="You query business data across CRM, billing, and support tools.",
tools=[dinobase_list_sources, dinobase_describe, dinobase_query],
)
task = Task(
description="Which customers have overdue invoices but no recent support tickets?",
expected_output="A list of customers with supporting data.",
agent=analyst,
)
crew = Crew(
agents=[analyst],
tasks=[task],
process=Process.sequential,
)
result = crew.kickoff()
print(result)

The tools wrap Dinobase’s Python API (QueryEngine). When the agent calls dinobase_query, it executes SQL against your local DuckDB database containing synced data from all your sources.

The typical agent workflow:

  1. dinobase_list_sources — discover what data is available
  2. dinobase_describe — understand table schemas before writing SQL
  3. dinobase_query — execute cross-source SQL queries
  4. Present and analyze the results

Cross-source JOINs work via shared columns (email, company name, IDs). Tables are referenced as schema.table (e.g., stripe.customers, hubspot.contacts).

See the example crew for a complete data analyst agent:

Terminal window
python examples/data_analyst_crew.py "What is our monthly revenue trend?"