2026-07-13 –, AI/ML
Large Language Models (LLMs) are transforming how we build applications, but the path from "cool demo" to "production-ready tool" is littered with challenges: hallucinations, verifiability, and more. This tutorial covers the basics of how to build AI apps that avoid these challenges, yet are still effective and simple to build.
We'll start with querychat, an open-source package that lets users explore data through natural language. querychat demonstrates a powerful pattern: rather than letting an LLM access raw data directly (where it can hallucinate calculations), it constrains the LLM to generate SQL queries that are displayed and executed by a proper database engine. This "tool-based" architecture ensures reliability through transparency and precision -- users see exactly what query was executed along with it's exact results.
From there, we'll peel back the layers to reveal chatlas, the foundation powering querychat. chatlas provides a unified, provider-agnostic interface to 19+ LLM providers (OpenAI, Anthropic, Google, local models via Ollama, and more). You'll learn how chatlas makes it trivial to:
- Build multi-turn conversations with history management
- Stream responses in real-time for responsive UIs
- Switch between providers with minimal code changes
- Define custom tools that let LLMs interact with external systems (safely)
- Extract structured data using Pydantic models
By the end of this tutorial, we'll have built two complete apps: a data exploration chatbot (using querychat with your own data) and a custom AI assistant with tools you define. You'll leave with practical patterns for constraining LLM behavior, validating outputs, and building apps that are genuinely useful, maintainable and production ready.
Installation Instructions: Go to dev.workshop.posit.team and sign in prior to the workshop. This will ensure you can access the provided computing environment for the tutorial. Once logged in, click "New Session", then "Launch". You may see a blank page for a minute before being directed to a hosted Positron session (https://positron.posit.co/). If you run into issues, or have any questions, please email carson@posit.co.
Basic understanding of Python, web apps, and AI
Installation Instructions:The required packages are at https://gist.github.com/mwcraig/ 3ffc1733ce6c8618c73cb471d1da4a90. A short script to test your installation is at https://gist.github.com/mwcraig/408b404014600a43ccfd1db7baaac51f
Carson is currently a Principal Software Engineer at Posit Software, PBC. He's an original author and maintainer of projects such as shiny, shinywidgets, shinylive, and chatlas. Prior to joining Posit, Carson was an engineer at Plotly for numerous years, won the ASA's Chambers Award, and received his PhD in 2017.