LangChain tools for Hotdata runtime
Project description
hotdata-langchain
Give your LangChain agents access to Hotdata — run SQL against your workspace connections and work with managed databases.
Install
pip install hotdata-langchain
Authentication
Set HOTDATA_API_KEY in your environment. Optionally set HOTDATA_WORKSPACE to pin a specific workspace (the first available workspace is used if unset).
Quickstart
from langchain.agents import AgentExecutor, create_tool_calling_agent
import hotdata_langchain as hl
client = hl.from_env()
tools = hl.make_hotdata_tools(client)
agent = create_tool_calling_agent(llm=your_llm, tools=tools, prompt=your_prompt)
executor = AgentExecutor(agent=agent, tools=tools)
result = executor.invoke({"input": "How many rows are in the orders table?"})
Tools
make_hotdata_tools(client) returns a list of LangChain StructuredTool objects ready to pass to any agent:
| Tool | What it does |
|---|---|
hotdata_execute_sql |
Run a SQL query and return rows as JSON |
hotdata_list_managed_databases |
List available managed databases |
hotdata_create_managed_database |
Create a new managed database |
hotdata_load_managed_table |
Load a parquet file into a managed table |
Calling tools directly
You can also invoke tools outside of an agent loop:
tools = {t.name: t for t in hl.make_hotdata_tools(client)}
result = tools["hotdata_execute_sql"].invoke({"sql": "SELECT * FROM orders LIMIT 10"})
print(result) # JSON rows
tools["hotdata_create_managed_database"].invoke({
"name": "sales",
"schema_name": "public",
"tables": "orders,customers",
})
tools["hotdata_load_managed_table"].invoke({
"database": "sales",
"table": "orders",
"file": "/path/to/orders.parquet",
})
Scoping queries to a managed database
Pass database= so all SQL the agent runs resolves against a specific managed database:
tools = hl.make_hotdata_tools(client, database="sales")
Controlling result size
Limit how many rows are returned to the LLM. Useful for keeping responses within context limits (default: 100):
tools = hl.make_hotdata_tools(client, max_rows=50)
Run the examples
uv run python examples/langchain_basic.py
uv run python examples/langchain_managed_db.py
Development
uv sync --locked
uv run pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hotdata_langchain-0.2.1.tar.gz.
File metadata
- Download URL: hotdata_langchain-0.2.1.tar.gz
- Upload date:
- Size: 138.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a76603a4683a999852e761269d409e260fec7004f4aa480133394390355c2f6a
|
|
| MD5 |
5af3c8d667f69be063ef52a35a9a0500
|
|
| BLAKE2b-256 |
fa1e716e8157ee479a833d12c83992859a939bb828dd551d81c047dbf0fb5480
|
Provenance
The following attestation bundles were made for hotdata_langchain-0.2.1.tar.gz:
Publisher:
publish.yml on hotdata-dev/hotdata-langchain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotdata_langchain-0.2.1.tar.gz -
Subject digest:
a76603a4683a999852e761269d409e260fec7004f4aa480133394390355c2f6a - Sigstore transparency entry: 1921865386
- Sigstore integration time:
-
Permalink:
hotdata-dev/hotdata-langchain@93a7f6f8deac8ef3bdb45899ad4237b81d04ab27 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/hotdata-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@93a7f6f8deac8ef3bdb45899ad4237b81d04ab27 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hotdata_langchain-0.2.1-py3-none-any.whl.
File metadata
- Download URL: hotdata_langchain-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f706bd7ce9690a258e82121175a46710f6c89edb47ba18d4afbf81463b38fe1e
|
|
| MD5 |
ff2e60a23740bcc6637c8605524f2373
|
|
| BLAKE2b-256 |
3c5d87272a8954ca171e63861d0ea247cb4f1e0ac663dbe580d5b60b588527b3
|
Provenance
The following attestation bundles were made for hotdata_langchain-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on hotdata-dev/hotdata-langchain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hotdata_langchain-0.2.1-py3-none-any.whl -
Subject digest:
f706bd7ce9690a258e82121175a46710f6c89edb47ba18d4afbf81463b38fe1e - Sigstore transparency entry: 1921865442
- Sigstore integration time:
-
Permalink:
hotdata-dev/hotdata-langchain@93a7f6f8deac8ef3bdb45899ad4237b81d04ab27 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/hotdata-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@93a7f6f8deac8ef3bdb45899ad4237b81d04ab27 -
Trigger Event:
push
-
Statement type: