CrewAI Integration
Dinobase provides CrewAI tools that let your agents query business data from 100+ SaaS APIs, databases, and files via SQL.
Install
Section titled “Install”pip install crewai dinobaseSet up your data sources:
dinobase initdinobase add stripe --api-key sk_test_...dinobase add hubspot --api-key pat-...dinobase syncSee Connecting Sources for the full list of 100+ supported sources, and Syncing & Scheduling for background sync options.
Four tools are available:
| Tool | Description |
|---|---|
dinobase_query | Execute SQL queries (DuckDB dialect) |
dinobase_describe | Get table schema, types, and sample data |
dinobase_list_sources | List connected sources with freshness status |
dinobase_refresh | Re-sync a stale data source |
Quick Start
Section titled “Quick Start”from crewai import Agent, Crew, Process, Taskfrom 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)How It Works
Section titled “How It Works”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:
dinobase_list_sources— discover what data is availabledinobase_describe— understand table schemas before writing SQLdinobase_query— execute cross-source SQL queries- 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).
Example Crew
Section titled “Example Crew”See the example crew for a complete data analyst agent:
python examples/data_analyst_crew.py "What is our monthly revenue trend?"Next steps
Section titled “Next steps”- Getting Started — Full setup walkthrough
- Connecting Sources — Add your business data
- Querying Data — SQL patterns and cross-source joins
- Syncing & Scheduling — Keep data fresh
- Schema Annotations — Add context for AI agents
- Python API Reference — QueryEngine and SyncEngine