Skip to content

LlamaIndex

Dinobase provides a LlamaIndex tool spec that lets your agents query business data from 100+ SaaS APIs, databases, and files via SQL.

Terminal window
pip install llama-index llama-index-llms-anthropic 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.

from llama_index.core.agent import ReActAgent
from llama_index.llms.anthropic import Anthropic
from integrations.llamaindex.tool_spec import DinobaseToolSpec
llm = Anthropic(model="claude-sonnet-4-6")
tool_spec = DinobaseToolSpec()
agent = ReActAgent.from_tools(
tool_spec.to_tool_list(),
llm=llm,
verbose=True,
)
response = agent.chat("Which customers have overdue invoices?")
print(response.response)

The DinobaseToolSpec provides four tools via to_tool_list():

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

The DinobaseToolSpec extends LlamaIndex’s BaseToolSpec. Each method listed in spec_functions becomes a FunctionTool when you call to_tool_list(). The agent discovers tools via their docstrings and Annotated type hints.

The typical agent workflow:

  1. dinobase_list_sources — discover available data
  2. dinobase_describe — understand table schemas
  3. dinobase_query — run cross-source SQL queries
  4. 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).

See the example agent:

Terminal window
export ANTHROPIC_API_KEY=sk-ant-...
python examples/react_agent.py "What deals closed this quarter?"