LangChain, reading live tables.
Install langchain-basalt to get a retriever and a SQL tool. Agents and chains read current rows from Basalt with no ETL step.
Install langchain-basalt to get a retriever and a SQL tool. Agents and chains read current rows from Basalt with no ETL step.
BasaltRetriever runs vector search on a view's embedding column and returns Documents with row metadata. BasaltQueryTool lets an agent run read-only SQL against allowed views. Both use the Python SDK under the hood.
pip install langchain-basalt and create a scoped token. Pass the token and view names when you build the retriever or the tool.
# create a scoped token for a LangChain app basalt connect langchain --views docs_chunks,orders_live --role readonly
Write plain SQL over the source. Basalt keeps the view current with every record and tracks lineage back to the topic, partition and offset.
CREATE MATERIALIZED VIEW revenue_by_min AS SELECT date_trunc('minute', ts) AS minute, currency, sum(amount) AS revenue, count(*) AS payments FROM payments WHERE status = 'captured' GROUP BY 1, 2;
Every view is an endpoint the moment it exists. Call it over REST, connect with any Postgres client, or use the SDK from your app.
curl https://api.basalt.dev/v1/views/revenue_by_min?limit=5 \ -H "Authorization: Bearer $BASALT_TOKEN"
Vector search with column filters, returned as LangChain Documents.
Agents run read-only SQL on allowed views, with row limits enforced.
Retrieval reads current rows, so answers reflect data from seconds ago.
Use both as nodes or tools in LangGraph agents without wrappers.