Building a conversational AI tool for real-time analytics
Blog post from Tinybird
Tinybird has introduced a new feature called Explorations, a conversational UI that simplifies data interaction by allowing users to ask natural-language questions instead of writing complex SQL queries. This feature translates user queries into contextualized SQL commands, displaying results as tables and charts, and aims to streamline analytics workflows by integrating traditional Tinybird interfaces into a unified system. The underlying technology includes Next.js for streaming responses, Vercel AI SDK for chat state management, and Vertex AI for model selection and fallback options. Developing this conversational interface involved overcoming challenges with large language models (LLMs) through techniques like function calling, LLM chaining, and context management. The workflow starts with an LLM acting as an orchestrator that selects and utilizes various tools to complete tasks, such as executing queries and generating visualizations, with a limit on tool invocations to ensure efficiency. The feature aims to make data exploration more accessible and less time-consuming for users, offering a practical example of its application in analyzing product usage data. Users can try Explorations through Tinybird's cloud platform or CLI, with free sign-up options available for new users.