LangChain / LangGraph
Dinobase provides a LangChain toolkit that lets your agents query business data from 100+ SaaS APIs, databases, and files via SQL.
Install
Section titled “Install”pip install langchain langchain-anthropic langgraph 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.
The DinobaseToolkit provides four tools:
| 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 |
LangGraph Agent
Section titled “LangGraph Agent”from langchain_anthropic import ChatAnthropicfrom langgraph.prebuilt import create_react_agentfrom integrations.langchain.toolkit import DinobaseToolkit
model = ChatAnthropic(model="claude-sonnet-4-6")toolkit = DinobaseToolkit()
agent = create_react_agent( model=model, tools=toolkit.get_tools(), prompt="You are a data analyst with access to Dinobase.",)
result = agent.invoke({ "messages": [{"role": "user", "content": "Which customers churned last quarter?"}]})print(result["messages"][-1].content)Standalone Tool Binding
Section titled “Standalone Tool Binding”You can also bind tools directly to a model without a full agent:
from langchain_anthropic import ChatAnthropicfrom integrations.langchain.toolkit import DinobaseToolkit
model = ChatAnthropic(model="claude-sonnet-4-6")toolkit = DinobaseToolkit()
model_with_tools = model.bind_tools(toolkit.get_tools())response = model_with_tools.invoke("What data sources are available?")How It Works
Section titled “How It Works”The toolkit wraps Dinobase’s Python API (QueryEngine). When the agent calls dinobase_query, it executes SQL against your local DuckDB database containing synced data from all connected sources.
The typical agent workflow:
dinobase_list_sources— discover available datadinobase_describe— understand table schemasdinobase_query— run cross-source SQL queries- Present and analyze 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
Section titled “Example”See the example agent for a complete LangGraph ReAct agent:
export ANTHROPIC_API_KEY=sk-ant-...python examples/react_agent.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