Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
New features
- Added support for Snowflake Semantic Views. When connected to Snowflake (via SQLAlchemy or Ibis), querychat automatically discovers available Semantic Views and includes their definitions in the system prompt. This helps the LLM generate correct queries using the
SEMANTIC_VIEW()table function with certified business metrics and dimensions. (#200)
[0.5.1] - 2026-01-23
New features
QueryChat()now supports deferred data source initialization for Shiny Core applications. Passdata_source=Noneat initialization time, then provide the actual data source via thedata_sourceparameter ofserver()or by setting thedata_sourceproperty. This enables use cases where the data source depends on session-specific authentication or per-user database connections. (#202)
[0.5.0] - 2026-01-16
New features
- Added support for Gradio, Dash, and Streamlit web frameworks in addition to Shiny. Import from the new submodules:
from querychat.gradio import QueryChatfrom querychat.dash import QueryChatfrom querychat.streamlit import QueryChat
Each framework’s QueryChat provides .app() for quick standalone apps and .ui() for custom layouts. Install framework dependencies with pip extras: pip install querychat[gradio], pip install querychat[dash], or pip install querychat[streamlit]. (#190)
QueryChat()gains support for more data sources:polars.LazyFrame: queries execute lazily viapolars.SQLContext. In this case,.df()et al. methods will return apolars.LazyFrame. (#191)ibis.Table: queries execute lazily via the Ibis backend’s SQL interface (DuckDB, PostgreSQL, BigQuery, etc.). In this case,.df()et al. methods will return anibis.Table. (#193)pyarrow.Table: queries execute in-memory viaduckdb. In this case,.df()et al. methods will return apyarrow.Table. (#196)
Improvements
- Improved typing support for return types on
.df()et al. (#196)
Changes
DataFrameSourcemethods now (once again) return the input DataFrame type (e.g.,pandas.DataFrame) instead ofnw.DataFrame. (#196)
[0.4.0] - 2026-01-14
Breaking Changes
- Methods like
execute_query(),get_data(), anddf()now return anarwhals.DataFrameinstead of apandas.DataFrame. This allows querychat to drop itspandasdependency, and for you to use anynarwhals-compatible dataframe of your choosing.- If this breaks existing code, note you can call
.to_native()on the new dataframe value to get yourpandasdataframe back. - Note that
polarsorpandaswill be needed to realize asqlalchemyconnection query as a dataframe. Install withpip install querychat[pandas]orpip install querychat[polars]
- If this breaks existing code, note you can call
New features
QueryChat.console()was added to launch interactive console-based chat sessions with your data source, with persistent conversation state across invocations. (#168)QueryChat.client()can now create standalone querychat-enabled chat clients with configurable tools and callbacks, enabling use outside of Shiny applications. (#168)The tools used in a
QueryChatchatbot are now configurable. Use the newtoolsparameter ofQueryChat()to select either or both"query"or"update"tools. Choosetools=["update"]if you only want QueryChat to be able to update the dashboard (useful when you want to be 100% certain that the LLM will not see any raw data). (#168)QueryChat.sidebar(),QueryChat.ui(), andQueryChat.server()now support an optionalidparameter to create multiple chat instances from a singleQueryChatobject. (#172)
Improvements
The update tool now requires that the SQL query returns all columns from the original data source, ensuring that the dashboard can display the complete data frame after filtering or sorting. If the query does not return all columns, an informative error message will be provided. (#180)
Obvious SQL keywords that lead to data modification (e.g.,
INSERT,UPDATE,DELETE,DROP, etc.) are now prohibited in queries run via the query tool or update tool, to prevent accidental data changes. If such keywords are detected, an informative error message will be provided. (#180)
[0.3.0] - 2025-12-10
Breaking Changes
The entire functional API (i.e.,
init(),sidebar(),server(), etc) has been hard deprecated in favor of a simpler OOP-based API. Namely, the newQueryChat()class is now the main entry point (instead ofinit()) and has methods to replace old functions (e.g.,.sidebar(),.server(), etc). (#101)The
.sql()method now returnsNoneinstead of""(empty string) when no query has been set, aligning with the behavior of.title()for consistency. Most code using theoroperator orreq()for falsy checks will continue working without changes. Code that explicitly checkssql() == ""should be updated to use falsy checks (if not sql()) or explicit null checks (if sql() is None). (#146)
New features
New
QueryChat.app()method enables quicker/easier chatting with a dataset. (#104)Enabled bookmarking by default in both
.app()and.server()methods. In latter case, you’ll need to also specify thebookmark_store(either inshiny.App()orshiny.express.app_opts()) for it to take effect. (#104)The current SQL query and title can now be programmatically set through the
.sql()and.title()methods ofQueryChat(). (#98, #101)New
querychat.datamodule provides sample datasets (titanic()andtips()) to make it easier to get started without external dependencies. (#118)Added a
.generate_greeting()method to help you create a greeting message for your querychat bot. (#87)Added
querychat_reset_dashboard()tool for easily resetting the dashboard filters when asked by the user. (#81)
Improvements
Added rich tool UI support using shinychat development version and chatlas >= 0.11.1. (#67)
querychat’s system prompt and tool descriptions were rewritten for clarity and future extensibility. (#90)
Tool detail cards can now be expanded or collapsed by default when querychat runs a query or updates the dashboard via the
QUERYCHAT_TOOL_DETAILSenvironment variable. Valid values are"expanded","collapsed", or"default". (#137)
[0.2.2] - 2025-09-04
- Fixed another issue with data sources that aren’t already narwhals DataFrames (#83)
[0.2.1] - 2025-09-04
- Fixed an issue with the query tool when used with SQLAlchemy data sources. (@npelikan #79)
[0.2.0] - 2025-09-02
querychat.init()now accepts aclientargument, replacing the previouscreate_chat_callbackargument. (#60)The
clientcan be:- a
chatlas.Chatobject, - a function that returns a
chatlas.Chatobject, - or a provider-model string, e.g.
"openai/gpt-4.1", to be passed tochatlas.ChatAuto().
If
clientis not provided, querychat will use theQUERYCHAT_CLIENTenvironment variable, which should be a provider-model string. If the envvar is not set, querychat uses OpenAI with the default model fromchatlas.ChatOpenAI().- a
querychat.ui()now adds a.querychatclass to the chat container andquerychat.sidebar()adds a.querychat-sidebarclass to the sidebar, allowing for easier customization via CSS. (#68)
[0.1.0] - 2025-05-24
This first release of the querychat package.